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

Add public.fontInfo to designSpaceLib specification #3358

Merged
merged 10 commits into from
Dec 8, 2023

Conversation

colinmford
Copy link
Contributor

Fixes #2608, Fixes #2606, and Fixes #3272.

This PR was requested by @belluzj.

This PR adds the proposed public.fontInfo lib item to the designSpaceLib specification, with examples as discussed in #2608.

@belluzj @khaledhosny @anthrotype I very much welcome a review and feedback. This is my first time contributing to the designSpaceLib specification and I'm sure I got something wrong here or there. I really believe in the power and flexibility this lib item could provide if it is supported by build tools, so I tried to be as specific as possible in its description.

Thanks!

Copy link
Collaborator

@benkiel benkiel left a comment

Choose a reason for hiding this comment

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

See notes about language

Copy link
Contributor Author

@colinmford colinmford left a comment

Choose a reason for hiding this comment

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

changed some instances of "should" to "must" in compliance with the UFO spec and RFC 2119

Doc/source/designspaceLib/index.rst Outdated Show resolved Hide resolved
Doc/source/designspaceLib/index.rst Outdated Show resolved Hide resolved
@behdad
Copy link
Member

behdad commented Dec 1, 2023

I recently needed to find the UPEM of a designspace. Does this address that? Or I still have to look into the UFOs?

@anthrotype
Copy link
Member

I recently needed to find the UPEM of a designspace. Does this address that? Or I still have to look into the UFOs?

in theory, it could, yes. If the public.fontInfo lib key is present and defines unitsPerEm, it would override the one in the sources, like other fontinfo attributes defined in there. However it's unlikely that one would want to use the public.fontInfo key to override unitsPerEm (strictly override i.e. use a different value than the UFO sources have), because that would change the relative scale of all the outlines coordinates. This new proposed lib key is mostly for other kind of metadata that one would like to differ from the default UFO source fontinfo (e.g. names), or for when the same default UFO source is referenced in different variable-font elements.

Anyway, the answer is yes, technically one should check the new public.fontInfo first, following the precendence order i.e. in the global DS.lib (as Jany proposed), then inside the specific variable-font lib, finally inside the default UFO source fontinfo.

We shall probably add some methods to lookup fontinfo attributes for the whole designspace or particular VF/instances within it that take into account this inheritance logic.

…ppear in the root lib, and defining the order of inheritance
Copy link
Contributor Author

@colinmford colinmford left a comment

Choose a reason for hiding this comment

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

Incorporated feedback into a new commit

Doc/source/designspaceLib/index.rst Outdated Show resolved Hide resolved
Doc/source/designspaceLib/index.rst Outdated Show resolved Hide resolved
@colinmford
Copy link
Contributor Author

@belluzj @anthrotype I updated the lib definition, have a look!

Copy link
Contributor

@belluzj belluzj left a comment

Choose a reason for hiding this comment

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

Looks very clear to me, thanks!

Doc/source/designspaceLib/index.rst Outdated Show resolved Hide resolved
Doc/source/designspaceLib/index.rst Outdated Show resolved Hide resolved
Doc/source/designspaceLib/xml.rst Outdated Show resolved Hide resolved
colinmford and others added 3 commits December 7, 2023 14:02
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
@colinmford
Copy link
Contributor Author

@anthrotype corrections made, thank you!

@anthrotype anthrotype merged commit a13f6fd into fonttools:main Dec 8, 2023
11 checks passed
@anthrotype
Copy link
Member

Thanks @colinmford - Now we'll need to think about how to implement support for this, in ufo2ft, designspaceLib and varLib

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