intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/mathtext.cpython-312.pyc

80 lines
6 KiB
Text
Raw Normal View History

<EFBFBD>
<00>Rj<><00><00><><00>dZddlZddlZddlZddlmZmZddlmZddl m
Z
ddlm Z m Z m Z eje<0F>Zee _Gd<08>d <09>Zd dd
<EFBFBD>d <0B>Zy) a 
A module for parsing a subset of the TeX math syntax and rendering it to a
Matplotlib backend.
For a tutorial of its usage, see :ref:`mathtext`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _pyparsing: https://pypi.org/project/pyparsing/
The Bakoma distribution of the TeX Computer Modern fonts, and STIX
fonts are supported. There is experimental support for using
arbitrary fonts, but results may vary without proper tweaking and
metrics for those fonts.
<EFBFBD>N)<02>_api<70> _mathtext)<01> LoadFlags)<01>FontProperties<65>)<03> RasterParse<73> VectorParse<73>get_unicode_indexc<00><><00>eZdZdZej
ej ejejejejd<02>Z d<03>Z ddd<04>d<05>Z ejd<06>d<07><00>Zy) <09>MathTextParserN)<06>cm<63> dejavuserif<69>
dejavusans<EFBFBD>stix<69>stixsans<6E>customc<00>`<00>tjdddd<03>|j<00><00><04>|_y)a 
Create a MathTextParser for the given backend *output*.
Parameters
----------
output : {"path", "agg"}
Whether to return a `VectorParse` ("path") or a
`RasterParse` ("agg", or its synonym "macosx").
<20>vector<6F>raster)<03>path<74>agg<67>macosx)<01>outputN)r<00> check_getitem<65>lower<65> _output_type)<02>selfrs <20>V/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/mathtext.py<70>__init__zMathTextParser.__init__0s*<00><00>!<21>.<2E>.<2E><1D>h<EFBFBD>(<28> C<><19><<3C><<3C>><3E>#<23><04><19><00><01> antialiasedc<00><><00>|<03>|j<00>nd}tj|d<02>}ddlm}t
j |j<00>d<05>|j}|j|||||<06>S)a<>
Parse the given math expression *s* at the given *dpi*. If *prop* is
provided, it is a `.FontProperties` object specifying the "default"
font to use in the math expression, used for all non-math text.
The results are cached, so multiple calls to `parse`
with the same expression should be fast.
Depending on the *output* type, this returns either a `VectorParse` or
a `RasterParse`.
Nztext.antialiasedr)<01> backend_agg)rr)
<EFBFBD>copy<70>mpl<70>
_val_or_rc<EFBFBD>matplotlib.backendsr$r<00>
NO_HINTING<EFBFBD>get_hinting_flagr<00> _parse_cached)r<00>s<>dpi<70>propr"r$<00>load_glyph_flagss r<00>parsezMathTextParser.parse>ss<00><00>"#<23>.<2E>t<EFBFBD>y<EFBFBD>y<EFBFBD>{<7B>D<EFBFBD><04><19>n<EFBFBD>n<EFBFBD>[<5B>2D<32>E<> <0B>3<><1F>*<2A>*<2A>!<21>2<>2<>4<>
<EFBFBD> <0F>
<1B>
<1B><1D><18><14>!<21>!<21>!<21>S<EFBFBD>$<24> <0B>=M<>N<>Nr <00>2c<00><><00>|<03>
t<00>}tj|j|j <00><00><01>}|||<05>}|j <00>}|j <00>#tj<00>|j_|j j||||<02>} tj| <09>}
|jdk(r|
j<00>S|jdk(r|
j|<04><04>Sy)N)<01>fontsetrrr!)rrr<00>_font_type_mapping<6E>get_math_fontfamily<6C>get_size_in_points<74>_parserr<00>Parser<65> __class__r0<00>shipr<00> to_vector<6F> to_raster) rr,r-r.r"r/<00> fontset_classr3<00>fontsize<7A>boxrs rr+zMathTextParser._parse_cachedXs<><00><00> <0F><<3C>!<21>#<23>D<EFBFBD><1C>*<2A>*<2A> <10> #<23> #<23>T<EFBFBD>-E<>-E<>-G<>I<01> <0A><1F><04>&6<>7<><07><17>*<2A>*<2A>,<2C><08> <0F><<3C><<3C> <1F>%.<2E>%5<>%5<>%7<>D<EFBFBD>N<EFBFBD>N<EFBFBD> "<22><12>l<EFBFBD>l<EFBFBD> <20> <20><11>G<EFBFBD>X<EFBFBD>s<EFBFBD>;<3B><03><1A><1E><1E><03>$<24><06> <0F> <1C> <1C><08> (<28><19>#<23>#<23>%<25> %<25> <11> <1E> <1E>(<28> *<2A><19>#<23>#<23> <0B>#<23><<3C> <<3C>+r )<02>HN)<11>__name__<5F>
__module__<EFBFBD> __qualname__r7r<00> BakomaFonts<74>DejaVuSerifFonts<74>DejaVuSansFonts<74> StixFonts<74> StixSansFonts<74> UnicodeFontsr4rr0<00> functools<6C> lru_cacher+<00>r rr r %sy<00><00><12>G<EFBFBD> <20>,<2C>,<2C> <20>1<>1<> <20>0<>0<> <20>*<2A>*<2A> <20>.<2E>.<2E> <20>-<2D>-<2D> <06><16> #<23>O<01><14>O<01>4<19>Y<EFBFBD><18><18><12><1C>=<3D><1D>=r r )<01>colorc<00><><00>ddlm}td<03>}|j|d|<02><05>\}} }
} } |j |dz | dz f<02><07>} | j d|
| z |||<05><08>| j |||<04> <09>|
S)
a<EFBFBD>
Given a math expression, renders it in a closely-clipped bounding
box to an image file.
Parameters
----------
s : str
A math expression. The math portion must be enclosed in dollar signs.
filename_or_obj : str or path-like or file-like
Where to write the image data.
prop : `.FontProperties`, optional
The size and style of the text.
dpi : float, optional
The output dpi. If not set, the dpi is determined as for
`.Figure.savefig`.
format : str, optional
The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not set, the
format is determined as for `.Figure.savefig`.
color : str, optional
Foreground color, defaults to :rc:`text.color`.
r)<01>figurerr@)r-r.gR@)<01>figsize)<02>fontpropertiesrM)r-<00>format)<07>
matplotlibrOr r0<00>Figure<72>text<78>savefig) r,<00>filename_or_objr.r-rRrMrO<00>parser<65>width<74>height<68>depth<74>_<>figs r<00> math_to_imager^ls~<00><00>."<22> <1B>F<EFBFBD> #<23>F<EFBFBD>!'<27><1C><1C>a<EFBFBD>R<EFBFBD>d<EFBFBD><1C>!C<><1E>E<EFBFBD>6<EFBFBD>5<EFBFBD>!<21>Q<EFBFBD>
<10>-<2D>-<2D><15><14><1C>v<EFBFBD><04>}<7D> =<3D>-<2D>
><3E>C<EFBFBD><07>H<EFBFBD>H<EFBFBD>Q<EFBFBD><05>f<EFBFBD> <0C>a<EFBFBD><04>E<EFBFBD>H<EFBFBD>B<><07>K<EFBFBD>K<EFBFBD><0F>S<EFBFBD><16>K<EFBFBD>8<> <10>Lr )NNN)<14>__doc__rJ<00>loggingrSr&rr<00>matplotlib.ft2fontr<00>matplotlib.font_managerrrr r
<00> getLoggerrA<00>_logrBr r^rLr r<00><module>resa<00><01><04>"<11><0E><18>&<26>(<28>2<>1<>1<><19>w<EFBFBD><18><18><18>"<22><04> (<28><11><1C> D=<3D>D=<3D>N <11><1F> r