I'm using Rails 4.2 with Prawn to generate a PDF document that contains non-roman characters. The characters are coming through as tofu, even though I've specified a unicode font that supports them like this:
font_families.update("Charis" => {
:normal => "#{Rails.root}/app/assets/fonts/CharisSILR.ttf",
:bold => "#{Rails.root}/app/assets/fonts/CharisSILB.ttf"
})
font('Charis')
I used a tool to inspect the font in the PDF file and it is Charis as I specified, but it looks like the encoding used is "WinAnsi" which I think only supports the Latin character set. This is the output of my font inspecting tool:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
AAAAAG+CharisSIL-Bold TrueType WinAnsi yes yes yes 6 0
AAAAAH+CharisSIL TrueType WinAnsi yes yes yes 7 0
AAAAAI+CharisSIL TrueType WinAnsi yes yes yes 8 0
so how do I specify that I want the encoding to be UTF-8?
Toby