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

[tx] Don't fill FontName with "PSNameNotSpecified" #437

Closed
miguelsousa opened this issue Jun 20, 2018 · 2 comments
Closed

[tx] Don't fill FontName with "PSNameNotSpecified" #437

miguelsousa opened this issue Jun 20, 2018 · 2 comments
Assignees

Comments

@miguelsousa
Copy link
Member

If a UFO does not have a postscriptFontName value, running tx -dump -0 myfont.ufo on it will produce

sup.srcFontType     UFO (name-keyed)
## FontDict[0]
FontName            "PSNameNotSpecified"
## Private

Round-tripping such UFO with tx (using tx -ufo myfont.ufo newfont.ufo) sets the postscriptFontName value of newfont.ufo to PSNameNotSpecified.

tx should not be setting the value of postscriptFontName. The current behavior causes #282.

I don't know what the implications of NOT setting the value are, but I'll mention that tx does not set the /FontName value of a Type 1 font. Running tx -dump -0 myfont.pfa on a Type 1 font that has no FontName yields

sup.srcFontType     Type 1 (name-keyed)
## FontDict[0]
## Private
@miguelsousa miguelsousa added the tx label Jul 3, 2018
@readroberts
Copy link
Contributor

@miguelsousa @cjchapman 'tx' does need to assign a PostScript FontName when both reading a UFO without one, and writing to Type1 or CFF, as this item is required by both output formats. However, I agree that it should not write an arbitrary FontName to any output format that does not require it. I would change the code so that the arbitrary name gets assigned only when writing to outputs that require it. I can also check for this specific arbitrary PS FontName, and omit it, when writing to UFO from a Type1 or CFF that was created from a ufo without a FontName

@miguelsousa
Copy link
Member Author

I would change the code so that the arbitrary name gets assigned only when writing to outputs that require it. I can also check for this specific arbitrary PS FontName, and omit it, when writing to UFO from a Type1 or CFF that was created from a ufo without a FontName

@readroberts please do neither of those.
No arbitrary data should be assigned when reading or writing. When writing, enforce the presence of the data in the formats that require it.

The Type1 codepath is working as expected,

$ tx -t1 tests/makeotf_data/input/t1pfa-noPSname.pfa type1.pfa
tx: --- tests/makeotf_data/input/t1pfa-noPSname.pfa
tx: (t1w) bad font dictionary. Missing the PostScript FontName.

while the UFO codepath is not.

$ tx -ufo tests/makeotf_data/input/ufo3-noPSname.ufo/ ufo3.ufo
tx: --- tests/makeotf_data/input/ufo3-noPSname.ufo/
tx: (ufr) Warning: No PS name specified in source UFO font. Using 'PSNameNotSpecified'.

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

No branches or pull requests

3 participants