Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font problems in PDFs with version 1.6.* #72

Closed
georf opened this issue Jan 7, 2020 · 12 comments
Closed

Font problems in PDFs with version 1.6.* #72

georf opened this issue Jan 7, 2020 · 12 comments

Comments

@georf
Copy link

georf commented Jan 7, 2020

Yesterday I updated my Rails project to ttfunk 1.6.0. My users have problems with embedded fonts in Adobe Acrobat. German Umlauts are not displayed anymore. Adobe shows the German error: "Die eingebettete Schrift "815ef7+DejaVuSans" konnte nicht entnommen werden. Einige Zeichen werden u. U. nicht korrekt angezeigt bzw. gedruckt."

Today I updated to 1.6.1 and now all chars are not displayed with Adobe.

On my Linux System with xreader I have no problems. In Firefox I got the following errors, but there I see the Umlaut chars:

PDF 509a1cc8bc45a172ea4317787b03c5fd [1.7 itext-paulo-155 (itextpdf.sf.net-lowagie.com) / pdftk 2.02 - www.pdftk.com] (PDF.js: 2.4.43) viewer.js:1228:15
Warning: AcroForm/XFA is not supported viewer.js:1250:17
downloadable font: maxp: Bad maxZones: 0 (font-family: "g_d0_f1" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: maxp: Bad maxZones: 0 (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: OS/2: Error reading more basic table fields (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: OS/2: Failed to parse table (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: rejected by sanitizer (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: font load failed (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
Warning: Failed to load font 'g_d0_f2': 'SyntaxError: An invalid or illegal string was specified'. pdf.js:537:13
downloadable font: maxp: Bad maxZones: 0 (font-family: "g_d0_f3" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)

For now I use version 1.5.1 for my project, but I hope you understand the problem. My knowledge of PDF and TTF is not deep enough for this problem.

@mojavelinux
Copy link
Contributor

This could be the same issue as is being discussed here: #53 (comment)

@pointlessone
Copy link
Member

@georf Could you please translate the error message you get in Acrobat to English?

@mech
Copy link

mech commented Jan 8, 2020

Having some issues with certain font hiding a numeric number when rendered. Specifically the figure "8" is hidden when I used a certain font like "Anonymous Pro" for displaying numeric currency. It does not happen in 1.5.1 though. The figure will disappear visually but when using cursor to select the text and re-paste it elsewhere it will appear. Very strange issues.

@georf
Copy link
Author

georf commented Jan 8, 2020

I found the official translation at google:

Cannot extract the embedded font "815ef7+DejaVuSans". Some characters may not display or print correctly.

@mech
Copy link

mech commented Jan 8, 2020

This is essentially what I am getting also. When open in Preview macOS, it appear fine. But when opening in Adobe Acrobat, an error message like that pop out. Does not matter which font. Some works, some don't.

@pointlessone
Copy link
Member

Could someone please post a short script reproducing the issue? The one Dan posted doesn't result in an error message in Acrobat for me.

@Mazwak
Copy link

Mazwak commented Jan 8, 2020

Here is a script which does not work

# frozen_string_literal: true

gem 'ttfunk', '= 1.6.1'
require 'ttfunk'
require 'prawn'

Prawn::Document.generate('embedded_font.pdf') do
  font_families.update('LiberationSans' => {
                         normal: '../ressources/LiberationSans-Regular.ttf',
                         bold: '../ressources/LiberationSans-Bold.ttf',
                         italic: '../ressources/LiberationSans-Italic.ttf',
                         bold_italic: '../ressources/LiberationSans-BoldItalic.ttf'
                       })
  font 'LiberationSans'
  font_size 8
  text 'Hello World!'
end

If I force 1.5.1 or 1.6.0, it works.

ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]

@Mazwak
Copy link

Mazwak commented Jan 8, 2020

I tried with the string :
Hellö Wòrld!

1.5.1 : All good
1.6.0 : No errors, but special chars not showing
1.6.1 : Error, and all chars not showing

@Mazwak
Copy link

Mazwak commented Jan 8, 2020

Forgot to say I test with adobe acrobat reader DC 2019.021.20061

@georf
Copy link
Author

georf commented Feb 5, 2020

Do you can fix it?

@pointlessone
Copy link
Member

This issue should be fixed in TTFunk 1.6.2. Please upgrade and report any issues you have. Thank you for patience.

@rvfx
Copy link

rvfx commented Jun 21, 2024

The problem was reintroduced in TTFunk 1.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants