-
Notifications
You must be signed in to change notification settings - Fork 8
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
[glyf
] Variable components
#42
Comments
I think we can draw a parallel between variable components and non-linear-interpolations, the first enabling the second. AtomicElement.mp4 |
Suggesting that we use |
The spec says any negative value indicates a composite. I’ve only ever seen -1 in fonts I’ve looked at, but it would be good to do a survey, if anyone has a million fonts, @twardoch? |
Well, it says: " If the number of contours is greater than or equal to zero, this is a simple glyph. If negative, this is a composite glyph — the value -1 should be used for composite glyphs. |
In the Version 1.9 currently on microsoft.com it states:
... which is weaker than “-1 should be used”. |
I quoted from other part of the same page :)). |
How about we regard numberOfContours as a bit field (with bit 15 always set, and with all bits set by default), to allow various future glyph encodings or features? To flag 24-bit glyphIds we can unset bit 0, resulting in a value of, er, -2. |
Thanks for this nice video, @JeremieHornus. I assume that any axes used in components are to be “locked” in terms of the user adjusting axes. So in this example, the axes straight, bending*1, bending*2, pinch*1 and pinch*2 would be locked in position by the component mechanism (and be hidden from the UI), while weight would work as normal. Is that correct? |
Yes that's correct, these 'coupled' axes would be hidden from the font user's view, only used when actually instatiating the variable components into another glyph. But even the 'weight' axis could be a local one only used at the glyph level (as opposed to the 'wght' axis of the font). |
How does a rasterizer distinguish the two types of axis? (Let’s forget about HOI for a moment.) A flag in fvar? |
There's already a "private" flag in fvar. |
yeah that's likely enough to set these local axes "private". |
The existing HIDDEN_AXIS flag is not sufficient, is it? I’m assuming these component variation deltas are stored using normal encoding in the gvar table, along with the normal deltas for the user-facing axes. The variation engine needs to know that these axes are never to be adjusted on a font-wide level (whether by a human or a machine), because that would lead to a conflict between the font’s designspace location and the component’s designspace location within a composite glyph. Therefore I believe we require a new flag for these axes that declares any axis settings at the font level must be ignored. EDIT: I see that @justvanrossum @behdad @rsheeter discussed this here, with @justvanrossum proposing the component’s axis setting simply overrides a global axis setting and some discussion about whether “offsetting” should be allowed (I presume this means that conflicting global and component deltas would be summed). |
As per your edit, I don't see the extra need. The component simply overrides the value. It's up to the designer / tooling to ensure that this makes sense. In other words, an old engineering rule holds: Garbage In, Garbage Out. |
Consensus is override or sum? (I tentatively vote sum, just in case it’s useful. But others have been working with real fonts, so I defer to them.) |
Forget about numberOfContours for now. componentFlags already has 4 bits available. I'm going to use (0x2000) to mean "glyphID is 24bit" for now. |
I'm not aware of data to support picking one or the other yet? |
I split off the >64k glyph access into #59 |
This is my current thinking: There will be a new table that holds an ItemVariationStore and possibly an "adjustment list". Then each composite in the glyph table can refer to an adjustment in the adjustment list when invoking a component glyph. An adjustment in the adjustment list will list a number of axes and variation-store indices for the adjustments to be made to that axis before rendering the glyph invoked. |
The adjustment-list can use a DeltaSetIndexMap structure, then components need to encode a start offset and number of entries. |
Our current Variable Component system also requires a fully variable transformation, in function close to the COLRv1 transform/scale/rotate/etc Paints. |
Ah, right. Then I think a new composite glyph format is needed. |
Okay, then something similar to: but without the VarStore, and embedded in glyf table as a new glyph composite type with numberOfContours=-2. |
I'm working on a proposal to store Variable Component data in UFO: https://github.com/BlackFoundryCom/variable-components-in-ufo. I will soon make some test/demo fonts, and will implement it as part of Fontra. I would like this to be in line with what we expect Variable Components to be able to do in OpenType, so we can use this as a source format. |
To address two limitations:
To be written...
Update: The >64k part was moved to #59
The text was updated successfully, but these errors were encountered: