From: Perry G. <pe...@st...> - 2004-03-18 22:33:29
|
John Hunter writes: > 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?) > > Thus users who want courier move courier up higher in font.monospace > in their rc file; ditto for vera. > My 2 cents: I like requiring the choices to be restricted to those you've mentioned (or some differently named equivalent), but I don't know if I would force changing the configuration file as being the only way to change the search order. I like the restriction since it enforces a normally very portable approach that will prevent the user from being burned on platform dependencies. On the other hand, it would be nice to give them some means in their code of bypassing that. How about providing a different interface (perhaps a bit awkward to use to discourage its casual use) to allow selection of fonts by specific name. But the normal means of selecting fonts would only accept the standard supported family names. Is there any problem in taking this approach? The more specific approach should be something that is very clear that is not portable (grepping on a file for any such instances of the keyword or method, depending on how it is implemented, will show if any such nonportable uses exist. There may be times that someone wants to use a special font for a very specific location on the plot and they don't care if isn't available everywhere (at least, not for the deadline they need to get this plot ready for--they are willing to suffer later for their sin). But maybe I misunderstand the issue. Perry |