MCPcopy Create free account
hub / github.com/coldtype/st2 / draw

Method draw

ST2/font.py:191–228  ·  view source on GitHub ↗
(self, context)

Source from the content-addressed store, hash-verified

189 return bool(search.active_key_object(context))
190
191 def draw(self, context):
192 ko = search.active_key_object(context)
193
194 layout = self.layout
195 data = ko.st2
196 font = data.font()
197
198 fi = 0
199 row = None
200
201 def show_fea(fea):
202 nonlocal fi, row
203 if fi%4 == 0 or row is None:
204 row = layout.row()
205
206 row.prop(data, f"fea_{fea}")
207 fi += 1
208
209 for fea in font.font.featuresGPOS:
210 if not hasattr(data, f"fea_{fea}"):
211 #print("!", fea)
212 pass
213 else:
214 show_fea(fea)
215
216 for fea in font.font.featuresGSUB:
217 if not fea.startswith("cv") and not fea.startswith("ss"):
218 if not hasattr(data, f"fea_{fea}"):
219 #print(fea)
220 pass
221 else:
222 show_fea(fea)
223
224 row = layout.row()
225 row.prop(data, "kerning_pairs", text="KP (dict)")
226 row.prop(data, "kerning_pairs_enabled", text="")
227
228 row.operator("st2.show_glyph_names", icon="EMPTY_AXIS", text="Show glyph names")
229
230
231classes = [

Callers

nothing calls this directly

Calls 1

fontMethod · 0.80

Tested by

no test coverage detected