-
Notifications
You must be signed in to change notification settings - Fork 51
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
unify loading of glyphs source into GSFont object #327
Comments
I don’t like the And how it is done in Defcon and ufoLib? No loads functions there as far as I see. |
I don't know much about the Python conventions, so I don't know how "pythonic" and "expected" it is to provide the |
let's deprecate them, and consistently use only one in our codebase. currently load_to_ufos is using the load function. |
I find it a good idea not to force filesystem io use unnecessarily; if
loading from a string is possible then it should be kept supported.
Duplicated code paths can be fixed by making one of the methods call the
other.
… |
GSFont can have a fromstring class method constructor to load from a string |
Or add a keyword argument to the constructor.
|
we currently have two alternative ways:
glyphsLib.load
(for a file or path,loads
for a string) functionThe two methods supposedly produce the same kind of object, however they seem to be calling different methods of
glyphsLib.parser.Parser
.this is in
GSFont.__init__
:https://github.com/googlei18n/glyphsLib/blob/0a86327a93b3f324f200e35a23f639db4ae58280/Lib/glyphsLib/classes.py#L3010-L3013
this is
loads
function:https://github.com/googlei18n/glyphsLib/blob/0a86327a93b3f324f200e35a23f639db4ae58280/Lib/glyphsLib/parser.py#L255-L263
The text was updated successfully, but these errors were encountered: