From a5c4549e48be9099c00c222a2f99939016d0b7ae Mon Sep 17 00:00:00 2001 From: Bram Stein Date: Tue, 9 Apr 2024 22:29:19 +0200 Subject: [PATCH] Add support for localized GSFontInfoValue. --- Lib/glyphsLib/classes.py | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Lib/glyphsLib/classes.py b/Lib/glyphsLib/classes.py index 5232bd8c8..8722f9ae6 100755 --- a/Lib/glyphsLib/classes.py +++ b/Lib/glyphsLib/classes.py @@ -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): @@ -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", "")