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

Should use sfntVersion to pick glyph outlines #419

Open
brawer opened this issue Dec 27, 2019 · 4 comments
Open

Should use sfntVersion to pick glyph outlines #419

brawer opened this issue Dec 27, 2019 · 4 comments

Comments

@brawer
Copy link
Collaborator

brawer commented Dec 27, 2019

OpenType.js should look at the sfntVersion field in the sfnt offset table to determine whether to use PostScript or TrueType outlines.

Expected Behavior

In the Unicode test suite for text rendering engines, test case SFNT-1 should pass.

Current Behavior

Test case SFNT-1 is failing.

Possible Solution

If a font contains both CFF and glyf tables, look at the sfntVersion field in the sfnt offset table to decide which one to use.

Steps to Reproduce (for bugs)

  1. On the OpenType.js site, load test font TestSFNTOne.otf and enter AB as string to display.
  2. Expected to see CFF underneath A and B; instead got this:

image

@Pomax
Copy link
Contributor

Pomax commented Dec 27, 2019

I'm pretty sure that the test in question made the wrong assumption about what should happen in this particular case. Looking at the OpenType definition for sfntVersion, we see this clarification:

OpenType fonts that contain TrueType outlines should use the value of 0x00010000 for the sfntVersion. OpenType fonts containing CFF data (version 1 or 2) should use 0x4F54544F ('OTTO', when re-interpreted as a Tag) for sfntVersion.

Rather than saying "which data to use based on the version", the only prescription here is for "which version to use, based on the data".

At best we can only conclude that, because the sfntVersion field cannot be two values at once, whatever software generated this font did so incorrectly, giving us a font that is inconsistent with respect to the spec, and so should not even be accepted as a valid font (and someone needs to fix it).

@brawer
Copy link
Collaborator Author

brawer commented Dec 31, 2019

I’ve asked the community (at opentype-layout@unicode.org) whether or not they’d like to have the test case, cc’ing you. Let’s discuss there. Personally I have no opinions here; it seems like a rather theoretical problem anyway.

@Connum
Copy link
Contributor

Connum commented Feb 17, 2023

Was this ever resolved? Should we look at this or not?

@Connum
Copy link
Contributor

Connum commented Nov 25, 2023

@brawer seeing you were recently active - any update on this?

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

No branches or pull requests

3 participants