-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: print fontname in missing glyph warning #26989
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
Conversation
How does this interact with the fallback list? Presumable we would want to show all of the fonts that were considered? |
Currently fallback suppresses the missing font and if fallback doesn't work only prints the first font eta: I think b/c it's marked as a flag once and load_char_with_fallaback is kinda recursive. Lines 514 to 518 in 21ce592
|
a5d314f
to
c952d15
Compare
Which also means I can't think of a clean way to only print the warnings if the fallback fails w/o maintaining a separate stack of warnings & I think that rabbit hole is out of scope for this PR. |
22e8b01
to
e16b88d
Compare
Added a :filter-warning: to the plot directive so docs can build cleanly, but I'm really unsure that raising the warnings is all that helpful to someone using fallback-presumably they're using it b/c they expect that not all the fonts will work. |
c5648ce
to
b613bd7
Compare
When we exhaust the list of fallback fonts, do we have anyway to get back to the top of the list and walk it again collecting all of their names? |
Kinda maybe? if we exhaust the list, it means i==fallbacks.size() and if that works that's definitely a cleaner solution than the changes I've been making of passing around a cache object...but also currently pybind doesn't want to work for me so I can't build anything. Lines 672 to 680 in 6ba7d5f
|
d0908d8
to
dc2366a
Compare
So I was wrong in that it'll miss the first glyph when there's an override. |
dc2366a
to
4aaf163
Compare
Got this to work by adding an array to F2tFont to store the names of the fonts. Reason is because if you can't find anything, you need to print |
4aaf163
to
8ca754a
Compare
c66bfd9
to
f9274f3
Compare
df5d2ae
to
c719d89
Compare
16a3fb9
to
09584ff
Compare
b3dd35d
to
1ff3b42
Compare
0a39542
to
296977b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be done without adding any new state to the objects.
296977b
to
eee55ab
Compare
changed to parameter into function |
eee55ab
to
249f4be
Compare
one warning w/ all the fonts instead of n warnings w/ one font per @tacaswell's request - and I'm 99% sure that the set can be passed from c++ to python directly but since this is for a string I figure there's no harm in doing the strcat on the C++ side since passing the set over would I think involve copying the set to the python set object. I figure this can get cleaned up as part of the pybind port if it's important enough. |
22c8c97
to
6470890
Compare
lists all fallback fonts if glyph missing in all fonts removed ft_get_char_index_or_warn added a test for otf fonts on pdf + some windows fonts to tests Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
6470890
to
4ece8ab
Compare
It was not a request, I only asked (in a private channel) why many instead of one! |
Thank you @story645 ! |
PR summary
Modified the "missing glyph" warning to also print out the name of the font the glyph is missing from. This is mostly to help me debug why #26854 is failing on CI but working locally but there have been times where I've gotten this error and would have found it helpful to have the added context.
second commit adds a :filter-warning: option to thespun out into #27076..plot
directivePR checklist