From: Paul B. <ba...@st...> - 2004-03-18 22:40:51
|
John Hunter wrote: > > How about this: > > What if all the family lists from font_manager are moved to > matplotlib.__init__.defaultParams and hence .matplotlibrc > > > font.family : sans-serif > font.style : normal > font.variant : normal > font.weight : normal > font.size : small > font.sans_serif : Lucida Grande, Verdana, Geneva, Lucida, Arial, Helvetica, Bitstream Vera Sans, sans-serif > font.monospace : Andale Mono, Bitstream Vera Sans Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace > and so on > > (we'll need a new converter func in matplotlib.__init__: comma_sep_strs) > > Users can then order them as they see fit. > > We *require* that font.family be one of serif, sans_serif, cursive, > fantasy, or monospace. (Is this overly restrictive?) Seems reasonable to me. > Thus users who want courier move courier up higher in font.monospace > in their rc file; ditto for vera. > > Does this work? I think I was a little slow to catch on because you > intended font family lists to be user configurable but the > configuration interface doesn't exist yet - it's essentially hardcoded > in font_manager (is this right, or am I still confused?) Yes, that's correct. You can modify the family lists via text.set_font_properties(), but that's probably not very easy for a user to do at this point. > As for deprecation, we can build a reverse dictionary mapping names to > one of the allowed font families. On calls to text.set_fontname, we > issue a deprecation warning and then set the appropriate font family > where possible. In due time, we remove fontname. I was thinking that we might want to use set_fontname() to find the font family and also add the specified font to the beginning of the list, so that it will all certainly be used. Otherwise, that font may be near the bottom of the list and not actually get used. -- Paul -- Paul Barrett, PhD Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Branch FAX: 410-338-4767 Baltimore, MD 21218 |