Skip to content

Commit

Permalink
Add support for localized GSFontInfoValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstein committed Aug 2, 2024
1 parent aa7a03a commit a5c4549
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions Lib/glyphsLib/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3158,8 +3158,15 @@ def value(self):
return list(self._localized_values.values())[0]

@value.setter
def value(self, value):
self._value = value
def value(self, values):
if type(values) is list:
self._localized_values = {}
for v in values:
if "language" not in v or "value" not in v:
continue
self._localized_values[v["language"]] = v["value"]
else:
self._value = values


class GSInstance(GSBase):
Expand Down Expand Up @@ -4749,6 +4756,30 @@ def copyright(self):
def copyright(self, value):
self.properties["copyrights"] = value

@property
def licenseURL(self):
return self.properties.get("licenseURL", "")

@licenseURL.setter
def licenseURL(self, value):
self.properties["licenseURL"] = value

@property
def description(self, value):
return self.properties.get("descriptions", "")

@description.setter
def description(self, value):
self.properties["descriptions"] = value

@property
def trademark(self, value):
return self.properties.get("trademarks", "")

@trademark.setter
def trademark(self, value):
self.properties["trademarks"] = value

@property
def designer(self):
return self.properties.get("designers", "")
Expand Down

0 comments on commit a5c4549

Please sign in to comment.