prawn
prawn copied to clipboard
Font error with 2.5 and Adobe Acrobat
Since 2.5 i get an error with documents including the €
-character and using a custom font.
Ruby-Code is
pdf.font_families.update(
name.capitalize => {
normal: Rails.root.join("vendor/assets/fonts", name, "#{name.capitalize}-Regular.ttf"),
bold: Rails.root.join("vendor/assets/fonts", name, "#{name.capitalize}-Bold.ttf"),
italic: Rails.root.join("vendor/assets/fonts", name, "#{name.capitalize}-Italic.ttf"),
bold_italic: Rails.root.join("vendor/assets/fonts", name, "#{name.capitalize}-BoldItalic.ttf")
}
)
pdf.font name.capitalize
with name = 'arimo'
With < 2.5 it looks like that
and with 2.5
error means that the font could not be obtained and sone characters may not be visible.
ssets/218423/02024c30-0456-4c37-8e8d-28b2d87d1f59)
In Adobe Acrobat the €
is missing. Chrome/Safari/Mac OS Viewer dont show any errors.
Surely related to #1322
Any ideas?
We are seeing the same issue with prawn 2.5 PDF's when viewed in Acrobat (2024.001.20643). Some characters randomly disappear. PDF looks fine in Mac OS PDF preview.
For cross reference, I added some comments to this old issue a few weeks back, about the same problem: https://github.com/prawnpdf/prawn/issues/1206#issuecomment-2010027130
It has a small, reproducible example.
We have the same problem since updating to prawn 2.5.0 and ttfunk 1.8.0. Rolling back to prawn 2.4.0 and ttfunk 1.7.0 solved it for us.
The issue is the upgrade to ttfunk 1.8.0, see prawnpdf/ttfunk#102
Also a duplicate of #1346 but might be worth it to keep open...