texmanager doesn't handle list of names for `font.family` #2012

Merged
merged 3 commits into from May 15, 2013

Conversation

Projects
None yet
2 participants
Owner

mdboom commented May 15, 2013

No description provided.

@ghost ghost assigned mdboom May 15, 2013

Fixes a number of bugs introduced by cc61700. texmanager will now sti…
…ll pass when font.family is a list of strings (though there's no sane way for LaTeX to deal with that, but that's nothing new).
Owner

mdboom commented May 15, 2013

@Leejjon, @paalge, @pelson: I think this addresses a number of the problems brought on by cc61700. If you wouldn't mind confirming this addresses it, I'd like to fast track this since all text.usetex on master is currently broken.

Member

pelson commented May 15, 2013

Seems ok to me. My only critique is that it seems like the font system is being squeezed here to support something it wasn't originally designed for - is there an issue to raise this as a topic of a MEP for v1.4 (in my head I thought I'd seen one somewhere)?

lib/matplotlib/font_manager.py
elif family1 == family2:
- return 0.0
+ return 0.1 * float(i)
@pelson

pelson May 15, 2013

Member

This seems a bit magic to me, but I can live with it...

@mdboom

mdboom May 15, 2013

Owner

True. float(i) / float(len(families)) would be less magical. I'll change it to that.

lib/matplotlib/pyplot.py
@@ -278,11 +278,13 @@ def xkcd():
# This figure will be in regular style
fig2 = plt.figure()
"""
+ if rcParams['text.usetex']:
+ raise RuntimeError("xkcd mode is not compatible with text.usetex = True")
@pelson

pelson May 15, 2013

Member

Probably longer than 79 chars?

Owner

mdboom commented May 15, 2013

I agree that the font system could probably use some new polish.

The font system has supported selecting fonts by a list of family names for a very long time -- it's just that it's now be exposed to the rcParam level.

The real problem here, in my opinion, is that the same parameters are being overloaded for use by the built-in font system and the LaTeX font system and they (necessarily) have very different semantics on how they handle things. This should probably be split into 3 things (somehow) -- a common interface that "does the right thing" in both contexts, and then separate things for more detailed control of each text type. I've thought for a long time that what we need is the concept of pluggable text backends so we could have the built-in matplotlib one, LaTeX, Pango, Apple and other text rendering infrastructure selectable and individually configurable -- but, yes, that's definitely a MEP-level discussion.

mdboom added a commit that referenced this pull request May 15, 2013

Merge pull request #2012 from mdboom/texmanager-family-list
texmanager doesn't handle list of names for `font.family`

@mdboom mdboom merged commit b5c340a into matplotlib:master May 15, 2013

1 check failed

default The Travis CI build could not complete due to an error
Details

@mdboom mdboom deleted the mdboom:texmanager-family-list branch Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment