Skip to content
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

Ignore X11 fonts on macOS #305

Merged
merged 3 commits into from
Jun 17, 2018
Merged

Ignore X11 fonts on macOS #305

merged 3 commits into from
Jun 17, 2018

Conversation

rkern
Copy link
Member

@rkern rkern commented Jun 15, 2018

Fixes #151

Most installations of X11 on macOS include a Vera.ttf font that is incapable of displaying common Unicode characters.

Also, interpret the font family modern as sans-serif. We use Font('modern') in a number of tests to get a "default font". If we go through KivaFontTrait('modern'), that will parse down to Font(''), which picks up sans-serif anyways. This makes both codepaths consistent. Otherwise, Font('modern') tries to find a typeface actually named "modern" when it's intended as a general family, like sans-serif. This causes warnings in these tests as it falls back to the arbitrary default font instead of looking for a proper sans-serif font.

X11 installations on macOS routinely include a `Vera.ttf` font that does not support Unicode.

Fixes #151
Otherwise `Font('modern')` will be interpreted as trying to find a typeface actually named "modern". This construction mostly occurs in tests, not real code, which tends to go through the `KivaFontTrait()` which parses `'modern'` to refer to the sans-serif family in any case.
@codecov-io
Copy link

codecov-io commented Jun 15, 2018

Codecov Report

Merging #305 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #305      +/-   ##
==========================================
+ Coverage   33.65%   33.66%   +<.01%     
==========================================
  Files         206      206              
  Lines       18298    18299       +1     
  Branches     2411     2411              
==========================================
+ Hits         6159     6161       +2     
  Misses      11747    11747              
+ Partials      392      391       -1
Impacted Files Coverage Δ
kiva/fonttools/font_manager.py 55.45% <66.66%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3323236...df37290. Read the comment docs.

@rkern rkern requested a review from jwiggins June 16, 2018 01:02
Copy link
Member

@jwiggins jwiggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the fix

@rkern rkern merged commit 7537e69 into master Jun 17, 2018
@rkern rkern deleted the fix/macos-x11-fonts branch June 17, 2018 20:23
jwiggins pushed a commit that referenced this pull request Jul 12, 2018
@jwiggins jwiggins mentioned this pull request Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants