Skip to content

Commit

Permalink
Fix putGlyph signature
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Dec 12, 2023
1 parent edd4909 commit b8f8457
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/fontra/backends/designspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ def _unpackLocalDesignSpace(self, dsDict, defaultLayerName):
)
return axes, sources

async def putGlyph(self, glyphName: str, glyph: VariableGlyph, unicodes: list[int]):
async def putGlyph(
self, glyphName: str, glyph: VariableGlyph, unicodes: list[int]
) -> None:
assert isinstance(unicodes, list)
assert all(isinstance(cp, int) for cp in unicodes)
self.glyphMap[glyphName] = unicodes
Expand Down
2 changes: 1 addition & 1 deletion src/fontra/backends/fontra.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def getGlyph(self, glyphName: str) -> VariableGlyph | None:

async def putGlyph(
self, glyphName: str, glyph: VariableGlyph, codePoints: list[int]
):
) -> None:
jsonSource = serializeGlyph(glyph, glyphName)
filePath = self.getGlyphFilePath(glyphName)
filePath.write_text(jsonSource, encoding="utf=8")
Expand Down
2 changes: 1 addition & 1 deletion src/fontra/core/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def getUnitsPerEm(self) -> int:
class WritableFontBackend(ReadableFontBackend, Protocol):
async def putGlyph(
self, glyphName: str, glyph: VariableGlyph, codePoints: list[int]
) -> VariableGlyph:
) -> None:
...

async def deleteGlyph(self, glyphName: str) -> None:
Expand Down

0 comments on commit b8f8457

Please sign in to comment.