Iosevka/buildglyphs-final.patel
2015-07-30 06:25:46 +08:00

28 lines
No EOL
1.2 KiB
Text

### Zoom all glyphs by para.upmscale
set font.head.unitsPerEm : upmscale * font.head.unitsPerEm
set font.hhea.ascent : upmscale * font.hhea.ascent
set font.'OS/2'.usWinAscent : upmscale * font.'OS/2'.usWinAscent
set font.'OS/2'.sTypoAscender : upmscale * font.'OS/2'.sTypoAscender
set font.hhea.descent : upmscale * font.hhea.descent
set font.'OS/2'.usWinDescent : upmscale * font.'OS/2'.usWinDescent
set font.'OS/2'.sTypoDescender : upmscale * font.'OS/2'.sTypoDescender
set font.hhea.lineGap : upmscale * font.hhea.lineGap
set font.'OS/2'.sTypoLineGap : upmscale * font.'OS/2'.sTypoLineGap
set font.'OS/2'.sxHeight : upmscale * font.'OS/2'.sxHeight
if [upmscale != 1] : foreach glyph [items-of glyphList] : begin {
glyph.advanceWidth = glyph.advanceWidth * upmscale
if glyph.contours: foreach contour [items-of glyph.contours] : foreach point [items-of contour] : begin {
point.x = point.x * upmscale
point.y = point.y * upmscale
}
}
if [not recursive] : set font.glyf : font.glyf.filter : function [glyph] : glyph && [not glyph.dontExport]
set font.glyfMap glyphs
return font
}
exports.build = buildFont