You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to suppress FontForge's warnings and errors that can be caused e.g. by c.isClockwise().
They cannot currently be redirected (e.g. by setting Python's sys.stderr) or suppressed (e.g. by Python's warnings.filterwarnings) as they are not generated by the Python/C API.
When using FontForge to perform automated operations on a large number of fonts/glyphs, these warnings can easily mess up the terminal. It would be nice to be able to suppress warnings and errors in certain scenarios.
Versions
FontForge 20230101 and Ubuntu 22.04
Steps to reproduce
Run the following Python script to raise a warning:
I have implemented a preference that causes NOUI__LogError and _LogError to return without writing to stderr. I would like to get some feedback on whether a preference is the way to go. Also, I don't understand the following prefs_list aspects:
What is the difference between core_list and extras in noprefs.c? How do I decide where to put this new preference?
How do I choose the value of the mn (= mnemonic?) field of pref_list?
If a new preference is the preferred approach and I understand the currently unclear aspects of prefs_list, I can open a PR to discuss the details.
The text was updated successfully, but these errors were encountered:
There is a static variable running_script which could be used to modify the behavior of *_LogError functions only when Python is running. The problem is that it marks both Python and native scripts. Try to see if there is a way to differentiate these two cases.
I think, preferences are difficult to discover, so if there is a way to do stuff without them, that would be better
I'm trying to suppress FontForge's warnings and errors that can be caused e.g. by
c.isClockwise()
.They cannot currently be redirected (e.g. by setting Python's
sys.stderr
) or suppressed (e.g. by Python'swarnings.filterwarnings
) as they are not generated by the Python/C API.When using FontForge to perform automated operations on a large number of fonts/glyphs, these warnings can easily mess up the terminal. It would be nice to be able to suppress warnings and errors in certain scenarios.
Versions
FontForge 20230101 and Ubuntu 22.04
Steps to reproduce
Run the following Python script to raise a warning:
Possible solution
I have implemented a preference that causes
NOUI__LogError
and_LogError
to return without writing tostderr
. I would like to get some feedback on whether a preference is the way to go. Also, I don't understand the followingprefs_list
aspects:core_list
andextras
innoprefs.c
? How do I decide where to put this new preference?mn
(= mnemonic?) field ofpref_list
?If a new preference is the preferred approach and I understand the currently unclear aspects of
prefs_list
, I can open a PR to discuss the details.The text was updated successfully, but these errors were encountered: