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

Function buildFontMenuDB

mastering/build_static.py:557–580  ·  view source on GitHub ↗

Using the values from the name map, generates a FontMenuNameDB file. *designspace* is a designspace object *root* is the directory where the FontMenuNameDB file is to be saved *name_map* is the name mapping dictionary

(designspace, root, name_map)

Source from the content-addressed store, hash-verified

555
556
557def buildFontMenuDB(designspace, root, name_map):
558 """
559 Using the values from the name map, generates a FontMenuNameDB file.
560
561 *designspace* is a designspace object
562 *root* is the directory where the FontMenuNameDB file is to be saved
563 *name_map* is the name mapping dictionary
564 """
565
566 out = ""
567 for i in designspace.instances:
568 fn, sn, m1, ps, fm = name_map[(i.familyName, i.styleName)]
569 out += (f"[{ps}]\n"
570 f" f={fn}\n"
571 f" s={sn}\n"
572 f" l={fm}\n"
573 f" m=1,{m1}\n\n"
574 )
575
576 path = os.path.join(root, "FontMenuNameDB")
577 with open(path, "w") as f:
578 f.write(out)
579
580 print("🏗 Made FontMenuDB")
581
582
583def buildGlyphOrderAndAlias(fontPath, root):

Callers 1

buildFilesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected