FIX: Make font style- and stretch- check case insensitive#405
Merged
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
Contributor
Author
|
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/
Contributor
Author
|
The test failures are unrelated to the change.
|
Contributor
|
Rebuilding CI now that #424 is merged... 🤞 |
Contributor
|
(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.
|
jwiggins
reviewed
Dec 2, 2020
jwiggins
reviewed
Dec 2, 2020
Contributor
Author
|
Thanks for the fix @kitchoi, sorry for not being responsive on this one. I had forgotten about this PR. 😞 |
Contributor
|
@achabotl No worries, thank you for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ttffile 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.