%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/reportlab/graphics/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/reportlab/graphics/__pycache__/utils.cpython-312.pyc

�

��e3����dZddlmZmZddlmZmZmZddlm	Z	m
Z
mZmZddl
mZGd�de�Zd	�Zd
�Zd�Zdd
�Ze�j-e��dde	dddddfd�Zy))�setFont�pathNumTrunc�processGlyph�text2PathDescription�	text2Path�
RenderPMError�)�getFont�
unicode2T1)�
open_and_read�isBytes�rl_exec�)�_baseGFontName�_PATH_OP_ARG_COUNT�_PATH_OP_NAMES�
definePath)�exc_infoc��eZdZy)rN)�__name__�
__module__�__qualname__���:/usr/lib/python3/dist-packages/reportlab/graphics/utils.pyrrs��rrc��tttt�dd��\}}ddlm}|jdk\r�ddl}|jj|jj|j�d�}td|�d|j|����dD]&}td|�d	tt||������(d
t|��dt|��d|�d|�d
�	}|dz
}t!|t#t$���y)N�r)�	rl_config�fontsz!!!!! z: )�T1SearchPath�
TTFSearchPathz!!!!! rl_config.z = z&raise RenderPMError("Error in setFont(�,z$) missing the T1 files?\nOriginally z")z
 from None)r)�list�map�strr�	reportlabr�verbose�os�path�join�dirname�__file__�print�listdir�repr�getattrr
�dictr)�fontName�fontSize�s1�s2rr'�_�codes        r�
_errorDumpr7s���
�#�c�(�*�R�a�.�)�
*�F�B��#����!����G�G�L�L�������);�);�<�W�E��
��"�*�*�Q�-�0�1�1�	N�A��q��g�i��6J�1K�L�M�	N��im�nv�iw�x|�~F�yG�HJ�KM�N�D��L��D��D��M�2�3rc��	|j||�y#t$r�}|jdjd�st	||�ddlm}	t|�}|||jj�|jjt�n#t	||�YnxYw|j||�Yd}~yd}~wwxYw)NrzCan't find font!)�
makeT1Font)
r�
ValueError�args�endswithr7�_rl_renderPMr9r	�face�
findT1File�encoding�vectorr)�gsr1r2�er9�fs      rrrs���&�
�
�
�8�H�%���
&��v�v�a�y�!�!�"4�5��x��)�+�	*���!�A��x���� 1� 1� 3�A�J�J�4E�4E�m�T��	*��x��)��
�
�
�8�H�%�%��
&�s-��	C�0C�AB�C�B&�$C�Cc�L�t|�|k(rt|�St|d�S)N�)�int�round)�ns rrr-s!��
�1�v�q�y��Q��-���1�:�rNc	������	�
��ddlm}m}���}|dk(r
|dk7rdnd�n||vr|�ntd|�d����ft	�fd	�|D��z��D]r��dk(r7	ddl�	ddl�
G�	�
fd
�d��ddtdd
dddf�fd�	}t|���cS�dk(s�E	ddl
}dd��ddtdd
dddf�fd�	}t|�t��cS�fd�}t||||��S#t$rY��wxYw#t$rY��wxYw)Nr)�	textPaths�renderPMBackend�backend�	rlPyCairo�freetype�	_renderPMz
textPaths=z7 should be one of 'backend', 'freetype' or '_renderPM')c3�.�K�|]}|�k7s�	|���y�w�Nr)�.0r5�tps  �r�	<genexpr>z(__makeTextPathsCode__.<locals>.<genexpr>;s�����0�a�!�R�%��0�s�
�c���eZdZW�jW�jzW�j
zZd�Z��fd�Zdde	dfd�Z
y)�)__makeTextPathsCode__.<locals>.FTTextPathc��i|_yrR)�faces)�selfs r�__init__z2__makeTextPathsCode__.<locals>.FTTextPath.__init__Es	��!#�D�Jrc����||jvr�t|�}|std|�d���|jr(|jj
}�j
|�}nWt|jdd�}|s|jj�}|s"td�}t|jdd�}�j|�}||f|j|<|j|S)Nzfont z has not been registered�pfbFileNamez
C059-Roman)
rYr	r:�_dynamicFontr>�	_ttf_data�BytesIOr/r?�Face)rZr1�font�path_or_streamr>rO�ios     ��rrz1__makeTextPathsCode__.<locals>.FTTextPath.setFontHs�����t�z�z�1�&�x�0��#�",�u�X�L�@X�-Y�"Z�Z��,�,�-1�Y�Y�-@�-@�N�.0�Z�Z��-G�N�-4�T�Y�Y�}�T�-R�N�#1�15���1E�1E�1G��#1�(/�|�'<��18����=�QU�1V��'�}�}�^�<��04�T�{��
�
�8�,��:�:�h�/�/rr��c�F��������|j|�\}}||jz�|�z�|�z�g�g}	�j�|jdd�}
|
r
��fd����fd��n��fd����fd������fd�}���fd�}����fd	�}
���fd
�}|dz�z}|j}|D]n}|dk(rd��|z��|j||�|jjj||||
|�
��|jjjz��p�r�d��S)N�truncaterc�&��t�|�zz�SrR�r��x�__dx__�scales ��r�<lambda>zF__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.<lambda>j�����U�A�f�H�5E�(F�rc�&��t�|�zz�SrRri��y�__dy__rms ��rrnzF__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.<lambda>krorc����|�zzSrRrrjs ��rrnzF__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.<lambda>m�����q�6�z�(:�rc����|�zzSrRrrqs ��rrnzF__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.<lambda>nrurc�p���r�d��d�|j��|j�f�y)N��	closePath�moveTo�rkrr)�a�ctx�P�P_append�xpt�ypts  ����r�move_tozE__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.move_tops,����h�~�6� �(�3�q�s�s�8�C����H�!=�>rc�\���d�|j��|j�f�y)N�lineTor{)r|r}rr�r�s  ���r�line_tozE__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.line_tots"��� �(�3�q�s�s�8�C����H�!=�>rc	�R���	r�	dddn|j|jf\}}�|j�}�|j�}�|j�}�|j�}�
d|||z
dzdzz|||z
dzdzz|||z
dzz|||z
dzz||f�y)zusing the cubic equivalent������N�curveTor�r{)
r|�br}�x0�y0�x1�y1�x2�y2r~rr�r�s
         ����r�conic_tozF__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.conic_tows����./��"��b�c�
�a�c�c�1�3�3�Z���2� ����X�� ����X�� ����X�� ����X�� �)�B��B���	�1�}�,<�R�"�R�%���A�
�=M�b�RT�UW�RW�YZ�QZ�l�[]�_a�bd�_d�fg�^g�[g�hj�km�!n�orc�����d�|j��|j��|j��|j��|j��|j�f�y)Nr�r{)r|r��cr}rr�r�s    ���r�cubic_tozF__makeTextPathsCode__.<locals>.FTTextPath._text2Path.<locals>.cubic_to�sT��� �)�C����H�S����X�c�!�#�#�h�s�1�3�3�x�PS�TU�TW�TW�PX�Y\�]^�]`�]`�Ya�!b�crg333333�?�
)r�r�r�r�rx)r�units_per_EM�append�pop�ftLFlags�	load_char�glyph�outline�	decompose�metrics�horiAdvance)rZ�textrkrrr1r2�kwdsr>rb�Srgr�r�r�r��
lineHeightr�r�r~rrlrsrmr�r�s                  @@@@@@@r�
_text2Pathz4__makeTextPathsCode__.<locals>.FTTextPath._text2Path`s0���!%���h�!7�J�D�$�$�T�%6�%6�6�E��u�W�F��u�W�F��A��A� �x�x�H�#�x�x�
�1�5�H��F��F��:��:��?�?�p�d�"*�#��e�!3�J�#�}�}�H�!�I���d�7�%&�F�"�j�0�F�$����q�(�3��
�
�*�*�4�4�T�7�T[�fn�zB�4�C�!'�$�*�*�*<�*<�*H�*H�!H��I��(�>�2��HrN)rrr�FT_LOAD_DEFAULT�FT_LOAD_NO_SCALE�FT_LOAD_NO_BITMAPr�r[rrr�)rOrds��r�
FTTextPathrWCs@���#�3�3�h�6O�6O�O�RZ�Rl�Rl�l��$�0�0./�!�n�W[�.rr�re�startrc	����t|�}	|	jr|	jstd|z��gj}
|dk(s%t|||�}|dk(r||z
}n
|dk(r||dzz
}|���}|	jr*|
|j
|||||||���|
j(St|�r	|jd�}t||	g|	jz�}t|�dz
}t|�D]v\}
\}}t!|t"�r|j|j$�}|
|j
||||j&|||���|
|k7s�b||j||�z
}�x|
j(S#t$ra}|jd	d
\}
}t|jdd
|jd
�d|t|
dz
d
�|
�d||
|�d|||dz��fz��d}~wwxYw)z�freetype text2PathDescription(text, x=0, y=0, fontName='fontname',
                                    fontSize=1000, font = 'fontName',
                                    anchor='start', truncate=1, pathReverse=0, gs=None)
                �=text2PathDescription doesn't support multi byte fonts like %rr��end�middle�@N)rkrrr1r2rg�pathReverse�utf8r�r��
r�-->�<--r)r	�
_multiByter^r:�extend�stringWidthr�r�decode�UnicodeDecodeErrorr;�maxr
�substitutionFonts�len�	enumerate�
isinstance�bytes�encNamer1�__self__)r�rkrrr1r2�anchorrgr�rBrb�P_extend�textLenrC�i�j�FT�nm1rD�tr�s                   �rrz3__makeTextPathsCode__.<locals>.text2PathDescription�sQ����x�(���?�?�4�+<�+<�$�%d�go�%o�p�p��9�9���w��)�$��(�C�G��u�}��g�I����)����
�N���:�#��B��$�$��R�]�]�4�!�a��S[�fn�|G�]�H�I� �(�(�(��t�}�S�#'�;�;�v�#6�D�$�D�$���0F�0F�)F�G�B��b�'�!�)�C�%.�r�]�<�	��6�A�q�%�a��.�A�H�H�Q�Y�Y�4G�� ����q�1�q�!�*�*�V^�iq�J��"K�L��c�6�����q�(�!;�;�A�	<�
 �(�(�(�� 2�S�"#�&�&��1�+�C�A�a�"4�q�v�v�b�q�z�YZ�Y_�Y_�`a�Yb�cg�hk�lm�np�lp�qr�hs�tu�cv�w{�|}�~�xA�BF�GH�IJ�KM�IM�BN�DO�CQ�8Q�#S�S��S�s�4E=�=	G'�AG"�"G')rr�c
