Text antialiasing for mathtext#26094
Conversation
|
I don't see a problem with default (None) meaning "still use the 'text.antialiased' rcParam", as it stands the default will I think disable it regardless of the rcParam, which is a change in behavior. (And it may just fail handing None to a C function that expects a bool...) The change to |
Thanks for the very insightful suggestions! Thinking from whether the behavior will change is really helpful. I will make None resolve rcparams based on the suggestions. |
1f6d78f to
4dbba98
Compare
PR summary
Accidentally closed by force pushing, the new PR for review is #26376 and this old thread has all the history information
As mentioned in the previous PR, antialiasing will use
rcParams["text.antialiased"]and the parameterantialiasedfortext()will have no effect.Currently I'm solving this by passing the antialiasing state through
MathTextParser. Want to know about your ideas about this.From my perspective,
pros:
cons:
mathtext.py, theantialiasedparameter inparse(self, s, dpi=72, prop=None, antialiased=None)should never beNoneand should be set toTrueorFalseby the caller. I make it a default argument because doing so will keep the existing code working - and it's less likely to make users confused because this is an internal API.Side Note: I have completed only AGG backend. For Cairo backends, I didn't see an elegant way to do this - the mathtext is parsed through
RendererCairo._text2path.mathtext_parser.parse(), andmathtext_parseris initialized as a vector(path) parser (because it's an attribute of_text2path) , which don't have the option to render with or without antialiasing. I'm not quite sure about Cairo backend should be used for rasterization, vector, either of them, or both, so want to know your ideas about whether we need to support math text antialiasing for Cairo.PR checklist