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

merged 3 commits into from May 15, 2013

2 participants

Matplotlib Developers member

No description provided.

@mdboom mdboom was assigned May 15, 2013
@mdboom mdboom 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).
Matplotlib Developers member

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

Matplotlib Developers member

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)?

@pelson pelson and 1 other commented on an outdated diff May 15, 2013
elif family1 == family2:
- return 0.0
+ return 0.1 * float(i)
pelson May 15, 2013 Matplotlib Developers member

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

mdboom May 15, 2013 Matplotlib Developers member

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

@pelson pelson commented on an outdated diff May 15, 2013
@@ -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 May 15, 2013 Matplotlib Developers member

Probably longer than 79 chars?

Matplotlib Developers member

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 mdboom merged commit b5c340a into matplotlib:master May 15, 2013

1 check failed

Details default The Travis CI build could not complete due to an error
@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