I'm using Prawn to generate PDFs in a Rails 3 app.
Is it possible to print a Unicode string into a PDF like in a HTML view?
For example,
<%= raw "unicode_for_ཀ" %>
in show.html.erb
results in the glyph ཀ while
pdf.text raw "unicode_for_ཀ"
in show.pdf.prawn
results in the string "unicode_for_ཀ"
Tried in show.pdf.prawn
:
pdf.font "#{Prawn::BASEDIR}/data/fonts/TibMachUni-1.901b.ttf" do
pdf.text raw "unicode_for_ཀ"
end
and
pdf.font_families.update("TibMachUni" => {:normal => "#{Prawn::BASEDIR}/data/fonts/TibMachUni-1.901b.ttf" })
pdf.font("TibMachUni") do
pdf.text raw "unicode_for_ཀ"
end
This did not solve the problem.