ruby - Japanese characters not supported by rmagick -
i'm tring build voucher template rmagick, (using utf8 encoding) below small code snippet
text.annotate(template, 0, 0, 23, 155, offer_label) { self.pointsize = 16 self.font_weight = boldweight }
when provide offer_label 安価な価格でホテルを予約 (japanese) in voucher created, offer_label dispayed ????????????. offer_label stored correctly in database
template code snippet:
<html lang="en"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title><%= @from_name %></title> <style type="text/css"> a:hover { color: #09f !important; text-decoration: underline !important; } </style> </head>
i looked around suggested questions no luck.looking forward suggestions.
update: label_name displayed correctly in browser web pages, issue comes in voucher created using rmagick
1) should install japanese font(s) runtime environment(s).
you can check via magick.fonts whether you've installed or not.
2) specify font related attributes.
use draw#annotate , specify font name/font_family name you'd use.
hope helps.
Comments
Post a Comment