FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: Add a newline separator in fc-list call by jkseppan · Pull Request #7907 · matplotlib/matplotlib · GitHub

Repository navigation

BUG: Add a newline separator in fc-list call - #7907

Merged
tacaswell merged 2 commits into
matplotlib:masterfrom
jkseppan:fc-list-format
Jan 23, 2017
Merged

tacaswell merged 2 commits into
matplotlib:masterfrom
jkseppan:fc-list-format

Conversation

Copy link
Copy Markdown
Member

Fixes #7906.

QuLogic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This works for me.

jkseppan added this to the 2.0.1 (next bug fix release) milestone Jan 21, 2017

Copy link
Copy Markdown

Current coverage is 62.17% (diff: 100%)

Merging #7907 into master will decrease coverage by <.01%

@@             master      #7907   diff @@
==========================================
  Files           174        174          
  Lines         56121      56121          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          34896      34894     -2   
- Misses        21225      21227     +2   
  Partials          0          0          

Powered by Codecov. Last update 1be56c8...f111088

Copy link
Copy Markdown
Member

Does this mean our font finding is broken in 2.0?

anntzer commented Jan 22, 2017

Copy link
Copy Markdown
Contributor
  • Sorry for breaking this.
  • The test needs to be skipped on Windows.
  • We need to see why this did not break the Travis tests and wasn't more widely reported as this should a priori be a huge issue for any linux users.

Copy link
Copy Markdown
Member Author

It's not widely reported because of the setting USE_FONTCONFIG = False in font_manager.py so we don't really use fontconfig. In #7906 someone is using the functions directly.

anntzer commented Jan 22, 2017

Copy link
Copy Markdown
Contributor

What are (or would be) the reasons to use it or not to use it?

jkseppan commented Jan 22, 2017 via email

Copy link
Copy Markdown
Member Author

anntzer commented Jan 22, 2017

Copy link
Copy Markdown
Contributor
  • If fontconfig is not used by default, I don't understand why people were seeing the fc-list "slow" warning before.
  • In general, I'd say experimental code from 10 years ago should either be turned on by default (on Arch Linux, the ttf-dejavu package (providing the new default font, I guess?) depends on fontconfig, so at least here it's effectively not an extra dependency) or removed...

QuLogic commented Jan 22, 2017 •
edited
Loading

Copy link
Copy Markdown
Member

I think that USE_FONTCONFIG setting works the opposite way. Setting it to True will use fc-match to find fonts, whereas setting it False (or on Windows) will use FontManager and trigger the fc-list call modified herein. The default is False.

Has the Travis cache been working too well, and we've just been reloading the correct font list all this time?

If we need to trigger a cache rebuild, we should probably bump FontManager.__version__ at this point as well.

QuLogic commented Jan 22, 2017

Copy link
Copy Markdown
Member

OK, I think I have an idea; in findSystemFonts, we also do a recursive search through some default directories. The line right after that discards any non-existent files (meaning the fc-list result is discarded.)

So we're essentially looking for fonts twice, once via fc-list and once in some default directory. Apparently, no-one puts fonts elsewhere.

Copy link
Copy Markdown
Member

I agree with @QuLogic 's analysis of what is gonig on and why this still appears to work.

This should still be backported to 2.0.x (even if it is not as critical as it first appears).

tacaswell merged commit 0384b85 into matplotlib:master Jan 23, 2017
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 23, 2017
BUG: Add a newline separator in fc-list call

Conflicts:
	lib/matplotlib/tests/test_font_manager.py
	 - only backport the fix not the test as it uses a decorator
	that does not exist in 2.0.x

Copy link
Copy Markdown
Member

The backport is annoying because skipif is not defined on 2.0.x. I'll deal with this tomorrow.

anntzer commented Jan 23, 2017

Copy link
Copy Markdown
Contributor

@QuLogic Regardless of why this was not an issue, one of the builds of the matrix could start with a removal of ~/.config/matplotlib/fontList.* so that font-finding is tested at least once.

jkseppan commented Jan 23, 2017 via email

Copy link
Copy Markdown
Member Author

anntzer commented Jan 23, 2017

Copy link
Copy Markdown
Contributor

Indeed, my bad.

jkseppan commented Jan 23, 2017 via email

Copy link
Copy Markdown
Member Author

QuLogic commented Jan 30, 2017 •
edited
Loading

Copy link
Copy Markdown
Member

Backported to v2.0.x as fe1641b.

QuLogic pushed a commit that referenced this pull request Jan 30, 2017
BUG: Add a newline separator in fc-list call
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Feb 6, 2017
Due to matplotlib#7907, the font cache is outdated and should be re-created.
QuLogic mentioned this pull request Feb 6, 2017
jkseppan deleted the fc-list-format branch January 6, 2018 08:40
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL