U
    '1e'                     @   s  d Z dZddlZddlZi Zi Zi ZdZddddd	d
dddddddddZdddddddddddddd d!Z	ej
d"krd#d$d%d&d'd(d)d*d+d,d-d.d/d0d!ZeZe D ]$\ZZee	 kre	e e	e < q[[ne	Zd1d2 Zdd3lmZ dd4lmZ eefd5d6Z[[dQd8d9Zd:ZG d;d< d<eZe Zdd=lmZ dd>lm Z  dd?l!m"Z" dd@l#m$Z$ ddAl%m&Z& ddBl'm(Z( ddCl)m*Z* e+ee e"e$e&e(e*d: dDdEdEdDdFdFdFdFdGdHdIdJdKdKdLZ,ddl-Z.ddl/Z.ddl0Z.ddl1Z.ddl2Z.ddl3Z.ddl4Z.ddl5Z.ddl6Z.ddl7Z.ddl8Z.ddl9Z.ddl:Z.ddl;Z.e.j<j=j>e.j<j?j>e.j<j@j>e.j<jAj>e.j<jBj>e.j<jCj>e.j<jDj>e.j<jEj>e.j<jFj>e.j<jGj>e.j<jHj>e.j<jIj>e.j<jJj>e.j<jKj>dZLee,M eM eM eM eM eLM dMfdNdOZNddPlmOZO eOeN [OdS )Rz3.3.0a  Database of font related things

    - standardFonts - tuple of the 14 standard string font names
    - standardEncodings - tuple of the known standard font names
    - encodings - a mapping object from standard encoding names (and minor variants)
      to the encoding vectors ie the tuple of string glyph names
    - widthsByFontGlyph - fontname x glyphname --> width of glyph
    - widthVectorsByFont - fontName -> vector of widths 
    
    This module defines a static, large data structure.  At the request
    of the Jython project, we have split this off into separate modules
    as Jython cannot handle more than 64k of bytecode in the 'top level'
    code of a Python module.  
    N)CourierCourier-BoldCourier-ObliqueCourier-BoldOblique	HelveticaHelvetica-BoldHelvetica-ObliqueHelvetica-BoldObliqueTimes-Roman
Times-BoldTimes-ItalicTimes-BoldItalicSymbol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   r   )r   r   r   )r   r   r   Zsy______Zzd______Z_a______Z_ab_____Z_abi____Z_ai_____Z_eb_____Z_ebi____Z_ei_____Z_er_____Zcob_____Zcobo____Zcom_____Zcoo_____)symbolzapfdingbatsZ	helveticazhelvetica-boldzhelvetica-boldobliquezhelvetica-obliquez
times-boldztimes-bolditalicztimes-italicztimes-romanzcourier-boldzcourier-boldobliqueZcourierzcourier-obliqueZlinux2r   r   ZArialz
Arial-BoldzArial-BoldItaliczArial-ItaliczTimesNewRoman-BoldzTimesNewRoman-BoldItaliczTimesNewRoman-ItalicZTimesNewRomanr   r   r   r   c                 C   s   t |   S N)_font2fnrMaplower)fontName r   ?/tmp/pip-unpacked-wheel-109iniqw/reportlab/pdfbase/_fontdata.py_findFNRb   s    r   )T1SearchPath)	rl_isfilec                 C   s<   |g kst d|D ]"}tj|| }||r|  S qd S )NzNo Type-1 font search path)AssertionErrorospathjoin)nr   r   dfr   r   r   _searchT1Dirsg   s     
r$   .pfbc                 C   sz   t jdkrj|dkrjztt| }|r*|W S W n   Y nX z"tt|   | }|rZ|W S W n   Y nX tt| | S )Nr   r%   )sysplatformr$   r   _font2fnrMapWin32r   )r   extr#   r   r   r   
findT1Fileo   s     
 
r*   )WinAnsiEncodingMacRomanEncodingStandardEncodingSymbolEncodingZapfDingbatsEncodingPDFDocEncodingMacExpertEncodingc                   @   s4   e Zd ZdZdddddddd	Zd
d Zdd ZdS )_Name2StandardEncodingMapz*Trivial fake dictionary with some [] magicr+   r,   r-   r.   r/   r0   r1   )Zwinansimacromanstandardr   r   ZpdfdocZ	macexpertc                 C   sT   |  }|dd  dkr$|d d }| j| }|| krBtd| t| || d S )NencodingzEncoding %s is already set)r   _XMap
IndexErrordict__setitem__)selfxvyr   r   r   r:      s     
 z%_Name2StandardEncodingMap.__setitem__c                 C   s:   |  }|dd  dkr$|d d }| j| }t| |S )Nr5   r6   )r   r7   r9   __getitem__)r;   r<   r>   r   r   r   r?      s
     
z%_Name2StandardEncodingMap.__getitem__N)__name__
__module____qualname____doc__r7   r:   r?   r   r   r   r   r2      s   r2   )r+   )r,   )r-   )r.   )r/   )r0   )r1   )iu  ic)ir  ir)i  i1)  i')i  3)i  rE   )rD   rE   )r   r   )r   r   r   r   r   r   r	   r   r
   r   r   r   r   r   )ascent_descentfontsByBaseEncfontsByNamestandardFontAttributeswidthVectorsByFontwidthsByFontGlyphc                 C   s2   |   D ]$\}}t | }|  || qd S r   )itemsglobalsclearupdate)Zinitial_dictskr=   r"   r   r   r   _reset   s    

rQ   )register_reset)r%   )P__version__rC   r   r&   rJ   rH   rG   ZstandardFontsrI   r(   r'   Z_font2fnrMapLinux2r   rL   rP   r=   keysr   r   Zreportlab.rl_configr   Zreportlab.lib.utilsr   r$   r*   ZstandardEncodingsr9   r2   	encodingsZ'reportlab.pdfbase._fontdata_enc_winansir+   Z(reportlab.pdfbase._fontdata_enc_macromanr,   Z(reportlab.pdfbase._fontdata_enc_standardr-   Z&reportlab.pdfbase._fontdata_enc_symbolr.   Z,reportlab.pdfbase._fontdata_enc_zapfdingbatsr/   Z&reportlab.pdfbase._fontdata_enc_pdfdocr0   Z)reportlab.pdfbase._fontdata_enc_macexpertr1   rO   rF   Z*reportlab.pdfbase._fontdata_widths_courierZ	reportlabZ.reportlab.pdfbase._fontdata_widths_courierboldZ1reportlab.pdfbase._fontdata_widths_courierobliqueZ5reportlab.pdfbase._fontdata_widths_courierboldobliqueZ,reportlab.pdfbase._fontdata_widths_helveticaZ0reportlab.pdfbase._fontdata_widths_helveticaboldZ3reportlab.pdfbase._fontdata_widths_helveticaobliqueZ7reportlab.pdfbase._fontdata_widths_helveticaboldobliqueZ-reportlab.pdfbase._fontdata_widths_timesromanZ,reportlab.pdfbase._fontdata_widths_timesboldZ.reportlab.pdfbase._fontdata_widths_timesitalicZ2reportlab.pdfbase._fontdata_widths_timesbolditalicZ)reportlab.pdfbase._fontdata_widths_symbolZ/reportlab.pdfbase._fontdata_widths_zapfdingbatsZpdfbaseZ_fontdata_widths_courierZwidthsZ_fontdata_widths_courierboldZ_fontdata_widths_courierobliqueZ#_fontdata_widths_courierboldobliqueZ_fontdata_widths_helveticaZ_fontdata_widths_helveticaboldZ!_fontdata_widths_helveticaobliqueZ%_fontdata_widths_helveticaboldobliqueZ_fontdata_widths_timesromanZ_fontdata_widths_timesboldZ_fontdata_widths_timesitalicZ _fontdata_widths_timesbolditalicZ_fontdata_widths_symbolZ_fontdata_widths_zapfdingbatsrK   copyrQ   rR   r   r   r   r   <module>   s  

"
