Just last week this was working fine and now my PDF documents are giving me this "Cannot extract the embedded font '1491bd-SourceHanSans-Normal'. Some Characters may not display correctly." error.
Been hunting for hours on this, and I looked at my recent commits and can't find any major changes that would cause this problem to arise suddenly.
Here's the basic code I am using to bug test.
def invoice_pdf
require "prawn"
# document set up
Prawn::Document.generate("PDF.pdf", :page_size => "A4", :margin => [25], disposition: "inline") do |pdf|
# set utf-8 japanese font
pdf.font_families.update("SourceHan" => {
:normal => ".fonts/SourceHan/SourceHanSans-Normal.ttf",
})
pdf.font "SourceHan"
pdf.font_size 10
pdf.text 'ハロー ワルド。'
send_data pdf.render, type: 'application/pdf', disposition: :inline
end
end
It displays correctly when opened in Google Chrome. But using acrobat or other browsers (like Firefox that use the default system preview app) it gives me the error.
Thoughts?