unified-font-object / ufo-spec

The official Unified Font Object specification source files.
http://unifiedfontobject.org
175 stars 30 forks source link

TrueType flags in UFO #162

Closed moyogo closed 3 years ago

moyogo commented 3 years ago

Taken from TrueType instructions in UFO #93.

We need to address the composite glyph component flags (overlap, round, useMyMetrics) mentioned in https://github.com/unified-font-object/ufo-spec/issues/93#issuecomment-650106369 or https://github.com/unified-font-object/ufo-spec/issues/93#issuecomment-650253676.

From the discussion here is what it could look like:

<key>public.objectsLib</key>
<dict>
  <key>bANWxQTe5a</key>
  <dict>public.truetype.flags</dict>
    <key>useMyMetrics</key>
    <true/>
    <key>overlap</key>
    <false/>
    <key>round</key>
    <true/>
  </dict>
</dict>

Technically the useMyMetrics flag should only be used for one component. The OT spec doesn’t explicitly restrict it to one component but it is understood that only the sidebearing of only one component can be used.

The overlap flag must be only set for the first component, this is explicit in the OT spec. This is more specific to the glyph than to the component. There is also a OVERLAP_SIMPLE flag for contour glyphs, it also applies explicitly only to the first flag byte of the glyph. We should probably have a single flag in UFO that can be use for the composite glyph component OVERLAP_COMPOUND flag or the simple contour glyph OVERLAP_SIMPLE. Should we have a glif.lib["public.truetype.overlap"] key instead of a component.lib key through objectsLib?