Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 parameterantialiased
fortext()
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
, theantialiased
parameter inparse(self, s, dpi=72, prop=None, antialiased=None)
should never beNone
and should be set toTrue
orFalse
by 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_parser
is 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