generating fontconfig strings from mpl FontProperties is broken#4910
generating fontconfig strings from mpl FontProperties is broken#4910jrevans wants to merge 2 commits intomatplotlib:masterfrom
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.
There was a problem hiding this comment.
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:notifications@github.com] @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.