��g}g}gj}|r(t|�dk(r|dddk(rd|dddzf|z}|xsddzD�]}|d}|r�|dvr�|ddk(re|d=|r=|ddd	�|ddd	�c|ddd	�<|ddd	�<|j�|j�|jdd
�|jd�d}|rt	tt|��}|D];}	|ttj|	�z}
||	ft|||
�z�|
}�=g}g}|j|�|j|dd���|jS)Nrrr�)�moveToClosedr))r�)rzr�r�r�rrzry)
r�r��reverse�insertr"r#rrr�index�tupler�r�)�Grgr��Or~�R_append�g�opr��or�s           rrz+__makeTextPathsCode__.<locals>.processGlyph�s��������9�9����Q����q��t�A�w��'8�*�1�Q�4���8�3�5�a�7�A��'�r�;�.�$�A��1��B��R�#C�C��Q�4��/� !�!��*�23�A�D�q�D�'�!�A�D�q�D�'���!�$�Q�$���!�$�Q�$�� !�	�	�� !�	�	���H�H�Q�x�0��H�H�[�1���#��c�,�q�.A�)B�Q�!"�"�A� !�$6�~�7K�7K�A�7N�$O� O�A�$�a�T�5��1�Q��=�%8�9� !�A�"������H�H�R�L��H�H�Q�q�r�U�O�)$�* �(�(�(rc	�2��t|�}	|	jr|	jstd|z��gj}
|dk(s%t|||�}|dk(r||z
}n
|dk(r||dzz
}|�ddlm}|d	d	�}t|||�|	jr5|j|||�D]}
|
�|
||�
���|
j*St|�r	|jd�}|	}t||	g|	j z�}t#|�d	z
}t%|�D]�\}\}}||k7rt||j&|�|}|j|||�D]}
|
�|
||�
���||k7s�V||j|j|j(�|�z
}��|
j*S#t$ra}|jdd
\}}t|jdd
|jd
�d|t|dz
d�|�d|||�d|||dz��fz��d}~wwxYw)z�_renderPM text2PathDescription(text, x=0, y=0, fontName='fontname',
                                    fontSize=1000, font = 'fontName',
                                    anchor='start', truncate=1, pathReverse=0, gs=None)
                r�r�r�r�r�Nr)�gstater)rgr�r�rr�r�r�r�r�)r	r�r^r:r�r�r=r�r�_stringPathrr�r�r;r�r
r�r�r�r1r�r�)r�rkrrr1r2r�rgr�rBrbr�r�r�r�rCr�r��fcr�r�rDr�rs                      �rrz3__makeTextPathsCode__.<locals>.text2PathDescription�s|����x�(���?�?�4�+<�+<�$�%d�go�%o�p�p��9�9���w��)�$��(�C�G��u�}��g�I����)����
�N���:�3���!��B���8�H�-��$�$��^�^�D��1�5�\�� ��a��k�!Z�[�\�( �(�(�(�#�t�}�S�#'�;�;�v�#6�D��B�#�D�$���0F�0F�)F�G�B��b�'�!�)�C�%.�r�]�N�	��6�A�q��b�5�#�B�q�z�z�(�;�!"�B�!#����!�A�!6�`�A�$�\�!�X�R]�%^�_�`��c�6�����q�x�x��	�	�/B�H�!M�M�A�N� �(�(�(�� 2�S�"#�&�&��1�+�C�A�a�"4�q�v�v�b�q�z�YZ�Y_�Y_�`a�Yb�cg�hk�lm�np�lp�qr�hs�tu�cv�w{�|}�~�xA�BF�GH�IJ�KM�IM�BN�DO�CQ�8Q�#S�S��S�s�F,�,	H�5AH�H)rrrc� ��td�����)Nz�This installation of reportLab has neither PYCAIRO or RENDERPM extras installed.
It cannot create paths from text.
Could not create text2PathDescription for using backends from )�RuntimeError)r;r��TPs  �rr5z __makeTextPathsCode__.<locals>._s"����$?�?A�f� H�I�
Ir)rrr�r)rr)�reportlab.rl_configrKrLr:r�rO�ImportErrorrdrr0r=r)rT�_TPrKrLrr=r5r�r�rOrdrs`      @@@@@r�__makeTextPathsCode__r�2sG���>�	�~�2�y��)��*�K�7�Z�[��	�c�	�
���:�i�]�2i�j�k�k�
���0�3�0�1�	1�B��KR��
�z�>�
��
�K
�K
�Z./�!�n�W[�/6��PQ�VZ�"
)�F�-A�Z�X�X�
��_�
�#�
)�:./�!�n�W[�/6��PQ�VZ�)
)�T�-A�|�dk�l�l�KKR�N	I���1��q�Q�Q��O�
��
��n�
��
�s$�C�C*�	C'�&C'�*	C6�5C6rer�c	
�d�|	jdt�}
t|
|||||||||��	fi|	��S)Nr)rkrrr1r2r�rgr�rB)r�rr)r�rkrrr1r2r�rgr�rBr��t2pds           rrrsI���8�8�*�+?�@�D��d�4�!�a��%�V�X�R]�bd�f�n�hl�n�nr)N)rOrP)�__all__�reportlab.pdfbase.pdfmetricsr	r
�reportlab.lib.utilsrrr
�shapesrrrr�sysr�	Exceptionrr7rrr��globals�updaterrrr�<module>r�sq��
��=�?�?�R�R��	�I�	�4�
&��
UR�n�	���&�(�)��1�~�����d�nr

Zerion Mini Shell 1.0