-
Notifications
You must be signed in to change notification settings - Fork 448
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
ttx: is creating empty XML files necessary? #972
Comments
Possibly even better: to raise an error if a table is requested that is not in the font. |
I agree with @justvanrossum, we should raise a |
Making ttx by default err on missing tables would be a change of behavior though. For example, if I'm doing:
I'd be really pissed if some of those ttx commands failed because the font (legitimately) didn't have GDEF. |
True.. I think we should keep the existing ttx behavior of passing on missing tables (with a message); but still a TTLibError could make more sense when one calls |
I suppose we can make saveXML "return" (not throw) an exception. Caller can raise it if they want. You definitely can't / shouldn't just raise exception when first missing table is encountered as that interrupts the normal flow of the code and we end up not saving the remaining tables. |
yeah, I like this idea of returning an exception object, containing the list of missing tables. If all the requested tables turn out to be missing, then ttx should not leave behind the empty file. |
I'm not so sure of that. These are, command-line tools after all. They are designed to be scripted together. How is a script to detect this? Or why? This sounds like convenience for user typing commands, but definitely not for scripts. I don't have a strong opinion here. And I'm NOT suggesting adding more commandline options for these tiny nuances... |
Perhaps just issue a warning for missing tables? |
I don't have a strong opinion either, as you can see from my swinging... 😅 |
Why does this command need to create a zero-kB file? |
Best to delete the output file upon error. |
I often (sometimes) run into the following scenario:
In total, three files are created, two of them empty. This is of course a result of user error – but I wonder if it would make sense to just not create a ttx file in scenarios 1 & 2?
The text was updated successfully, but these errors were encountered: