Use a database object to manage fonts#714
Merged
Merged
Conversation
jwiggins
commented
Mar 12, 2021
| self.default_size = size if size is not None else 12.0 | ||
|
|
||
| paths = [] | ||
| self.default_family = "sans-serif" |
Member
Author
There was a problem hiding this comment.
This is basically equivalent to the previous value. Bitstream Vera and Helvetica are both sans-serif families. But since not every system may have them, we can use the generic family name for the default and get good results thanks to the preferred_fonts dictionary listing several options for sans-serif.
jwiggins
commented
Mar 12, 2021
jwiggins
commented
Mar 12, 2021
jwiggins
commented
Mar 12, 2021
jwiggins
commented
Mar 15, 2021
jwiggins
commented
Mar 15, 2021
rahulporuri
approved these changes
Mar 16, 2021
Member
Author
|
Thanks for the review |
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 will be useful to #711 (for avoiding duplicate additions).
Instead of using lists inside of
FontManagerto hold collections ofFontEntryobjects, this PR introduces aFontDatabaseclass which ensures all known entries are unique and provides a way to query entries by file path or font family in order to pare down the number of fonts that need to be scored byFontManager.findfont.