U
    '1e¯  ã                   @   s®   d Z dZdddddœZ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krteee	< ed  ¡ Z	e	ekrTeee	< qTd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)ZserifZ	sansserifZ
monospacedZarialzTimes-Romanz
Times-BoldzTimes-ItaliczTimes-BoldItalicZCourierzCourier-BoldzCourier-ObliquezCourier-BoldObliqueZ	HelveticazHelvetica-BoldzHelvetica-ObliquezHelvetica-BoldObliqueZSymbolZZapfDingbats))r   é    r   )r   é   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )Úsymbolr   r   )r   r   r   )r   r   r   )r   r   r   )Úzapfdingbatsr   r   )r   r   r   )r   r   r   )r   r   r   r   c                 C   s(   |   ¡ } | tkrt|  S td|  ƒ‚dS )z(ps fontname to family name, bold, italicz-Can't map determine family/bold/italic for %sN)ÚlowerÚ
_ps2tt_mapÚ
ValueError)Zpsfn© r   ú7/tmp/pip-unpacked-wheel-109iniqw/reportlab/lib/fonts.pyÚps2ttI   s    r   c                 C   sh   |   ¡ ||f}|tkrt| S t|d ƒ\} }}| ||B ||B f}|tkrRt| S td| ||f ƒ‚dS )z+family name + bold & italic to ps font namer   z:Can't find concrete font for family=%s, bold=%d, italic=%dN)r   Ú
_tt2ps_mapr   r
   )ÚfnÚbÚiÚKZ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	   )ÚfaceZboldZitalicZpsnameÚkr   r   r   Ú
addMapping\   s    r   N)Ú__version__Ú__doc__Z_family_aliasr   r	   ÚsortedÚkeysr   r   Úvr   r   r   r   r   r   r   Ú<module>   sL   ü	å
