Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSFont: save() issues #77

Open
5 tasks
Mark2Mark opened this issue Aug 23, 2022 · 1 comment
Open
5 tasks

GSFont: save() issues #77

Mark2Mark opened this issue Aug 23, 2022 · 1 comment

Comments

@Mark2Mark
Copy link
Contributor

Mark2Mark commented Aug 23, 2022

  • When executing font.save() on a font that is loaded with GSFont({PATH}) (not in the UI), it fails with the error:
  File "GlyphsApp/GlyphsApp/__init__.py", line 4174, in Font__save__
ValueError: No path set

While when executing font.save() on a font that is open in the UI, it works as expected.


The Documentation says:

If no path is given, it saves to the existing location.

Parameters:
path (str) – Optional file path

formatVersion (int) – the format of the file

makeCopy (bool) – saves a new file without changeing the documents file paths

  • When setting makeCopy=True, it then also expects a filePath. The "optional" filePath claim seems misleading then.
  • When setting makeCopy to True AND providing a filePath, there is no error, but there’s also no copy created. (Font.save(path="/Users/.../Desktop/New Font.glyphs", makeCopy=True))
  • Specifying the formatVersion (e.g. formatVersion=2 from a file that is version 3) does nothing, it should probably raise an error as it is likely to be not compatible. However, the other way around also does nothing: Font.save(formatVersion=3) where the opened file is set to version 2.
  • Wording proposal for above-mentioned docu: "path (str) – Optional file path including filename and suffix."
@schriftgestalt
Copy link
Owner

When a font is loaded directly (GSFont({PATH})) it doesn't have a document and thous can’t store a file path. So .save() always needs a path argument.

when makeCopy is set, it always requires a file paths as that is the purpose of that flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants