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

fs_selection WWS bit should be 0 if no name ID 21 and 22 #475

Open
ollimeier opened this issue Jan 31, 2022 · 5 comments
Open

fs_selection WWS bit should be 0 if no name ID 21 and 22 #475

ollimeier opened this issue Jan 31, 2022 · 5 comments

Comments

@ollimeier
Copy link

Hi,

according to Microsofts OT Spec the fsSelection bit 8 (=WWS) should be set if name ID 21 and 22 are NOT used.

Many typographic families contains faces that differ only in one or more of the attributes weight, width and slope. Even though a family might have a large number of member faces, if the variations are in these attributes only, then family and subfamily names provided in the 'name' table using IDs 1 and 2 or 16 and 17 will be consistent with a weight/width/slope family model. In this case, bit 8 should be set, and 'name' entries for name IDs 21 and 22 should not be included.
https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fsselection

Currently, the following code does not take care of this:

fs_selection &= 1 << 7

Cheers,
Olli

@ollimeier
Copy link
Author

It should include something like:

    name_table_obj = font_obj['name']
    name_id_21 = name_table_obj.getDebugName(21)
    name_id_22 = name_table_obj.getDebugName(22)

    if name_id_21 is None and name_id_22 is None:
        fs_selection = font_obj["OS/2"].fsSelection
        fs_selection |= 1 << 8
        font_obj["OS/2"].fsSelection = fs_selection

@m4rc1e
Copy link
Collaborator

m4rc1e commented Jan 31, 2022

Thanks for both the issue and PR.

Are you planning on using gftools to release families which may have Condensed/Expanded styles etc? I'm afraid atm, this isn't possible.

I'd be interested to hear your requirements since I'd like us to make the tools in this repo more flexible.

@ollimeier
Copy link
Author

@m4rc1e Thanks for your patient feedback. As mentioned in the PR, it seems my understanding of the use of the wws bit differs a bit from yours. Even thou I 'separate' the family into their 'wdiths', I set the wws bit when I don't use name ID 21 and 22.

@m4rc1e
Copy link
Collaborator

m4rc1e commented Feb 1, 2022

Our name records and bit settings are specific to Google Fonts. They may not follow best practices. However, please note that Source Sans, Source Serif etc also do not contain either the WWS bit or nameIds 21,22. The only families we serve which do have the WWS bit enabled are Noto since they also contain width variants so it does fulfil the WWS model.

@twardoch I seem to remember you may have had a hand in deciding name records and bit settings?

@m4rc1e
Copy link
Collaborator

m4rc1e commented Feb 1, 2022

@moontypespace do you know of any repercussions for not enabling the bit, even if the family only contains normal widths?

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

2 participants