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

New: add more name IDs and make sure the correct settings are fontRev… #86

Closed
wants to merge 1 commit into from

Conversation

yisibl
Copy link
Contributor

@yisibl yisibl commented Aug 30, 2019

  1. The sfntNames now support more fields:
  • designer
  • designerurl
  • license
  • licenseurl
  1. fontRevision It is no longer always 1.0.
    Based on the recommendations[1] in this document, we can now support better version number settings. It can be displayed correctly in the font editing software.

e.g. Version 5.678 beta3

FontLab VI

TODO: add test cases.

[1] https://silnrsi.github.io/FDBP/en-US/Versioning.html

@yisibl yisibl mentioned this pull request Aug 30, 2019
@yisibl
Copy link
Contributor Author

yisibl commented May 20, 2020

@puzrin please take a look?

@puzrin
Copy link
Member

puzrin commented May 20, 2020

I'd say, project tests should be reorganized with use of opentype.js instead of binary compare. Because everything flies to nightmare :).

Without normal testing it's very difficult to move forward.

// We must update the fontRevision field and ensure that a specific string is
// supported. See also: https://silnrsi.github.io/FDBP/en-US/Versioning.html
font.revision = fontVersion[3]; // Only number

font.sfntNames.push({ id: 5, value: versionString }); // version ID for TTF name table
font.sfntNames.push({ id: 6, value: (options.fullname || svgFont.id).replace(/[\s\(\)\[\]<>%\/]/g, '').substr(0, 62) }); // Postscript name for the font, required for OSX Font Book
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In name id 5, the minor version should always be three digits and should refer to the UFO specification(openTypeNameVersion): https://unifiedfontobject.org/versions/ufo3/fontinfo.plist/#opentype-name-table-fields,I can also consider adding openTypeNameUniqueID

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the implementation of ufo2ft, the default version is always 0.000. Use Python's .zfill(3) to fill 0 in front of the minor version, similar to .padStart(3, '0') in JS.

https://github.com/googlefonts/ufo2ft/blob/742b3a54408dbba99f24a9d21e32b0c499ca6ffe/Lib/ufo2ft/fontInfoData.py#L169-L175

@yisibl yisibl force-pushed the add-more-name-ids branch from 42491d6 to 7261bc0 Compare March 11, 2021 09:37
@puzrin
Copy link
Member

puzrin commented May 21, 2021

IMO this is not enough flexible and should be reworked.

  1. Split for 2 parts: pure string add and version magic.
  2. Api for string add clutter options significantly. IMO this can be added via more abstract interface, list of [ data, id, platformID, encodingID, languageID ]. That will allow to add any vendor string user can imagine.
  3. I don't like existing magic with version. It can exists, to extract 2 major numbers, when possible, but --version-num also required to define header value explicit.

@puzrin
Copy link
Member

puzrin commented Jun 17, 2021

@yisibl here are 2 PRs and 1 issue i'd like to close/replace: #86, #102, #105.

Reason: topics were mutated multiple time, and tend to be "endless".

My last opinion #86 (comment) is to create 2 new issues if that's still actual. AFAIK, all other critical things have been landed to master. Let me know what you think.

@yisibl
Copy link
Contributor Author

yisibl commented Jun 18, 2021

I'm very sorry for the late reply. When I have time, I will investigate how the APIs of other libraries are handled. You can close these issues first. Thanks!

@puzrin
Copy link
Member

puzrin commented Jun 18, 2021

Closed in favor of #111 & #112

@puzrin puzrin closed this Jun 18, 2021
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

Successfully merging this pull request may close these issues.

2 participants