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

Function step_set_feature_file

build.py:67–120  ·  view source on GitHub ↗
(path: Path, name: str, instance: ufoLib2.Font)

Source from the content-addressed store, hash-verified

65
66
67def step_set_feature_file(path: Path, name: str, instance: ufoLib2.Font) -> None:
68 featureSet = ""
69 if "Italic" in name: #until I can come up with a more elegent solution, this'll do.
70 featureList = [
71 "header_italic", # adds definitions, language systems
72 "aalt_italic",
73 "ccmp",
74 "locl_italic",
75 "calt_italic",
76 "figures_italic", # contains subs/sinf/sups/numr/dnom
77 "frac",
78 "ordn",
79 "case",
80 "salt",
81 "ss01",
82 "ss02",
83 "ss03",
84 "ss19",
85 "ss20",
86 "rclt",
87 "zero"
88 ]
89 else:
90 featureList = [
91 "header", # adds definitions, language systems
92 "aalt",
93 "ccmp",
94 "locl",
95 "calt",
96 "figures", # contains subs/sinf/sups/numr/dnom
97 "frac",
98 "ordn",
99 "case",
100 "ss02",
101 "ss19",
102 "ss20",
103 "rclt",
104 "zero",
105 "init",
106 "medi",
107 "fina",
108 "rlig",
109 ]
110
111 for item in featureList:
112 if "PL" in name and item == "rclt":
113 featureSet += Path(path / str("rclt_PL.fea")).read_text()
114 elif "NF" in name and item == "rclt":
115 featureSet += Path(path / str("rclt_PL.fea")).read_text()
116 elif "Mono" in name and "calt" in item:
117 featureSet += Path(path / str(item+"_mono.fea")).read_text() #both Italic and Regular can use same mono
118 else:
119 featureSet += Path(path / str(item+".fea")).read_text()
120 instance.features.text = featureSet
121
122
123def set_font_metaData(font: ufoLib2.Font) -> None:

Callers 1

prepare_fontsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected