-
Notifications
You must be signed in to change notification settings - Fork 9
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
Overcome limitations in gvar? #150
Comments
Tents that would just "stay up" towards the end of the axis would be very useful. |
@behdad what do you think the glyph limit will be imposed by avar2 in this case? |
A related issue with gvar is a limitation with "shared tuples", such that only "peak" tuples can be shared; "start" and "end" tuples must be embedded in the gvar data for each glyph. Now if a font does not have any intermediate masters, this is fine, since "start" and "end" are implied by "peak", and a well-built font has all such tuples shared. But if a font has an intermediate form at the same designspace location in all glyphs — a very common case — then we waste lots of space duplicating our "start" and "end" tuple definitions as embedded tuples. The issue gets potentially serious when axisCount gets large. The size of each tuple is axisCount * 2 (2 = sizeof F2DOT14). Examples:
It will be noted that if one was to 10x the number of axes in Recursive, all the new axes having no gvar deltas, the tuple data would nevertheless bloat by 10x to 890000 bytes. Thus in any redesign of gvar I would hope that intermediate tuples can be shared, as well as peak tuples. One way to do this would be to store the intermediate tuples as sets of three (start, peak, end) in the sharedTuples array. A flag in the tuple variation tables would control whether only the peak or all 3 tuples should be read from the given tupleIndex. Note that, because of flags in the tupleIndex field, the maximum number of shared tuple ids is currently 4096, which may be too small. Another method would be to provide gvar an ItemVariationStore (containing 0 ItemVariationData structures) to store all the regions used in gvar, thereby simplifying TupleVariationHeader to point to a regionId in the IVS, dropping the fields tupleIndex, peakTuple, intermediateStartTuple, intermediateEndTuple. Centralizing the storage of regions will also have a (marginal?) performance benefit, since the scalar associated with each region can be calculated just once, indexed by regionId. [edited] |
"Tents that stay up" could be defined within the existing data structure: the
We could say that if |
TBH. I think that "tents that can stay up" are way more useful here than per-glyph avar2, given that the former easily "shelves" off multi-dimensional spaces beyond set limits, and the latter is already notoriously hard to express such a "fence", as so eloquently demoed by Laurence. |
"Per-glyph avar2" doesn't make sense to me. You already can do that: define whatever new axis you want in avar2, and use it only in a subset of glyphs. All limitations shown come from gvar. I'm working on a replacement that allows for better sharing, etc. |
@simoncozens has been hacking up what is effectively merging a font like Roboto Flex into a font like the MegaMerged Noto Sans, and he said today:
I suspect that the current spec's gvar has limitations that real-world projects are (about to be) running into.
@justvanrossum also wrote me recently,
Do we need to explore spec changes that overcome limitations in gvar?
The text was updated successfully, but these errors were encountered: