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

Poor Quality Font Substitution #17401

Closed
jwillia3 opened this issue Dec 10, 2023 · 4 comments · Fixed by #17405
Closed

Poor Quality Font Substitution #17401

jwillia3 opened this issue Dec 10, 2023 · 4 comments · Fixed by #17405

Comments

@jwillia3
Copy link

jwillia3 commented Dec 10, 2023

Problem

Example PDF

Font substitutions for PDFs that use Times without embedding it are of poor quality.

It appears that the builtin Firefox viewer is trying to use DejaVu Serif as a substitute for Times.

This font choice is surprising on my system for three reasons:

  1. DejaVu Serif is not metric compatible with Times and makes the document illegible. (Specified here, if I understand this correctly)
  2. Nimbus Roman exists on my system but was not selected
  3. My system has substitutions that remap Times, Times New Roman, and Times-Roman to Linux Libertine. These are not honoured

Excerpt from fonts.conf implementing aliases

  <match target="pattern">
    <test qual="any" name="family"><string>Times</string></test>
    <edit name="family" mode="assign" binding="strong"><string>Linux Libertine</string></edit>
  </match>
  <match target="pattern">
    <test qual="any" name="family"><string>Times-Roman</string></test>
    <edit name="family" mode="assign" binding="strong"><string>Linux Libertine</string></edit>
  </match>
  <match target="pattern">
    <test qual="any" name="family"><string>Times New Roman</string></test>
    <edit name="family" mode="assign" binding="strong"><string>Linux Libertine</string></edit>
  </match>

Configuration:

Firefox 120.0 (64-bit)

# uname -a

FreeBSD pepperflower 14.0-STABLE FreeBSD 14.0-STABLE #3 stable/14-n265760-ae8387cc818a: Mon Nov 20 18:29:14 CST 2023     root@pepperflower:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

Using built-in viewer.

Steps to reproduce the problem:

  1. Remove or disable the font Times New Roman
  2. Open a PDF that uses Times without embedding it
  3. Observe an alternate font being used
  4. Re-add Times New Roman
  5. Observe the correct font being used

What is the expected behavior?

Properly using Times New Roman
times-new-roman

What went wrong?

Using DejaVu Serif substitution
dejavu-serif

@Snuffleupagus
Copy link
Collaborator

This might be a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1839860, since it looks very similar.

@jwillia3
Copy link
Author

Sorry, I didn't see that one.
I think there is still an issue that wasn't addressed on the other thread, so I'll pick it up from there.
Thank you

@calixteman
Copy link
Contributor

calixteman commented Dec 11, 2023

@jwillia3 would you mind to test with the viewer:
#17405 (comment)

According to the css specifications:

For OpenType and TrueType fonts, this string is used to match only the Postscript name or the full font name in the name table of locally available fonts.
Which type of name is used varies by platform and font, so authors should include both of these names to assure proper matching across platforms.
Platform substitutions for a given font name must not be used. 

so @font-face { src: local(...) } shouldn't use platform substitutions.

@jwillia3
Copy link
Author

@calixteman I commented on that thread.

Thanks, I did not know about that.

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

Successfully merging a pull request may close this issue.

4 participants