Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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 2 commits into from
Jan 23, 2017

Conversation

jkseppan
Copy link
Member

Fixes #7906.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

This works for me.

@jkseppan jkseppan added this to the 2.0.1 (next bug fix release) milestone Jan 21, 2017
@codecov-io
Copy link

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

@tacaswell
Copy link
Member

Does this mean our font finding is broken in 2.0?

@anntzer
Copy link
Contributor

anntzer commented Jan 22, 2017

  • 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.

@jkseppan
Copy link
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
Copy link
Contributor

anntzer commented Jan 22, 2017

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

@jkseppan
Copy link
Member Author

jkseppan commented Jan 22, 2017 via email

@anntzer
Copy link
Contributor

anntzer commented Jan 22, 2017

  • 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
Copy link
Member

QuLogic commented Jan 22, 2017

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
Copy link
Member

QuLogic commented Jan 22, 2017

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.

@tacaswell
Copy link
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 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
@tacaswell
Copy link
Member

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

@anntzer
Copy link
Contributor

anntzer commented Jan 23, 2017

@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
Copy link
Member Author

jkseppan commented Jan 23, 2017 via email

@anntzer
Copy link
Contributor

anntzer commented Jan 23, 2017

Indeed, my bad.

@jkseppan
Copy link
Member Author

jkseppan commented Jan 23, 2017 via email

@QuLogic
Copy link
Member

QuLogic commented Jan 30, 2017

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 QuLogic mentioned this pull request Feb 6, 2017
@jkseppan jkseppan deleted the fc-list-format branch January 6, 2018 08:40
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