diff --git a/src/fontra/backends/copy.py b/src/fontra/backends/copy.py index 2fb66d57e..77fc8e5f1 100644 --- a/src/fontra/backends/copy.py +++ b/src/fontra/backends/copy.py @@ -14,7 +14,7 @@ async def copyFont( sourceBackend, destBackend, *, glyphNames=None, numTasks=1, progressInterval=0 ): await destBackend.putGlobalAxes(await sourceBackend.getGlobalAxes()) - await destBackend.putFontLib(await sourceBackend.getFontLib()) + await destBackend.putCustomData(await sourceBackend.getCustomData()) glyphMap = await sourceBackend.getGlyphMap() glyphNamesInFont = set(glyphMap) glyphNamesToCopy = sorted( diff --git a/src/fontra/backends/designspace.py b/src/fontra/backends/designspace.py index ea184fc78..ad5c56741 100644 --- a/src/fontra/backends/designspace.py +++ b/src/fontra/backends/designspace.py @@ -560,10 +560,10 @@ async def putGlobalAxes(self, axes): async def getUnitsPerEm(self): return self.defaultFontInfo.unitsPerEm - async def getFontLib(self): + async def getCustomData(self): return deepcopy(self.dsDoc.lib) - async def putFontLib(self, lib): + async def putCustomData(self, lib): self.dsDoc.lib = deepcopy(lib) self.dsDoc.write(self.dsDoc.path) diff --git a/src/fontra/backends/fontra.py b/src/fontra/backends/fontra.py index e5801f682..9fcff8ca5 100644 --- a/src/fontra/backends/fontra.py +++ b/src/fontra/backends/fontra.py @@ -95,10 +95,10 @@ async def putGlobalAxes(self, axes): self.fontData.axes = deepcopy(axes) self._scheduler.schedule(self._writeFontData) - async def getFontLib(self): + async def getCustomData(self): return deepcopy(self.fontData.customData) - async def putFontLib(self, customData): + async def putCustomData(self, customData): self.fontData.customData = deepcopy(customData) self._scheduler.schedule(self._writeFontData) diff --git a/src/fontra/backends/opentype.py b/src/fontra/backends/opentype.py index c67c19160..127a4a434 100644 --- a/src/fontra/backends/opentype.py +++ b/src/fontra/backends/opentype.py @@ -101,8 +101,8 @@ async def getGlobalAxes(self): async def getUnitsPerEm(self): return self.font["head"].unitsPerEm - async def getFontLib(self): - return [] + async def getCustomData(self): + return {} def tuplifyLocation(loc): diff --git a/src/fontra/client/core/font-controller.js b/src/fontra/client/core/font-controller.js index 294642fb5..ac8bd3a05 100644 --- a/src/fontra/client/core/font-controller.js +++ b/src/fontra/client/core/font-controller.js @@ -42,7 +42,7 @@ export class FontController { this._rootObject["glyphMap"] = getGlyphMapProxy(glyphMap, this.characterMap); this._rootObject["axes"] = await this.font.getGlobalAxes(); this._rootObject["unitsPerEm"] = await this.font.getUnitsPerEm(); - this._rootObject["lib"] = await this.font.getFontLib(); + this._rootObject["customData"] = await this.font.getCustomData(); this._rootClassDef = (await getClassSchema())["Font"]; this._resolveInitialized(); } @@ -71,8 +71,8 @@ export class FontController { return this._rootObject["unitsPerEm"]; } - get fontLib() { - return this._rootObject["lib"]; + get customData() { + return this._rootObject["customData"]; } getCachedGlyphNames() { diff --git a/src/fontra/core/fonthandler.py b/src/fontra/core/fonthandler.py index d05347828..00b2d7ab3 100644 --- a/src/fontra/core/fonthandler.py +++ b/src/fontra/core/fonthandler.py @@ -36,7 +36,7 @@ def remoteMethod(method): backendAttrMapping = [ ("axes", "GlobalAxes"), ("glyphMap", "GlyphMap"), - ("lib", "FontLib"), + ("customData", "CustomData"), ("unitsPerEm", "UnitsPerEm"), ] @@ -209,8 +209,8 @@ async def getUnitsPerEm(self, *, connection): return await self.getData("unitsPerEm") @remoteMethod - async def getFontLib(self, *, connection): - return await self.getData("lib") + async def getCustomData(self, *, connection): + return await self.getData("customData") def _getClientData(self, connection, key, default=None): return self.clientData[connection.clientUUID].get(key, default) diff --git a/src/fontra/views/editor/cjk-design-frame.js b/src/fontra/views/editor/cjk-design-frame.js index 5c088846d..e9e81f02c 100644 --- a/src/fontra/views/editor/cjk-design-frame.js +++ b/src/fontra/views/editor/cjk-design-frame.js @@ -66,7 +66,7 @@ export class CJKDesignFrame { this.cjkDesignFrameParameters = makeParametersFromGlyph(frameGlyph, unitsPerEm); } else { const legacyParameters = - this.sceneController.sceneModel.fontController.fontLib[ + this.sceneController.sceneModel.fontController.customData[ "CJKDesignFrameSettings" ]; if (legacyParameters) { diff --git a/src/fontra/views/editor/panel-designspace-navigation.js b/src/fontra/views/editor/panel-designspace-navigation.js index 3a3c14ae4..803a0b63c 100644 --- a/src/fontra/views/editor/panel-designspace-navigation.js +++ b/src/fontra/views/editor/panel-designspace-navigation.js @@ -277,7 +277,7 @@ export default class DesignspaceNavigationPanel extends Panel { ]; const statusFieldDefinitions = - this.sceneController.sceneModel.fontController.fontLib[ + this.sceneController.sceneModel.fontController.customData[ FONTRA_STATUS_DEFINITIONS_KEY ]; diff --git a/test-py/test_font.py b/test-py/test_font.py index 52fe04537..84c7d6c01 100644 --- a/test-py/test_font.py +++ b/test-py/test_font.py @@ -1022,9 +1022,9 @@ async def test_getGlobalAxes(testFontName, expectedGlobalAxes): @pytest.mark.asyncio @pytest.mark.parametrize("testFontName, expectedLibLen", getLibTestData) -async def test_getFontLib(testFontName, expectedLibLen): +async def test_getCustomData(testFontName, expectedLibLen): font = getTestFont(testFontName) - lib = await font.getFontLib() + lib = await font.getCustomData() assert expectedLibLen == len(lib)