-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
generating fontconfig strings from mpl FontProperties is broken #4910
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
Conversation
documentation). This added a leading ':' character when there shouldn't have been one. the 'family' parameter was being improperly escaped. This was adding 'family=' for the 'family' parameter when it shouldn't be there. The result was that FontConfig would generate a pattern, but couldn't correctly read it back in. This has now been fixed.
# Handle 'family' first and escape it properly | ||
family = d.get_family() | ||
if family: | ||
if type(family) == list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be isinstance(family, list)
?
Can you add a test for this? |
Added a test case.
You need to add test test files to the whitelist in These tests do not pass for me on either python 2 or 3 14:39 $ python tests.py -s --processes=8 --process-timeout=300 matplotlib.tests.test_fontconfig
FE
======================================================================
ERROR: matplotlib.tests.test_fontconfig.do_test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tcaswell/.virtualenvs/mpl_2k/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/case.py", line 197, in runTest
self.test(*self.arg)
TypeError: do_test() takes exactly 2 arguments (0 given)
======================================================================
FAIL: matplotlib.tests.test_fontconfig.test_fontconfig
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tcaswell/.virtualenvs/mpl_2k/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/tcaswell/source/my_source/matplotlib/lib/matplotlib/tests/test_fontconfig.py", line 40, in test_fontconfig
do_test(f1, s1)
File "/home/tcaswell/source/my_source/matplotlib/lib/matplotlib/tests/test_fontconfig.py", line 28, in do_test
assert_equal(fc, expected)
AssertionError: u'Bitstream Vera Sans:style=normal:variant=normal:weight=400:stretch=normal:size [truncated]... != u"u'sans\\-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=1 [truncated]...
- Bitstream Vera Sans:style=normal:variant=normal:weight=400:stretch=normal:size=12.0
? ^^^ ------------ ^^^
+ u'sans\-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0'
? ^^ +++++++ ^^^^^^ +
----------------------------------------------------------------------
Ran 2 tests in 0.383s
FAILED (errors=1, failures=1) |
ping @jrevans Any update on this? |
@jrevans Any updates on this? |
I apologize for the delayed response. Things have been really busy at the day job. I expect to have some time in the upcoming week to get back to some of the remaining open issues/questions. --James Evans From: Thomas A Caswell [mailto:[email protected]] @jrevans https://github.com/jrevans Any updates on this? — |
I feel you on crazy day-job issues. I am hoping to get an rc2 out tonight, maybe do an rc3 next weekend? |
@jrevans If you get this done it can go in, but we are not going to block on it. |
Given the amount of recent fontconfig work I'm going to guess this is now obsolete. Feel free to re-open if I'm mistaken! Thanks! |
Superseded by #15601. |
This was making invalid fontconfig strings (as per the fontconfig documentation). This added a leading ':' character when there shouldn't have been one. the 'family' parameter was being improperly escaped. This was adding 'family=' for the 'family' parameter when it shouldn't be there. The result was
that FontConfig would generate a pattern, but couldn't correctly read it back in. This has now been fixed.
This addresses an issue in #4897.