[OTVar] GVAR delta-popping

Ray LarabieRay Larabie Posts: 1,376
edited September 2016 in Font Technology
I'm sorry if I this is something that's already in the spec. I get the impression that the GVAR table will dealing mainly with deltas. In the overview, there's a example of how deltas could be used to make a Q tail pop at a certain weight. As I understand it, it involves moving deltas at close together positions so they quickly snap rather than move smoothly.

I'm going to refer to that effect as delta-popping. 

One of the the limitations of MM was not being able to implement structural changes during interpolation. An example of where this might be needed is the asterisk. In heavy weights, a 9 pointed asterisk looks too dense. In an ultra-light, a 5 pointed asterisk looks too light. At certain weights, I want this asterisk to change its structure; sprout more legs. I can imagine how this could be accomplished using deltas but it's kind of nasty. At certain weights (or whatever axis) I want a new shape, not just deltas.

What about the GVAR being able to show/hide shapes? The overview shows how deltas could delta-pop a very plain Q. But maybe my Q has a rather flamboyant tail and I want to completely change the structure when it pops.

If I have a pilcrow (¶) and I want the ultralight to have an open loop and the heavy to have a filled loop (no counter), I can see how it would be possible to use delta-pops to make that counter suddenly disappear in an inelegant way.

Now imagine I've got a art deco typeface and I want an axis that makes the counters toggle. I could use delta-pops to mangle the counters, tucking them away so they're unseen. I could use delta-pops to make all sorts of decorative variations. Hearts that turn into stars and flowers at certain points across the axis. But wouldn't it be more elegant if I could simply change the visibility of shapes with GVAR? I could have a Q with 2 tails and GVAR would toggle the visibility at specified locations on the axis. I could have 3 types of overlapping asterisk and toggle them in and out. I could make counters disappear, decorative elements change.

I can use Feature Variations to sub a glyph with alternates at certain weights. With the example of the asterisk, I could have alternate glyphs that would swap at certain axis locations. That would be acceptable in the case of the asterisk. But if I wanted changes throughout alphabets, it would require storing a lot glyph variants. Especially, if the changes are merely decorative like engraving, inline, polka dots etc. Why not change the visibility of shapes rather than storing alternate glyphs.

Another use for this would be for reducing detail in textured fonts. Picture a grungy alphabet with dirt speckles. I could set up a detail axis and use GVAR to have those speckles vanish. Deltas could be used to smooth out the outline. You'd end up with the ideal dirt axis. One end of the axis is filthy, the other end clean. Or you could use delta-pops to make each individual chunk of dirt vanish. But it's nasty stuff.
Tagged:

