403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/reportlab/lib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/reportlab/lib/__pycache__/codecharts.cpython-311.pyc
�

}G�b�2��@�dZdZddlZddlmZddlmZddlmZm	Z	ddl
mZmZm
Z
ddlmZdd	lmZdd
lmZddd
dd�ZGd�de��ZGd�de��ZGd�de��ZGd�de��Zd�ZGd�de��Zd�Zedkre��dSdS)z3.3.0aLRoutines to print code page (character set) drawings. Predates unicode.

To be sure we can accurately represent characters in various encodings
and fonts, we need some routines to display all those characters.
These are defined herein.  The idea is to include flowable, drawable
and graphic objects for single and multi-byte fonts. �N)�Canvas)�Flowable)�
pdfmetrics�cidfonts)�Group�String�Rect)�Widget)�colors)�int2Byte�winansi�macroman�	macexpert�pdfdoc)�WinAnsiEncoding�MacRomanEncoding�	MacExpert�PDFDocc�,�eZdZdZd�Zd�Zd�Zdd�ZdS)	�
CodeChartBasezrBasic bits of drawing furniture used by
    single and multi-byte versions: ability to put letters
    into boxes.c��|jdz|jz}|t|��krt|��|_nt|��dz|_|jd|jzz|_|jd|jzz|_g|_t|jdz��D]$}|j�	||jz���%g|_
t|jdz��D]$}|j
�	||jz���%dS)z&Work out x and y positions for drawingg�?��N)�
codePoints�charsPerRow�int�rows�boxSize�width�height�ylist�range�append�xlist)�selfr�row�cols    �:/usr/lib/python3/dist-packages/reportlab/lib/codecharts.py�
calcLayoutzCodeChartBase.calcLayout#s	�����$�t�'7�7���3�t�9�9����D�	�	�D�I�I��D�	�	�A�
�D�I��\�Q�t�'7�%7�8��
��l�a��	�k�2�����
����Q��'�'�	2�	2�C��J���c�D�L�0�1�1�1�1���
���)�A�-�.�.�	2�	2�C��J���c�D�L�0�1�1�1�1�	2�	2�c�$�|jrd|zSd|zS)N�%02Xz%d)�hex)r%�byts  r(�
formatBytezCodeChartBase.formatByte8s ���8�	��C�<���#�:�r*c
��|j|jzt|��z
}t|��D]}|�d���d}d}|j�|j|jdz��|D�]�}|�}|j�	d��|j�
d|z|jz|j|z
dz
|jz|j|jdd���|j�	d��n�	|j�|dz|jz|j|z
d	z
|jz|��n�#|j�	d��|j�
d|z|jz|j|z
dz
|jz|j|jdd���|j�|dz|jz|j|z
d	z
|jzd
��|j�	d��YnxYw|dz}||jkr|dz}d}���dS)z]Fills boxes in order.  None means skip a box.
        Empty boxes at end get filled with grayNr��?g�������?r��stroke�fill���?g�?�?)rr�lenr"r#�canv�setFont�fontNamer�setFillGray�rect�drawCentredString)r%�charList�extraNeeded�ir&r'�chs       r(�	drawCharszCodeChartBase.drawChars>sM���y�4�#3�3�c�(�m�m�C���{�#�#�	"�	"�A��O�O�D�!�!�!�!������	���$�-����)<�=�=�=��	�	�B��z��	�%�%�c�*�*�*��	����#����5��	�C��!�8K�t�|�7[��L�$�,�q�q��B�B�B��	�%�%�c�*�*�*�*�/��I�/�/� ��W���4�!�Y��_�u�4���D�������
	/��I�)�)�#�.�.�.��I�N�N�A�c�E�T�\�#9�D�I��O�a�<O�SW�S_�;_���d�l�1�1�#�F�F�F��I�/�/� ��W���4�!�Y��_�u�4���D�����
�I�)�)�#�.�.�.�.�.������'�C��d�&�&�&��A�g�����5	�	s
�8:D3�3B8G-�c��|j�d��|j�d|jd|j|jdd���|j�dd|j|jddd���|j�d��|j�dd|jz��d}t|j��D]k}|j	r|j	|}n|�
||jz��}|j�d	|jz|j|z
d
z
|jz|���lt|j��D]L}|j�|dz|jz|jdz|jz|�
|�����M|rY|j�d
d	|jz��|j�d	|jz|jdz|jz|��dSdS)z4Writes little labels in the top row and first column皙�����?r���r)r4r3r5zHelvetica-Obliqueg�?g�?r1r6g�?zHelvetica-BoldObliqueN)
r9r<r=r!rrr:r"r�	rowLabelsr/rr>)r%�topLeftr.r&�labelr's      r(�
drawLabelszCodeChartBase.drawLabelsds���	���c�"�"�"��	���q�$�*�R�.�$�*�d�l��ST��U�U�U��	���q�!�T�\�4�:�b�>��!��L�L�L��	���c�"�"�"�	
�	���-�e�d�l�.B�C�C�C������#�#�	*�	*�C��~�
@���s�+�������d�.>�(>�?�?���I�'�'��d�l�(:�)-��S��4�)?�4�<�(O�(-�
*�
*�
*�
*���)�*�*�	*�	*�C��I�'�'��s��d�l�(B�)-��T�)9�T�\�(I�(,����(<�(<�
*�
*�
*�
*�
�	*��I���5�c�D�L�6H�I�I�I��I�'�'��d�l�(:�)-��T�)9�T�\�(I�(/�
*�
*�
*�
*�
*�	*�	*r*N)rD)�__name__�
__module__�__qualname__�__doc__r)r/rCrK�r*r(rrs`��������2�2�2�*���$�$�$�L*�*�*�*�*�*r*rc� �eZdZ		d	d�Zd�ZdS)
�SingleByteEncodingChart�	Helveticar��rc�,�d|_||_||_|jdz|jz|_||_||_||_d|_tj	tj
|j|j|j����|���dS)N��-)r�faceName�encodingNamer;rrr-rHr�registerFont�Fontr))r%rYrZrrr-s      r(�__init__z SingleByteEncodingChart.__init__�s������ ��
�(����
��+�d�.?�?��
�&��������������
���
�04�
�04�0A�!C�!C�	"�	"�	"�
	
�������r*c�����|���dgdzttttt	dd��������z}|j}t�||��}tj	|��d��fd���fd�|D��}|�
|��|j�|j
|j��dS)N� rWrc�2��|�dS�|d���dS)N�replace)�errorsrrP)�txt�decoders �r(�
decodeFuncz0SingleByteEncodingChart.draw.<locals>.decodeFunc�s'����{��t��w�s�9�5�5�5�a�8�8r*c�&��g|]
}�|����SrPrP)�.0rBres  �r(�
<listcomp>z0SingleByteEncodingChart.draw.<locals>.<listcomp>�s!���6�6�6�r�J�J�r�N�N�6�6�6r*)rK�list�maprr"rZ�adobe2codec�get�codecs�lookuprCr9�gridr$r!)r%r?�encNamererds   @@r(�drawzSingleByteEncodingChart.draw�s������������6�B�;��c�(�D��r�3���4H�4H�&I�&I�!J�!J�J��
�#���/�/�'�7�3�3���-��(�(��+��	9�	9�	9�	9�	9�7�6�6�6�X�6�6�6��	
���x� � � ��	���t�z�4�:�.�.�.�.�.r*N)rSrrTrUr)rLrMrNr]rqrPr*r(rRrR�s=������:K�12�����$/�/�/�/�/r*rRc�$�eZdZdZd�Zd�Zd�ZdS)�KutenRowCodeChartafFormats one 'row' of the 94x94 space used in many Asian encodings.aliases

    These deliberately resemble the code charts in Ken Lunde's "Understanding
    CJKV Information Processing", to enable manual checking.  Due to the large
    numbers of characters, we don't try to make one graphic with 10,000 characters,
    but rather output a sequence of these.c�r�||_d|_d|_d|_d|_gd�|_d|_||_||_	tj
|j|j��}tj|��n#d|_d|_YnxYw|jd	z|jz|_
|���dS)
N�^���)�00�20�40�60�80rrSrrX)r&rrrrrHr-rYrZr�CIDFontrr[r;r)�r%r&rYrZ�fonts     r(r]zKutenRowCodeChart.__init__�s�����������������	�3�3�3������ ��
�(���	2��#�D�M�4�3D�E�E�D��#�D�)�)�)�)��	2�'�D�M� 1�D��������
��+�d�.?�?��
����������3A7�7B	c��g}|j�d��dkrNtdd��D]<}t|dz��t|dz��z}|�|���=n|�dgdz��|S)z1Works out the character values for this kuten row�EUC���r�_�Nru�rZ�findr"rr#)r%r&�cellsr'rBs     r(�makeRowzKutenRowCodeChart.makeRow�s�������!�!�%�(�(�2�-�-��Q��|�|�
!�
!���c�C�i�(�(�8�C��G�+<�+<�<�����R� � � � �
!�
�L�L�$��"��%�%�%��r*c���|�d|jz���dg|�|j��z}|�|��|j�|j|j��dS)NzR%d�rI�rKr&r�rCr9ror$r!�r%r?s  r(rqzKutenRowCodeChart.draw�sk��������!1��2�2�2��6�D�L�L���2�2�2�����x� � � ��	���t�z�4�:�.�.�.�.�.r*N�rLrMrNrOr]r�rqrPr*r(rsrs�sK������.�.����,��� 	/�	/�	/�	/�	/r*rsc�$�eZdZdZd�Zd�Zd�ZdS)�
Big5CodeChartz�Formats one 'row' of the 94x160 space used in Big 5

    These deliberately resemble the code charts in Ken Lunde's "Understanding
    CJKV Information Processing", to enable manual checking.c�r�||_d|_d|_d|_d|_d|_||_||_gd�|_	tj
|j|j��}tj|��n#d|_d|_YnxYw|jd	z|jz|_
|���dS)
Nr�rvrT�
r)
�4�5�6�7�A�B�C�D�E�FrSrrX)r&rrrrr-rYrZrHrr~rr[r;r)rs     r(r]zBig5CodeChart.__init__�s�����������������	���� ��
�(���B�B�B���	2��#�D�M�4�3D�E�E�D��#�D�)�)�)�)��	2�'�D�M� 1�D��������
��+�d�.?�?��
��������r�c� �g}|j�d��dkrTdD]P}td��D]>}|dz|z}t|��t|��z}|�|���?�Qn|�dgdz��|S)zLWorks out the character values for this Big5 row.
        Rows start at 0xA1�B5r�)
�rx��r����
rU�rTNr�r�)r%r&r��y�xr'rBs       r(r�zBig5CodeChart.makeRows�������!�!�$�'�'�"�,�,�0�
%�
%���r���%�%�A��B�$�q�&�C�!�#����#���6�B��L�L��$�$�$�$�%�
%�
�L�L�$��#��&�&�&��r*c���|�d|jz���|�|j��}|�|��|j�|j|j��dS)Nr,r�r�r�s  r(rqzBig5CodeChart.drawsb�������� 1��2�2�2��<�<���)�)�����x� � � ��	���t�z�4�:�.�.�.�.�.r*Nr�rPr*r(r�r��sM������@�@����*��� /�/�/�/�/r*r�c	��|���	tj|��}n8#t$r+t	j|��}tj|��YnwxYw|�d��|�||tj	||d��ddd���|�d��|�
|dd��|�|||��|���dS)z�Helper for stringwidth tests on Asian fonts.

    Registers font if needed.  Then draws the string,
    and a box around it derived from the stringWidth functionrFrTrrr2N)
�	saveStater�getFont�KeyErrorr�UnicodeCIDFontr[r<r=�stringWidthr:�
drawString�restoreState)�msg�canvasr�r�r;r�s      r(�hBoxTextr�s��
������&��!�(�+�+�����&�&�&��&�x�0�0�����%�%�%�%�%�&�������s����
�K�K��!�J�*�3��"�=�=�b��q�K�Q�Q�Q�
���q����
�N�N�8�R��#�#�#�
���a��#����
�������s�+�2A �A c��eZdZdZd�Zd�ZdS)�
CodeWidgetz Block showing all the charactersc�>�d|_d|_d|_d|_dS)Nrr�)r�r�rr )r%s r(r]zCodeWidget.__init__3s"����������
�����r*c
���|jdz}|jdz}t��}|�t	|j|j|j|jdtj�����td��D]s}td��D]a}|dz|z}|dkrQt|j||zz|j|j||zz
zt|����}|�|���b�t|S)Ng0@)�	fillColor�strokeColorrTr_)rr r�addr	r�r�r�blackr"rr)r%�dx�dy�gr�r��	charValue�ss        r(rqzCodeWidget.draw9s���
�Z�$�
��
�[�4�
���G�G��	���d�4�6�4�6�4�:�t�{�!�v�|�=�=�=�	>�	>�	>��r���	�	�A��2�Y�Y�
�
����F�Q�J�	��r�>�>��t�v��B���#�v���q��t�);�<�h�y�>Q�>Q�S�S�A��E�E�!�H�H�H��
��r*N)rLrMrNrOr]rqrPr*r(r�r�1s8������*�*����
�
�
�
�
r*r�c��td��}|�dd��|�ddd��t��}|�|dd��td�	��}|�|dd
��tdd�
��}|�|dd��|���t
d��dS)Nzcodecharts.pdfzHelvetica-Bold��Hi�zTesting code page chartsi�r_)ri,�r)rr-�dzsaved codecharts.pdf)rr:r�rR�drawOn�save�print)�c�cc1�cc2�cc3s    r(�testr�Ms����� � �A��I�I���#�#�#��L�L��S�4�5�5�5�
!�
#�
#�C��J�J�q�"�c����
!�b�
1�
1�
1�C��J�J�q�"�c����
!�b�a�
8�
8�
8�C��J�J�q�"�c�����F�F�H�H�H�	�
 �!�!�!�!�!r*�__main__)�__version__rOrm�reportlab.pdfgen.canvasr�reportlab.platypusr�reportlab.pdfbaserr�reportlab.graphics.shapesrrr	�reportlab.graphics.widgetbaser
�
reportlab.libr�reportlab.lib.utilsrrkrrRrsr�r�r�r�rLrPr*r(�<module>r�s���

��	9���
�
�
�*�*�*�*�*�*�'�'�'�'�'�'�2�2�2�2�2�2�2�2�9�9�9�9�9�9�9�9�9�9�0�0�0�0�0�0� � � � � � �(�(�(�(�(�(� �!��
�	���d*�d*�d*�d*�d*�H�d*�d*�d*�L)/�)/�)/�)/�)/�m�)/�)/�)/�X8/�8/�8/�8/�8/�
�8/�8/�8/�v//�//�//�//�//�M�//�//�//�d���(���������8"�"�"�:�Z����D�F�F�F�F�F��r*

Youez - 2016 - github.com/yon3zu
LinuXploit