Skip to content

Commit

Permalink
Reset file pointer when saving to fileobject.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Oct 5, 2024
1 parent a90a7ab commit a536694
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fontbro/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ def _init_with_ttfont(
) -> None:
self._fileobject = BytesIO()
ttfont.save(self._fileobject)
self._fileobject.seek(0)
self._ttfont = TTFont(self._fileobject, **kwargs)
self._kwargs = kwargs

Expand Down Expand Up @@ -1796,6 +1797,7 @@ def save_to_fileobject(
if fileobject is None:
fileobject = BytesIO()
font.save(fileobject)
fileobject.seek(0)
return fileobject

def save_variable_instances(
Expand Down

0 comments on commit a536694

Please sign in to comment.