prawn icon indicating copy to clipboard operation
prawn copied to clipboard

Font error with 2.5 and Adobe Acrobat

Open Skulli opened this issue 10 months ago • 4 comments

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 working

and with 2.5

error_font_text error means that the font could not be obtained and sone characters may not be visible.

error_font_1

error_font_2 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?

Skulli avatar Apr 08 '24 08:04 Skulli

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. CleanShot 2024-04-08 at 14 26 08@2x

spovich avatar Apr 08 '24 21:04 spovich

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.

tonymarklove avatar Apr 09 '24 08:04 tonymarklove

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.

hoshy avatar Apr 09 '24 08:04 hoshy

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...

ashkulz avatar Apr 12 '24 04:04 ashkulz