Comments

  • Khaled HosnyKhaled Hosny Posts: 289
    edited September 2016
    gvar detlas is just an efficient way to store the masters, so instead of storing to sets of outlines, you store one and the glyph table and the delta between it and the second master in the gvar table, so that if you apply the deltas you get the second master.

    The Q stuff is implemented using a simple GSUB glyph substitution that is applied under certain condition (e.g. if weight is > foo). How this works is that you draw to different Q masters, one with the long stroke and one with the short, and tell the font to use one or another based on the weight. So you can do any arbitrary transformations you might want for certain ranges.

  • Hi @Khaled Hosny
    I was referring to the technique described above the Q example. Search for "sharp transition at the overlap" in the overview.
  • Ray, I think you're confusing TT delta instructions with gvar deltas. They are not the same thing.
  • Ray LarabieRay Larabie Posts: 1,376
    edited September 2016
    @Mark Simonson Nope. I thought gvar deltas could be applied anywhere along the axis. Is that not the case?
  • But isn't "delta popping" a TT hinting thing?
  • Ray LarabieRay Larabie Posts: 1,376
    edited September 2016
    @Chris Drabsch
    I hadn't seen that. Is that Feature Variations swapping to an alt $ glyph?

    @Mark Simonson
    Now it's a GVAR thing too. From what I understand, we'll be able to throw down deltas with reckless abandon anywhere on an axis. If so, it'll will eliminate the need for doing the twist. The only reason I ever twisted was to get some control over the thickness of diagonals in the middle of each axis. But if I can delta nudge points anywhere...no twists required.

    All I'm saying about GVAR being able to hide shapes is that it would be handy to have. I can always use 
    Feature Variations to swap as many alternates as I want to. But it'd cool if I didn't have to. In case of ornamented decorative fonts: the ability to use GVAR turn elements on and off rather than adding a ton of alternate glyphs.

    So, if we can use 
    Feature Variations to substitute glyphs along an axis, does this eliminate the need for a stylistic alternates feature? You could have a style axis and people could run the slider to see the different variations or choose one of the named locations on the axis. No more hunting for the salt button.
  • @Ray Larabie
    You have correctly identified two techniques that are available for changing the structure of a glyph: use the 'rvna' GSUB feature with a Feature Variations table to substitute a different glyph, or use deltas (specifically, deltas for overlapping pairs of "intermediate" regions)


    As @Khaled Hosny noted, the font has a single outline defined for a given glyph, and then delta values are stored then describe how points can be moved to create a different variation of the outline. You can have multiple delta sets for a glyph, and for each delta set, there is an associated position within the variation space at which that delta set has maximal effect. Depending on the user-selected configuration of axis values, the deltas from the different delta sets will apply in varying degrees from zero to the maximal effect. But in every case the number of contour points (or components, in a composite) remain the same.

    So, to get a structural change, you can either use Feature Variations to switch to an entirely different glyph, or you can use deltas to move points around. You might have a custom axis to make gradual changes in glyph structure, or you could have two delta sets with slightly overlapping regions of effect within the variation space, and one of those delta sets causing certain points to suddenly "pop" (as you put it) to a significantly different position on the grid, such as ending up hidden within some other stroke.

    Are you familiar with Tom Rickner's Buffalo Gal font? This was created years ago as a TrueType GX variation font, and it uses gvar deltas associated with custom axes for a set of different structural changes, including having certain elements disappear. During the ATypI presentation, we gave a demo of Buffalo Gal to show the use of custom axes in that way. If you can find the video of the talk, look for it near the end.
  • @Ray Larabie It helps if you keep in mind that the Q can be an O with an overlapping tail. Then what @Peter Constable said :-) If you go from light to bold, the tail gets thinner and at some point there’s a sudden jump where it gets shorter (the top parts of the tail goes from being inside O’s inner outline to being outside the O’s inner outline). The points structure is the same it’s just that some parts are suddenly hidden.

    The same could be done with the dollar sign, where the vertical bar is composed of two overlapping bars, with a sudden jump where they don’t overlap anymore.

    The GSUB technique might work better with applications supporting arbitrary transitions, but this sudden delta jump might be fine for applications supporting named instances (and may take less space).
  • Georg SeifertGeorg Seifert Posts: 669
    edited September 2016
    I hadn't seen that. Is that Feature Variations swapping to an alt $ glyph?
    No, the bar is made from two paths in all masters and pop to short pieces. If you step to each frame in the video, you can see it.

    From what I understand, we'll be able to throw down deltas with reckless abandon anywhere on an axis. If so, it'll will eliminate the need for doing the twist. The only reason I ever twisted was to get some control over the thickness of diagonals in the middle of each axis. But if I can delta nudge points anywhere...no twists required.
    I would strongly suggest to keep using the twist and even keep it in the final file. That gives much better interpolation result and you don't need to add all those intermediate masters (that only would blow up the file size).
  • I think I understand now. Thanks, everyone.
  • Mark SimonsonMark Simonson Posts: 1,652
    edited September 2016
    I see what you're getting at, Ray. The key thing might be how well the UI supports it, and how understandable it is. Could get messy. OTOH, it's a bit messy as it is.
  • @Georg Seifert
    I don't think twisting is more efficient than not twisting. Picture a simple sans serif N with a weight axis. With no twists, it's 10 points. With twists, it's 12 points. Assume all points are shifted in the weight change. That's a total of 10 deltas for the non-twisted N, and 12 deltas for the twisted N. To fix the diagonal distortion in the middle weight, I only need to add 2 more deltas. That adds up to the same number of deltas using either method. With the twist method, I need to fiddle with the light and heavy in an attempt to make the middle weight look correct. With the non-twisted N, I can simply adjust the middle delta until it looks correct. Same number of deltas but easier to deal with.
  • To fix the diagonal distortion in the middle weight, I only need to add 2 more deltas. 
    That is not how it works. Intermediate deltas have to be applied to the whole outline. There are methods to encode it without specifying deltas to all points but you that uses more then one number per node as you have to specify the index, too. And you need to add deltas for some more points as the shape would distort heavily. It is like with TrueType instructions, all not touched points are interpolated. So in order to move two nodes you need to apply at lease four six deltas and you have the additional index for each node.

    And on top of that, it might be necessary to add the correction twice.

    So you end up with much more work, a less maintainable source file and a much bigger file. 

  • But if I can delta nudge points anywhere...no twists required.

    Ray, I worry that you are confused by the terminology around deltas in variable fonts, possibly because you are familiar with the notion of using delta instructions in TT hinting to move individual points. In variable fonts, delta sets are used to store glyph shapes as X,Y position deltas for points relative to the single set of stored outlines in the font. So when we're talking about deltas in variable fonts, we're not talking about instructions that are applied to points, as in TT hinting, but about the way in which glyph shapes are stored. An intermediate delta set, between the stored outline and the extremes of one or more axes, can be used to control how a shape interpolates in that region, or to activate a radical change of shape at a particular position in the design space, but I don't think talking about 'delta nudging points' is accurate, and may further confuse.
Sign In or Register to comment.