LoginSignup
0
1

More than 3 years have passed since last update.

railsとcloudinaryでtextのオーバーレイを改行で入れたい

Posted at

この記事の目的

cloudinaryでtextをオーバーレイで入れる際に改行する

仕様

  • 上記でtextをoverlayで入れて%0Aを改行箇所に入れる。
  • 変数が入る場合は下記のように一度変数に格納してから代入する。
ogp_text = hogehoge + "%0A" + hogehoge
ogp_url = cl_image_path("sample.jpg",
  :transformation=>[
    {:width=>500, :crop=>"scale"},
    {:width=>470, :overlay=>{:font_family=>"Arial", :font_size=>25, :text=>ogp_text}, :crop=>"fit"}
  ],
  :sign_url=>true
)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1