MCPcopy Index your code
hub / github.com/arrowtype/recursive / buildFontInfo

Function buildFontInfo

mastering/build_static.py:216–240  ·  view source on GitHub ↗

Makes the fontinfo file for the Adobe FDK Setting 'IsOS/2OBLIQUE' causes weird things to happen with italic fonts so we never set that to true. *stylename* is a `string` of the font's style (font.info.styleName) *dir* is a `string` of the path to the directory where the UFO is

(stylename, dir)

Source from the content-addressed store, hash-verified

214
215
216def buildFontInfo(stylename, dir):
217 """
218 Makes the fontinfo file for the Adobe FDK
219
220 Setting 'IsOS/2OBLIQUE' causes weird things to happen with italic fonts
221 so we never set that to true.
222
223 *stylename* is a `string` of the font's style (font.info.styleName)
224 *dir* is a `string` of the path to the directory where the UFO is
225 """
226
227 style = stylename.split()
228 bold = italic = "false"
229 if "Bold" in style:
230 bold = "true"
231 if "Italic" in style:
232 italic = "true"
233 fontinfo = (f"IsBoldStyle {bold}\n"
234 f"IsItalicStyle {italic}\n"
235 "PreferOS/2TypoMetrics true\n"
236 "IsOS/2WidthWeigthSlopeOnly true\n"
237 "IsOS/2OBLIQUE false\n")
238 path = os.path.join(dir, "fontinfo")
239 with open(path, "w") as f:
240 f.write(fontinfo)
241
242
243def writeFeature(font):

Callers 1

buildInstancesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected