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 support for 'Virtual Master' custom parameters #955

Merged
merged 7 commits into from
Nov 14, 2023
Merged

Conversation

anthrotype
Copy link
Member

Fixes #859

…axis min/max

but only for axes that are un-mapped, since virtual master coordinates have no means of mapping {user:design} so are assumed un-mapped (whereas axis min/def/max must be in user-space).
with default glyphs_multivalued=False, we end up only storing one 'Virtual Master' param; also we want to read/write these only when dealing with GSFont, not also GSFontMaster
…params

The test font 'IntermediateLayer.glyphs' has a couple of glyphs that use virtual masters to control the cap height via a 'CPHT' axis.
It contains no Axis Mappings nor Axis Location parameters, the axis coordinates are intented to be un-mapped (user==design). The virtual master custom parameters are expected to be taken into account when computing the CPHT min and max values.
somehow it fails while installing skia-pathops, trying to build from source. Probably we only need to bump requirements-dev.txt but I want to do that separately
@anthrotype
Copy link
Member Author

/cc @RosaWagner

in absence of explicit Axis Mappings or Axis Location, we infer wght/wdth user-spacelocations from the instances; however if the axis is un-mapped or resolves in an identity (no-op) mapping, there's no reason to prefer the instance-based mapping over the similarly identity/no-op mapping associated with the masters; actually it's possible that instances do not cover all the masters and thus by preferring the instances' mapping over the masters' we might produce incorrect axis min/max.
So, only use the inferred instance-based mapping when it does something interesting, otherwise keep using the master (identity) mapping.
@anthrotype
Copy link
Member Author

anthrotype commented Nov 14, 2023

I couldn't find real world font projects using virtual master custom parameters, but @MariannaPaszkowska shared with me a couple of test fonts of her and they seem to work with the current PR, so I think this this is good to go.
Do let me know if you find any issues and we can fix later.

@anthrotype anthrotype merged commit e0e4389 into main Nov 14, 2023
9 of 10 checks passed
@anthrotype anthrotype deleted the virtual-masters branch November 14, 2023 11:56
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.

support for virtual masters
1 participant