Skip to content

font setting doens't work #19

@POPPIN-FUMI

Description

@POPPIN-FUMI

I tried to use Japanese but seems like the font settings do not work.

I tried this code first

words ={"日本語"=>2, "ケール"=>2, "変更"=>2}
font = "ArialUnicode"
cloud.new(words, rotate: :none, scale: :linear, font_family: font)
cloud.draw(500, 250).write("test.png")

but empty img was created.

Also tried with the full path of the font but still the same.

font = "/usr/share/fonts/truetype/takao-gothic/TakaoPGothic.ttf"
cloud = MagicCloud::Cloud.new(words, rotate: :none, scale: :linear, font:)

I tried rmagick directly and it worked.

convert -font  /usr/share/fonts/truetype/takao-gothic/TakaoPGothic.ttf -pointsize 18 -fill black -draw "text 50,50 '表示される'" test.png out.png

Does anyone know how to output Japanese in the image?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions