-
Notifications
You must be signed in to change notification settings - Fork 45
Fix SCRIPT font family in Kiva
#975
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
There are items in
font_family_aliaseswhich are not keys inpreferred_fonts. Perhaps you should only check againstpreferred_fonts?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.
We want to check it is in both, because of this line here:
enable/kiva/fonttools/_score.py
Line 38 in 4d51db2
If it is not on
font_family_aliasesthenpreferred_fontswill never be accessed.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'm saying that
query_family in font_family_aliasescan beTrueat the same time thatquery_family in preferred_fontsisFalse.The more complete snippet from
score_family...enable/kiva/fonttools/_score.py
Lines 38 to 40 in 4d51db2
... is not really being tested here because converting from the integer Kiva family constants via
Font.familymapwill never result in the values"sans","sans serif", or"modern".Is the point of this test to keep
Font.familymapvalues in sync withfont_family_aliasesandpreferred_fonts?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.
The entries in
familymapneed to be in both, yes (and that's what I care about for this PR).font_family_aliases(and presumablypreferred_fonts) can have extra values which come from theface_name(this is what derailed #977). Eg. if someone names a font "sans" (ie.Font("sans", 12)) it will also go through the above codepath. That likely needs some re-engineering at some point, but it is outside the scope of this PR)