Notes on Progress with IFT Prototype

Demo Link <https://garretrieger.github.io/ift-demo/>

Here's the notes I have for the presentation I gave at today's call:

*Layout Feature Augmentation*

   - Added support to the prototype to add optional layout features via
   patches. This allows support for chosen layout features to be added
   dynamically via a patch when needed.
   - The demo has been updated with sample text that dynamically loads
   small caps to demonstrate this.
   - While the demo does this via shared brotli patches I also
   implemented support for this via IFTB patches.
   - With this the generic mapping table now has equivalent functionality
   to the IFTB mapping table and it's possible to convert IFTB mappings one to
   one to the generic mapping format.

*Glyph mapping, Retain gids, and Changing Loca lengths*

   - When mixing shared brotli and IFTB patches it's currently necessary to
   subset with "retain glyph ids" which keeps glyph ids stable between
   subsets. Additionally the loca table must be kept at a consistent length.
   - I experimented with removing these restrictions:
      - I added a glyph map to the mapping table which records the mapping
      from original glyph ids to whatever space the current subset is using.
      - This ended up being quite complex to implement, and in all of the
      examples I tested it performed worse (from number of bytes transferred)
      then just keeping gids stable. Therefore unless more compelling use cases
      are found, I suggest we don't include a glyph map and stick with keeping
      gids stable.
      - I updated the IFTB merger to handle changing loca lengths, this
      worked well. However, after further thought I realized that it's possible
      to craft a shared brotli patch to extend the loca table without
interfering
      with IFTB patching. This is preferable to changing the IFTB merger as it
      keeps the font internally consistent after shared brotli patch
application
      instead of relying on subsequent IFTB patching to fix loca length.

*Multiple Level Jumping*

   - I updated the encoder to produce graphs which contain jumps across a
   configurable number of levels. This allows multiple scripts to be loaded in
   a single network round trip. The demo has an added cyrillic and greek
   sample text to demonstrate this.


*Variable Design Space Augmentation*

   - I updated the prototype to support optional variable design space
   augmentation. This allows the  fonts design space to be extended by a
   patch. For example you could take a multi axis VF and include only a single
   axis in the initial file and then later on add support for the other two
   axes via patches.
   - I've updated the demo with a sample that dynamically loads a width
   axis to demonstrate this.
   - So far this is only implemented for shared brotli patches. However,
   Skef has proposed a technique to allow this to work for a mixture of shared
   brotli and IFTB patches. I will explore this next.
   - The proposed technique:
      - The font will initial include a mapping for IFTB patches that work
      with the current design space.
      - Shared brotli patches will be used to update all of the non-outline
      tables to support a new axis. Additionally, it will update the IFTB
      mappings to point to a new set of patches that are compatible with the
      extended design space. This will be done in a way that triggers the
      download of replacement IFTB patches for any currently loaded glyphs (in
      order to insert updated gvar data for those glyphs).

*Additional demo updates*

   - Added some additional Chinese sample texts that include low frequency
   characters to demonstrate how that works (existing samples contained almost
   all high frequency codepoints).

Received on Tuesday, 5 December 2023 22:32:34 UTC