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

font_styles test failing for some people #788

Closed
mdboom opened this issue Mar 22, 2012 · 8 comments
Closed

font_styles test failing for some people #788

mdboom opened this issue Mar 22, 2012 · 8 comments

Comments

@mdboom
Copy link
Member

mdboom commented Mar 22, 2012

Originally reported in issue #779 by @astrofrog.

I've tested this branch on MacOS 10.7 with freetype 2.4.9 (14.1.8), and all tests pass except three (the font_styles ones):

======================================================================
FAIL: matplotlib.tests.test_text.test_font_styles.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 35, in failer
    result = f(*args, **kwargs)
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 126, in do_test
    '(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/Shared/Jenkins/Home/jobs/matplotlib-mdboom-tests-osx-10.7-multiconfig/workspace/NV/1.6.1/PV/2.7/result_images/test_text/font_styles.png vs. /Users/Shared/Jenkins/Home/jobs/matplotlib-mdboom-tests-osx-10.7-multiconfig/workspace/NV/1.6.1/PV/2.7/result_images/test_text/expected-font_styles.png (RMS 47.138)

======================================================================
FAIL: matplotlib.tests.test_text.test_font_styles.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 35, in failer
    result = f(*args, **kwargs)
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 126, in do_test
    '(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/Shared/Jenkins/Home/jobs/matplotlib-mdboom-tests-osx-10.7-multiconfig/workspace/NV/1.6.1/PV/2.7/result_images/test_text/font_styles_pdf.png vs. /Users/Shared/Jenkins/Home/jobs/matplotlib-mdboom-tests-osx-10.7-multiconfig/workspace/NV/1.6.1/PV/2.7/result_images/test_text/expected-font_styles_pdf.png (RMS 23.409)

======================================================================
FAIL: matplotlib.tests.test_text.test_font_styles.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 35, in failer
    result = f(*args, **kwargs)
  File "/Users/Shared/Jenkins/Home/virtualenvs.nose.pil/python2.7-numpy1.6.1/lib/python2.7/site-packages/matplotlib/testing/decorators.py", line 126, in do_test
    '(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: /Users/Shared/Jenkins/Home/jobs/matplotlib-mdboom-tests-osx-10.7-multiconfig/workspace/NV/1.6.1/PV/2.7/result_images/test_text/font_styles_svg.png vs. /Users/Shared/Jenkins/Home/jobs/matplotlib-mdboom-tests-osx-10.7-multiconfig/workspace/NV/1.6.1/PV/2.7/result_images/test_text/expected-font_styles_svg.png (RMS 39.686)

The images are here: http://db.tt/7jOnhnwN

It looks as though somehow the font styles don't work on my system when anti-aliasing is disabled?

@mdboom
Copy link
Member Author

mdboom commented Mar 22, 2012

Does deleting your font cache (~/.matplotlib/fontList.cache) help?

@mdboom
Copy link
Member Author

mdboom commented Mar 22, 2012

Can you post your ~/.matplotlib/fontList.cache file? I suspect it isn't indexing the fonts correctly.

@astrofrog
Copy link
Contributor

I tried removing it but the errors were still there.

The re-generated file is here: http://db.tt/hPWBtpu0

@mdboom
Copy link
Member Author

mdboom commented Mar 22, 2012

Can you run this gist: https://gist.github.com/2159040

Run with debugging messages on and post the console output (also check test.png to see if it looks styled).

python font_styles.py --verbose-debug-annoying

@astrofrog
Copy link
Contributor

Here is the log: http://pastebin.com/KbSyQ3ym

The text is not styled.

@mdboom
Copy link
Member Author

mdboom commented Mar 22, 2012

Just to confirm, since I see it in the logs: Have you been removing (and sending me) /Users/Shared/Jenkins/Home/.matplotlib/fontList.cache (since this is running in the Jenkins context) and not ~/.matplotlib/fontList.cache?

Still stumped as to what's going on. The fontList.cache you sent me works perfectly here (after updating the paths).

@astrofrog
Copy link
Contributor

I did send the Jenkins one - but I think the one I had sent before was generated by Jenkins, so I removed it and then ran your script, which re-generated the file, and now the styles look fine. So somehow, in the restricted Jenkins environment, the font cache file that is generated has issues... I'm now going to run the Jenkins tests again with the fontList.cache file that was generated when I ran your script to see what happens. Anyway, it seems that this is an issue related to running in Jenkins rather than a real matplotlib bug. I'll report back.

@astrofrog
Copy link
Contributor

Ok, this was indeed some strange artifact of running the tests on Jenkins. If I run the tests sequentially for different Python/Numpy versions, and remove fontList.cache between each run, then things work fine. The issue must be to do with the cache pointing to the fonts in the wrong matplotlib path (i.e. if the 2.7 & 1.6.1 tests run first, then the cache will contain fonts in the 2.7 & 1.6.1 path, which might confuse the other Python versions). Anyway, I don't think this is really a matplotlib bug, so this issue can be closed.

@mdboom mdboom closed this as completed Sep 3, 2013
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

No branches or pull requests

2 participants