| 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/graphics/__pycache__/ |
Upload File : |
�
{�
gWC � �� � d Z dZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZmZ ddl
mZ dd lmZ dd
lT ddlZg d�Zd� Zd
� ZddlmZ ee� � e� � d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"ddl#m$Z$ d� Z%d� Z&d� Z'd� Z(d� Z)d)d!�Z*d*d"�Z+d)d#�Z,d$� Z- G d%� d&ej. � � Z/d'� Z0e1d(k r, ej2 � � �3 e0� � � � dS dS )+z $Id $ z�Execute this script to see some test drawings.
This contains a number of routines to generate test drawings
for reportlab/graphics. For now many of them are contrived,
but we will expand them to try and trip up any parser.
Feel free to add more.
� N)�BytesIO)�colors)�cm)�asNative�base64_decodebytes)�Canvas)�stringWidth)�*)�Times-Roman�VerazTimes-BoldItalicc � � ddl m} m} | � |� dd� � � � | � |� dd� � � � | � |� dd� � � � | � |� d d
� � � � g d�}t
j dk r�d
D ]�\ }}dD ]�}t j � |d|� � }t j �
|� � rI |� ||� � }| � |� � |� |� � ��# Y ��xY w����|S )Nr )�
pdfmetrics�ttfontsr zVera.ttf�VeraBdz
VeraBd.ttf�VeraItz
VeraIt.ttf�VeraBIz
VeraBI.ttf)r �Courier� Helveticar r r r �win32))zAdventurer Light SFz
Advlit.ttf)�ArialMSz ARIAL.TTF)zArial Unicode MSzARIALUNI.TTF)zBook Antiquaz BKANT.TTF)zCentury Gothicz
GOTHIC.TTF)z
Comic Sans MSz COMIC.TTF)zElementary Heavy SF Boldz Vwagh.ttf)z
Firenze SFzflot.ttf)�GaramondzGARA.TTF)�JaggerzRols.ttf)zMonotype CorsivazMTCORSVA.TTF)z
Seabird SFzseag.ttf)�Tahomaz
TAHOMA.TTF)� VerdanaMSzVERDANA.TTF)zc:\WINNTz
c:\Windows�Fonts)�reportlab.pdfbaser r �registerFont�TTFont�sys�platform�os�path�join�isfile�append)r r �F�name�ttf�D�fn�fs �?/usr/lib/python3/dist-packages/reportlab/graphics/testshapes.py�_setupr- si � �5�5�5�5�5�5�5�5����G�N�N�6�:�>�>�?�?�?����G�N�N�8�\�B�B�C�C�C����G�N�N�8�\�B�B�C�C�C����G�N�N�8�\�B�B�C�C�C�R�R�R�A�
�|�W���� � �I�D�#� 1�
�
���W�\�\�!�G�C�0�0���7�>�>�"�%�%� ��#�N�N�4��4�4��"�/�/��2�2�2����������������
�
�
�Hs
�
A E�Ec �n � t � � D ]%} | t vrt � | � � �&d S )N)r- �_FONTSr% )r+ s r, �
resetFontsr0 A s; � �
�X�X� � ���F�?�?��M�M�!������ � )�register_resetc � � t dd� � }g d�}|� t |dt z t j t j �� � � � t ddd| z d� � � }|� |� � |S )
a+ Generate a drawing in case something goes really wrong.
This will create a drawing to be displayed whenever some
other drawing could not be executed, because the generating
function does something terribly wrong! The box contains
an attention triangle, plus some error message.
� �� )r5 � � �P i r8 � �?��strokeWidth�strokeColor� fillColor�( z"Error in generating function '%s'!�middle��
textAnchor)�Drawing�add�Polygonr r �red�yellow�String)�funcNamer) �points�ss r, �getFailedDrawingrK N s� � � ��S���A�
&�
&�
&�F��E�E�'�&�!�"�f�$�j�"�M�+� +� +� ,� ,� ,�
�s�B�3�h�>�"� $� $� $�A� �E�E�!�H�H�H��Hr1 c �H � t dd� � } | � t ddddt j �� � � � | � t dddt j �� � � � | � t dd d
t j �� � � � | S )z{Hello World, on a rectangular background.
The rectangle's fillColor is yellow.
The string's fillColor is red.
r4 r5 �2 �, �d �r= � �Hello World�V s Special characters ¢©®£αβ)rB rC �Rectr rF rG rE �r) s r, �getDrawing01rV i s� � � ��S���A��E�E�$�r�2�s�C�6�=�
9�
9�
9�:�:�:��E�E�&��S�-�6�:�
>�
>�
>�?�?�?��E�E�&��R�_�kq�ku�
v�
v�
v�w�w�w��Hr1 c � � t dd� � } | � t ddddt j dt
z �� � � � | � t ddddt j dt
z g d�� � � � � | S )
z�Various Line shapes.
The lines are blue and their strokeWidth is 5 mm.
One line has a strokeDashArray set to [5, 10, 15].
r4 r5 rM rN rO r9 )r<