Skip to content

Commit 945e126

Browse files
authoredFeb 18, 2019
add support for splitted controls where some keys are required by the spec (#28)
see #26
1 parent 455ac6f commit 945e126

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎Lib/defconAppKit/controls/fontInfoView.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -2715,7 +2715,6 @@ def woffMetadataDirectionToUFO(value):
27152715
hasDefault=False
27162716
)
27172717

2718-
27192718
# WOFF Credits
27202719

27212720
def woffMetadataCreditsFromUFO(value):
@@ -3207,6 +3206,13 @@ def woffMetadataGenericTextItemFactory(title=""):
32073206
]
32083207

32093208

3209+
controlRequiredPrototypes = {
3210+
"woffMetadataDescription": {"text": [{'text': 'Text'}]},
3211+
"woffMetadataVendor": {"name": ""},
3212+
"woffMetadataLicensee": {"name": ""},
3213+
}
3214+
3215+
32103216
# Attribute Getting and Setting
32113217

32123218
def getAttributeValue(info, attr):
@@ -3236,7 +3242,7 @@ def setAttributeValue(info, attr, value):
32363242
keys = keys[1:]
32373243
d = getattr(info, attr)
32383244
if d is None:
3239-
d = {}
3245+
d = deepcopy(controlRequiredPrototypes.get(attr, {}))
32403246
for key in keys[:-1]:
32413247
if key not in d:
32423248
d[key] = {}

0 commit comments

Comments
 (0)