-
Notifications
You must be signed in to change notification settings - Fork 44
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
FIX: Make font style- and stretch- check case insensitive #405
Conversation
This makes style and stretch case insensitive in `kiva.fonttools.font_manager.ttfFontProperty`. The case sensitivity led to font styles not being properly detected on (at least) macOS. The checks on filename were already case insensitive. Fixes: #404
It looks like I can edit the font with the free and open source FontForge app. |
This adds a test and a test file for correctly identifying fonts who's style contains capital letters. The "TestTTF Italic" font was edited in FontForge [1] to have the style "Italic". [1]: https://fontforge.org/
The test failures are unrelated to the change.
|
Rebuilding CI now that #424 is merged... 🤞 |
(Merged master in to get the latest CI changes) |
Codecov Report
@@ Coverage Diff @@
## master #405 +/- ##
==========================================
+ Coverage 28.96% 30.51% +1.54%
==========================================
Files 206 206
Lines 18245 17853 -392
Branches 2466 2461 -5
==========================================
+ Hits 5284 5447 +163
+ Misses 12634 12068 -566
- Partials 327 338 +11
Continue to review full report at Codecov.
|
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.
LGTM
Thanks for the fix @kitchoi, sorry for not being responsive on this one. I had forgotten about this PR. 😞 |
@achabotl No worries, thank you for the fix! |
This makes style and stretch case insensitive in
kiva.fonttools.font_manager.ttfFontProperty
. The case sensitivity ledto font styles not being properly detected on (at least) macOS.
The checks on filename were already case insensitive.
I'm not sure how to test this. There's a test in
fonttools
, but it would required modifying the test.ttf
file and I didn't know how to fix it. Help would be appreciated.enable/kiva/fonttools/tests/test_font_manager.py
Line 53 in 6cf525c
Here's a small test sample and an example that it works
Fixes: #404
Also addresses part of #391.