Description
Describe the issue
Summary
The ps.useafm
rcParam can be used to force the postscript backend to only use "standard" postscript fonts (a hard-coded list of fonts listed in the postscript specification, which are guaranteed to be shipped with any compliant postscript interpreter, and therefore don't need to be embedded in the ps file; this makes the resulting ps file a bit smaller). A similar setting exists for the pdf backend, namely pdf.use14corefonts
.
When using mathtext, the pdf backend does not respect pdf.use14corefonts
, i.e. any math text uses the normal fonts for math, which get embedded using the normal mechanism in the pdf file. On the other hand, the ps backend does respect ps.useafm
, and still tries to use standard ps fonts for mathtext. It does so using some custom glyph mappings (mathtext.latex_to_standard
) and a fair bit of custom code (the 159-line StandardPsFonts class); however, it turns out that the mappings are in large part very wrong. For example,
rcParams["ps.useafm"] = True; figtext(.5, .5, r"$\Gamma\grave a$"); savefig("/tmp/test.ps")
Although the tables are fixable, the fact that no one has apparently ever noticed this (especially on capital greek letters, which are not that obscure) suggests to me that the feature is essentially unused (my guess is that ps.useafm
is already very rarely used in itself...). So I think it is reasonable to at least give up on forcing the use of standard fonts for ps+mathtext output; i.e., just like the pdf backend currently does.
Proposed fix
Allow the use of fonts other than the postscript standard fonts for ps+mathtext, even when ps.useafm
is True.
attn @jkseppan, who may be one of the few people interested in this?