MCPcopy
hub / github.com/microsoft/cascadia-code / set_overlap_flag

Function set_overlap_flag

build.py:145–154  ·  view source on GitHub ↗
(varfont: fontTools.ttLib.TTFont)

Source from the content-addressed store, hash-verified

143
144
145def set_overlap_flag(varfont: fontTools.ttLib.TTFont) -> fontTools.ttLib.TTFont:
146 glyf = cast(_g_l_y_f.table__g_l_y_f, varfont["glyf"])
147 for glyph_name in glyf.keys():
148 glyph = glyf[glyph_name]
149 if glyph.isComposite():
150 # Set OVERLAP_COMPOUND bit for compound glyphs
151 glyph.components[0].flags |= 0x400
152 elif glyph.numberOfContours > 0:
153 # Set OVERLAP_SIMPLE bit for simple glyphs
154 glyph.flags[0] |= 0x40
155
156def prepare_fonts(
157 designspace: fontTools.designspaceLib.DesignSpaceDocument, name: str

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected