o
    h                     @   s   d Z dZdddddZi dddd	d
dddddddddddddddddddddd dd!dd"dd#d$d$d$d$d%Zi Zee D ]Zee  Z	e	evr^eee	< ed&  Z	e	evrleee	< qNd'd( Z
d)d* Zd+d, Zd-S ).z3.3.0a  Utilities to associate bold and italic versions of fonts into families

Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing.   We therefore
need to keep 'mappings' between the font family name and the right group
of up to 4 implementation fonts to use.

Most font-handling code lives in pdfbase, and this probably should too.

times	helveticacourier)serif	sansserif
monospacedarial)r       r   zTimes-Roman)r      r   z
Times-Bold)r   r   r	   zTimes-Italic)r   r	   r	   zTimes-BoldItalic)r   r   r   Courier)r   r	   r   zCourier-Bold)r   r   r	   zCourier-Oblique)r   r	   r	   zCourier-BoldOblique)r   r   r   	Helvetica)r   r	   r   zHelvetica-Bold)r   r   r	   zHelvetica-Oblique)r   r	   r	   zHelvetica-BoldOblique)symbolr   r   Symbol)r   r	   r   )r   r   r	   )r   r	   r	   )zapfdingbatsr   r   ZapfDingbats))r   r	   r   )r   r   r	   )r   r	   r	   r   c                 C   s$   |   } | tv rt|  S td|  )z(ps fontname to family name, bold, italicz-Can't map determine family/bold/italic for %s)lower
_ps2tt_map
ValueError)psfn r   U/var/www/html/optinet_system/venv/lib/python3.10/site-packages/reportlab/lib/fonts.pyps2ttI   s   r   c                 C   sd   |   ||f}|tv rt| S t|d \} }}| ||B ||B f}|tv r)t| S td| ||f )z+family name + bold & italic to ps font namer   z:Can't find concrete font for family=%s, bold=%d, italic=%d)r   
_tt2ps_mapr   r   )fnbiKb1i1r   r   r   tt2psP   s   r   c                 C   s&   |   ||f}|t|< |t|  < dS )z,allow a custom font to be put in the mappingN)r   r   r   )facebolditalicpsnamekr   r   r   
addMapping\   s   r$   N)__version____doc___family_aliasr   r   sortedkeysr#   r   vr   r   r$   r   r   r   r   <module>   st   	
