MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / extract_vert_to_script

Function extract_vert_to_script

tools/subset.py:376–387  ·  view source on GitHub ↗
(font_in, pe)

Source from the content-addressed store, hash-verified

374# ugly) workaround for the issue described in:
375# https://sourceforge.net/p/fontforge/mailman/fontforge-users/thread/20100906085718.GB1907@khaled-laptop/
376def extract_vert_to_script(font_in, pe):
377 with open(font_in, 'rb') as in_file:
378 data = in_file.read()
379 sfnt = Sfnt(data)
380 hhea = sfnt.hhea()
381 os2 = sfnt.os2()
382 set_os2_vert(pe, "WinAscent", os2['usWinAscender'])
383 set_os2_vert(pe, "WinDescent", os2['usWinDescender'])
384 set_os2_vert(pe, "TypoAscent", os2['sTypoAscender'])
385 set_os2_vert(pe, "TypoDescent", os2['sTypoDescender'])
386 set_os2_vert(pe, "HHeadAscent", hhea['Ascender'])
387 set_os2_vert(pe, "HHeadDescent", hhea['Descender'])
388
389
390def main(argv):

Callers 1

subset_font_rawFunction · 0.85

Calls 4

hheaMethod · 0.95
os2Method · 0.95
SfntClass · 0.85
set_os2_vertFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…