Skip to content

Commit

Permalink
Merge pull request #1008 from googlefonts/lib-custom-data
Browse files Browse the repository at this point in the history
rename font-level lib to customData
  • Loading branch information
justvanrossum authored Dec 2, 2023
2 parents 4525fe1 + 1fbe8f8 commit 007220a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/fontra/backends/fontra.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ async def putGlobalAxes(self, axes):
self._scheduler.schedule(self._writeFontData)

async def getFontLib(self):
return deepcopy(self.fontData.lib)
return deepcopy(self.fontData.customData)

async def putFontLib(self, lib):
self.fontData.lib = deepcopy(lib)
async def putFontLib(self, customData):
self.fontData.customData = deepcopy(customData)
self._scheduler.schedule(self._writeFontData)

def _readGlyphInfo(self):
Expand Down
4 changes: 4 additions & 0 deletions src/fontra/client/core/classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"type": "dict",
"subtype": "list"
},
"customData": {
"type": "dict",
"subtype": "Any"
},
"axes": {
"type": "list",
"subtype": "GlobalAxis"
Expand Down
2 changes: 1 addition & 1 deletion src/fontra/core/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Font:
unitsPerEm: int = 1000
glyphs: GlyphSet = field(default_factory=GlyphSet)
glyphMap: GlyphMap = field(default_factory=GlyphMap)
lib: dict = field(default_factory=dict)
customData: CustomData = field(default_factory=CustomData)
axes: list[Union[GlobalAxis, GlobalDiscreteAxis]] = field(default_factory=list)

def _trackAssignedAttributeNames(self):
Expand Down
2 changes: 1 addition & 1 deletion test-common/fonts/MutatorSans.fontra/font-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"unitsPerEm": 1000,
"lib": {},
"customData": {},
"axes": [
{
"name": "width",
Expand Down

0 comments on commit 007220a

Please sign in to comment.