(self, context)
| 91 | return False |
| 92 | |
| 93 | def draw(self, context): |
| 94 | ko = search.active_key_object(context) |
| 95 | |
| 96 | layout = self.layout |
| 97 | data = ko.st2 |
| 98 | font = data.font() |
| 99 | fvars = ko.st2.visible_variation_axes(font) |
| 100 | |
| 101 | for idx, (k, v) in enumerate(fvars.items()): |
| 102 | prop = f"fvar_axis{idx+1}" |
| 103 | |
| 104 | norm_v = getattr(data, prop) |
| 105 | diff = abs(v["maxValue"]-v["minValue"]) |
| 106 | unnorm_v = v["minValue"] + (diff * norm_v) |
| 107 | |
| 108 | row = layout.row() |
| 109 | split = row.split(factor=0.85) |
| 110 | col = split.column() |
| 111 | col.prop(data, prop, text=k) |
| 112 | #col = row.column() |
| 113 | #col.alignment = "RIGHT" |
| 114 | #col.width = 50 |
| 115 | col = split.column() |
| 116 | col.alignment = "RIGHT" |
| 117 | col.label(text="{:d}".format(round(unnorm_v))) |
| 118 | |
| 119 | if k == "wdth": |
| 120 | row = layout.row() |
| 121 | row.label(text="Fit Width") |
| 122 | row.prop(data, "fit", text="") |
| 123 | row.prop(data, "fit_enable", text="Enable") |
| 124 | |
| 125 | if ko.st2.has_keyframes(ko) or True: |
| 126 | layout.row().label(text="Variation Offsets") |
| 127 | |
| 128 | for idx, (k, v) in enumerate(fvars.items()): |
| 129 | layout.row().prop(data, f"fvar_axis{idx+1}_offset", text=f"{k} offset") |
| 130 | |
| 131 | row = layout.row() |
| 132 | row.operator("st2.load_var_axes_defaults", icon="EMPTY_AXIS", text="Set to Defaults") |
| 133 | |
| 134 | |
| 135 | class ST2FontStylisticSetsPanel(bpy.types.Panel): |
nothing calls this directly
no test coverage detected