o
    ¼ÇhT=  ã                   @   sp  d ddddœZ G dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZg d¢Zg d¢Z	g d¢Z
dd„ Zdd„ Zdd„ ZG dd„ deƒZG dd„ deƒZG dd„ deƒZG d d!„ d!eƒZG d"d#„ d#eƒZG d$d%„ d%eƒZG d&d'„ d'eƒZG d(d)„ d)eƒZG d*d+„ d+eƒZG d,d-„ d-eƒZG d.d/„ d/eƒZd0Zd1d2lmZ eeeeƒƒZd3S )4Ú ÚreadonlyÚexecuteonlyÚnoaccess)é    é   é   é   c                   @   s(   e Zd ZdZdZdZdd„ Zdd„ ZdS )Ú	ps_objectr   r   Nc                 C   s    || _ | jjdd … d | _d S ©Nr   Útype©ÚvalueÚ	__class__Ú__name__r   )Úselfr   © r   ún/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/fontTools/misc/psOperators.pyÚ__init__	   ó   zps_object.__init__c                 C   s   d| j jdd … t| jƒf S )Nz<%s %s>r   )r   r   Úreprr   ©r   r   r   r   Ú__repr__   s   zps_object.__repr__)r   Ú
__module__Ú__qualname__ÚliteralÚaccessr   r   r   r   r   r   r   r	      s    r	   c                   @   ó    e Zd ZdZdd„ Zdd„ ZdS )Úps_operatorr   c                 C   s&   || _ || _| jjdd … d | _d S r
   )ÚnameÚfunctionr   r   r   )r   r   r   r   r   r   r      s   zps_operator.__init__c                 C   s
   d| j  S )Nz<operator %s>)r   r   r   r   r   r      ó   
zps_operator.__repr__N)r   r   r   r   r   r   r   r   r   r   r      s    r   c                   @   r   )Úps_procedurer   c                 C   ó   dS )Nz<procedure>r   r   r   r   r   r       ó   zps_procedure.__repr__c                 C   sN   d}t t| jƒƒD ]}|r|d t| j| ƒ }q	|t| j| ƒ }q	|d S )NÚ{ú Ú})ÚrangeÚlenr   Ústr)r   ÚpsstringÚir   r   r   Ú__str__#   s   zps_procedure.__str__N)r   r   r   r   r   r,   r   r   r   r   r!      s    r!   c                   @   s   e Zd ZdZdd„ ZdS )Úps_namer   c                 C   s   | j rd| j S | jS ©Nú/)r   r   r   r   r   r   r,   0   s   
zps_name.__str__N)r   r   r   r   r,   r   r   r   r   r-   -   s    r-   c                   @   ó   e Zd Zdd„ ZdS )Ú
ps_literalc                 C   s
   d| j  S r.   ©r   r   r   r   r   r,   8   r    zps_literal.__str__N©r   r   r   r,   r   r   r   r   r1   7   ó    r1   c                   @   ó   e Zd Zdd„ Zdd„ ZdS )Úps_arrayc                 C   sj   d}t t| jƒƒD ]'}| j| }t|j }|rd| }|r(|d t|ƒ | }q	|t|ƒ | }q	|d S )Nú[r%   ú])r'   r(   r   Ú_accessstringsr   r)   )r   r*   r+   Úitemr   r   r   r   r,   =   s   

zps_array.__str__c                 C   r"   )Nz<array>r   r   r   r   r   r   J   r#   zps_array.__repr__N©r   r   r   r,   r   r   r   r   r   r6   <   s    r6   )
ÚFontInfoÚFontNameÚEncodingÚ	PaintTypeÚFontTypeÚ
FontMatrixÚFontBBoxÚUniqueIDÚMetricsÚStrokeWidth)	ÚversionÚNoticeÚFullNameÚ
FamilyNameÚWeightÚItalicAngleÚisFixedPitchÚUnderlinePositionÚUnderlineThickness)ÚPrivateÚCharStringsÚFIDc                 C   st   d}t |j }|r|d }| dkr|d| t|jƒf  }|S | dkr+|t||ƒ }|S |dt| ƒt|ƒ|f  }|S )Nr   r%   rP   z/%s %s def
r>   ú/%s %s %sdef
)r9   r   Ú_type1_CharString_reprr   Ú_type1_Encoding_reprr)   )Úkeyr   r*   r   r   r   r   Ú_type1_item_reprj   s   
þüÿrV   c                 C   sF   | j } d}tdƒD ]}| | j }|dkr|d||f  }q	|| d S )Nz</Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
é   ú.notdefzdup %d /%s put
zdef
)r   r'   )Úencodingr   r*   r+   r   r   r   r   rT   {   s   
€rT   c                 C   s   t |  ¡ ƒ}dS )NÚxxx)ÚsortedÚitems)Úcharstringsr\   r   r   r   rS   …   s   rS   c                   @   r5   )Úps_fontc              	   C   sÔ   dt | jƒ }tD ]}z| j| }W n	 ty   Y q	w |t||ƒ }q	t| j ¡ ƒ}|D ]\}}|tt vr>|t||ƒ }q-|d }tD ]}z| j| }W n	 tyW   Y qEw |t||ƒ }qE|d d d d S )Nú%d dict dup begin
z&currentdict end
currentfile eexec
dup z@dup/FontName get exch definefont pop
mark currentfile closefile
a  0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
ÚcleartomarkÚ
)r(   r   Ú_type1_pre_eexec_orderÚKeyErrorrV   r[   r\   Ú_type1_post_eexec_order)r   r*   rU   r   r\   r   r   r   r,   ‹   s>   ÿ€ÿÿþýüÿzps_font.__str__c                 C   r"   )Nz<font>r   r   r   r   r   r   ¨   r#   zps_font.__repr__Nr;   r   r   r   r   r^   Š   s    r^   c                   @   s   e Zd ZdS )Úps_fileN)r   r   r   r   r   r   r   re   ¬   s    re   c                   @   r5   )Úps_dictc                 C   sb   dt | jƒ }t| j ¡ ƒ}|D ]\}}t|j }|r|d }|dt|ƒt|ƒ|f  }q|d S )Nr_   r%   rR   zend )r(   r   r[   r\   r9   r   r)   )r   r*   r\   rU   r   r   r   r   r   r,   ±   s   
zps_dict.__str__c                 C   r"   )Nz<dict>r   r   r   r   r   r   »   r#   zps_dict.__repr__Nr;   r   r   r   r   rf   °   s    
rf   c                   @   r0   )Úps_markc                 C   ó    d| _ | jjdd … d | _d S )NÚmarkr   r   r   r   r   r   r   r   À   r   zps_mark.__init__N©r   r   r   r   r   r   r   r   rg   ¿   r4   rg   c                   @   r0   )Úps_procmarkc                 C   rh   )NÚprocmarkr   r   r   r   r   r   r   r   Æ   r   zps_procmark.__init__Nrj   r   r   r   r   rk   Å   r4   rk   c                   @   r0   )Úps_nullc                 C   s   | j jdd … d | _d S r
   )r   r   r   r   r   r   r   r   Ì   ó   zps_null.__init__Nrj   r   r   r   r   rm   Ë   r4   rm   c                   @   r0   )Ú
ps_booleanc                 C   s   | j rdS dS )NÚtrueÚfalser2   r   r   r   r   r,   Ñ   s   zps_boolean.__str__Nr3   r   r   r   r   ro   Ð   r4   ro   c                   @   r0   )Ú	ps_stringc                 C   s   dt | jƒdd…  S )Nz(%s)r   éÿÿÿÿ©r   r   r   r   r   r   r,   Ù   s   zps_string.__str__Nr3   r   r   r   r   rr   Ø   r4   rr   c                   @   r0   )Ú
ps_integerc                 C   ó
   t | jƒS ©Nrt   r   r   r   r   r,   Þ   r    zps_integer.__str__Nr3   r   r   r   r   ru   Ý   r4   ru   c                   @   r0   )Úps_realc                 C   rv   rw   rt   r   r   r   r   r,   ã   r    zps_real.__str__Nr3   r   r   r   r   rx   â   r4   rx   c                   @   sš  e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ Zd+d,„ Zeefd-d.„Zd/d0„ Zd1d2„ Zd3d4„ Zd5d6„ Zd7d8„ Z d9d:„ Z!d;d<„ Z"d=d>„ Z#d?d@„ Z$dAdB„ Z%dCdD„ Z&dEdF„ Z'dGdH„ Z(dIdJ„ Z)dKdL„ Z*dMdN„ Z+dOdP„ Z,dQdR„ Z-dSdT„ Z.dUdV„ Z/dWdX„ Z0dYdZ„ Z1d[d\„ Z2d]d^„ Z3d_d`„ Z4dadb„ Z5dcS )dÚPSOperatorsc                 C   s$   |   ¡ }|   ¡ }|| jd |j< d S ©Nrs   )ÚpopÚ	dictstackr   )r   Úobjr   r   r   r   Úps_defè   s   zPSOperators.ps_defc                 C   s"   |   d¡}|  |¡ |  |¡ d S ©NÚproceduretype)r{   Ú	proc_bindÚpush©r   Úprocr   r   r   Úps_bindí   s   

zPSOperators.ps_bindc                 C   sn   t t|jƒƒD ]-}|j| }|jdkr|  |¡ q|js4z|  |j¡}W n   Y q|jdkr4||j|< qd S )Nr€   Úoperatortype)r'   r(   r   r   r   r   Úresolve_name)r   r„   r+   r:   r}   r   r   r   r   ò   s   



€ôzPSOperators.proc_bindc                 C   s>   t | jƒdk rtdƒ‚|  ¡ }|  ¡ }|  |¡ |  |¡ d S )Nr   ústack underflow)r(   ÚstackÚRuntimeErrorr{   r‚   )r   Úobj1Úobj2r   r   r   Úps_exch  s   
zPSOperators.ps_exchc                 C   s"   | j stdƒ‚|  | j d ¡ d S )Nrˆ   rs   )r‰   rŠ   r‚   r   r   r   r   Úps_dup	  s   zPSOperators.ps_dupc                 C   s.   |   ¡ }|jdkr|  |¡ d S |  |¡ d S r   )r{   r   Úcall_procedureÚhandle_object©r   r}   r   r   r   Úps_exec  s   
zPSOperators.ps_execc                 C   s   |   tt| jƒƒ¡ d S rw   )r‚   ru   r(   r‰   r   r   r   r   Úps_count  ó   zPSOperators.ps_countc                 C   s*   |   ¡ }|   ¡ }|  t|j|jkƒ¡ d S rw   ©r{   r‚   ro   r   ©r   Úany1Úany2r   r   r   Úps_eq  ó   zPSOperators.ps_eqc                 C   s*   |   ¡ }|   ¡ }|  t|j|jkƒ¡ d S rw   r•   r–   r   r   r   Úps_ne  rš   zPSOperators.ps_nec                 C   s   |   ¡ }d|_|  |¡ d S ©Nr   )r{   r   r‚   r‘   r   r   r   Úps_cvx"  s   zPSOperators.ps_cvxc                 C   s:   t dƒtdƒtdƒt dƒtdƒtdƒg}|  t|ƒ¡ d S )Ng      ð?r   )rx   ru   r‚   r6   )r   Úmatrixr   r   r   Ú	ps_matrix'  s   úzPSOperators.ps_matrixc                 C   s"   |   d¡j}|  td| ƒ¡ d S )NÚintegertypeú )r{   r   r‚   rr   )r   Únumr   r   r   rr   2  s   zPSOperators.ps_stringc                 C   s   |   ¡ }|  t|jƒ¡ d S rw   )r{   r‚   rr   r   r‘   r   r   r   Úps_type6  s   zPSOperators.ps_typec                 C   sd   |   ¡ }|   ¡ }|j}tt| jƒd ddƒD ]}|| j| v r(|| j| |<  nq|| jd |< d S )Nr   rs   )r{   r   r'   r(   r|   )r   r   rU   r   r+   r   r   r   Úps_store:  s   þzPSOperators.ps_storec                 C   s   |   ¡ }|  tdƒ¡ d S rœ   )r{   r‚   ro   ©r   r   r   r   r   Úps_whereD  s   zPSOperators.ps_wherec                 C   ó   |   t| jd ƒ¡ d S rœ   ©r‚   rf   r|   r   r   r   r   Úps_systemdictI  r”   zPSOperators.ps_systemdictc                 C   r§   ©Nr   r¨   r   r   r   r   Úps_userdictL  r”   zPSOperators.ps_userdictc                 C   r§   rz   r¨   r   r   r   r   Úps_currentdictO  r”   zPSOperators.ps_currentdictc                 C   s   |   t| jƒ¡ d S rw   )r‚   re   Ú	tokenizerr   r   r   r   Úps_currentfileR  s   zPSOperators.ps_currentfilec                 C   s   |   d¡j}| ¡  d S ©NÚfiletype)r{   r   Ú
starteexec©r   Úfr   r   r   Úps_eexecU  s   zPSOperators.ps_eexecc                 C   s    |   d¡j}| ¡  | ¡  d S r¯   )r{   r   Ú	skipwhiteÚ	stopeexecr²   r   r   r   Úps_closefileY  s   zPSOperators.ps_closefilec                 C   s,   |   ¡ }|| jkr|   ¡ }|| jks	d S d S rw   )r{   ri   r‘   r   r   r   Úps_cleartomark^  s   
ÿzPSOperators.ps_cleartomarkc                 C   sh   |   d¡}|j}|   d¡}|jjd |j_|j ||ƒ¡}||_|  |¡ |  |||ƒ||ƒkƒ¡ d S )NÚ
stringtyper°   r   )r{   r   ÚposÚreadr‚   )r   ro   r(   ÚsÚoldstrr³   Únewstrr   r   r   Úps_readstringc  s   


zPSOperators.ps_readstringc                 C   s.   |   ¡ }|   dd¡}|  t|j|jv ƒ¡ d S )NÚdicttypeÚfonttyper•   )r   rU   Údr   r   r   Úps_knowno  s   zPSOperators.ps_knownc                 C   s(   |   d¡}|   d¡jr|  |¡ d S d S ©Nr€   Úbooleantype©r{   r   r   rƒ   r   r   r   Úps_ift  s   
ÿzPSOperators.ps_ifc                 C   s<   |   d¡}|   d¡}|   d¡jr|  |¡ d S |  |¡ d S rÄ   rÆ   )r   Úproc2Úproc1r   r   r   Ú	ps_ifelsey  s
   

zPSOperators.ps_ifelsec                 C   ó&   |   ¡ }|jdk rd|_|  |¡ d S rª   ©r{   r   r‚   r‘   r   r   r   Úps_readonly  ó   
zPSOperators.ps_readonlyc                 C   rË   )Nr   rÌ   r‘   r   r   r   Úps_executeonly‡  rÎ   zPSOperators.ps_executeonlyc                 C   rË   )Nr   rÌ   r‘   r   r   r   Úps_noaccess  rÎ   zPSOperators.ps_noaccessc                 C   sB   |   dd¡}|jdkr|  t|j ƒ¡ d S |  t|j ƒ¡ d S )NrÅ   r    )r{   r   r‚   ro   r   ru   r‘   r   r   r   Úps_not“  s   
zPSOperators.ps_notc                 C   s   |   d¡}td|jƒ d S )Nr¹   zPS output --->)r{   Úprintr   )r   r)   r   r   r   Úps_printš  s   
zPSOperators.ps_printc                 C   s‚   |   d¡}|   d¡}t|jƒ}|jd |… |jkr3|  t|j|d … ƒ¡ |  |¡ |  tdƒ¡ d S |  |¡ |  tdƒ¡ d S )Nr¹   r   r   )r{   r(   r   r‚   rr   ro   )r   Úseekr¼   Úseeklenr   r   r   Úps_anchorsearchž  s   




zPSOperators.ps_anchorsearchc                 C   s(   |   d¡}td g|j ƒ}|  |¡ d S ©Nr    )r{   r6   r   r‚   )r   r¢   Úarrayr   r   r   r6   ª  s   
zPSOperators.ps_arrayc                 C   sB   |   d¡}tt|jƒd ddƒD ]	}|   ¡ |j|< q|  |¡ d S )NÚ	arraytyper   rs   )r{   r'   r(   r   r‚   )r   rØ   r+   r   r   r   Ú	ps_astore¯  s   
zPSOperators.ps_astorec                 C   s   |   ¡ }|  |  |j¡¡ d S rw   )r{   r‚   r‡   r   r¥   r   r   r   Úps_loadµ  s   zPSOperators.ps_loadc                 C   s    |   ¡ }|   ¡ }|   dddd¡}|j}|dks|dkr#||j|j< d S |dkr/||j|j< d S |dkrN|j}|jd |… t|jƒ |j|d d …  |_d S d S )NrÙ   rÀ   r¹   r€   r   )r{   r   r   Úchr)r   r‹   rŒ   Úobj3ÚtpÚindexr   r   r   Úps_put¹  s   0þzPSOperators.ps_putc                 C   s–   |   ¡ }|jdkr
	 |   ddddd¡}|j}|dv r%|  |j|j ¡ d S |dv r4|  |j|j ¡ d S |dkrG|  tt|j|j ƒƒ¡ d S J d
ƒ‚)Nr>   rÙ   rÀ   r¹   r€   rÁ   )rÙ   r€   )rÀ   rÁ   Fzshouldn't get here)r{   r   r   r‚   ru   Úord)r   r‹   rŒ   rÞ   r   r   r   Úps_getÆ  s   

ÿzPSOperators.ps_getc                 C   s†   |   d¡}|   d¡}|   dd¡}|j}|dkr*|  t|j|j|j|j … ƒ¡ d S |dkrA|  t|j|j|j|j … ƒ¡ d S d S )Nr    rÙ   r¹   )r{   r   r‚   r6   r   rr   )r   r‹   rŒ   rÝ   rÞ   r   r   r   Úps_getinterval×  s   

&&ÿzPSOperators.ps_getintervalc                 C   s    |   dd¡}|   d¡}|   dd¡}|j}|dkr)|j|j|j|jt|jƒ …< d S |dkrN|jd |j… }||j }||j|jt|jƒ d …  }||_d S d S )NrÙ   r¹   r    )r{   r   r   r(   )r   r‹   rŒ   rÝ   rÞ   r¾   r   r   r   Úps_putintervalá  s   
"

üzPSOperators.ps_putintervalc                 C   s   |   t|  d¡jƒ¡ d S )Nr¹   )r‚   r-   r{   r   r   r   r   r   Úps_cvnî  rn   zPSOperators.ps_cvnc                 C   s4   |   d¡j}|dk rtdƒ‚|  | jd|  ¡ d S )Nr    r   zindex may not be negativers   )r{   r   rŠ   r‚   r‰   )r   Únr   r   r   Úps_indexñ  s   zPSOperators.ps_indexc                 C   sš   |   d¡}|   dd¡j}|   dd¡j}|   dd¡j}	 |dkr&||kr%d S n||k r,d S t|ƒtdƒkr<|  t|ƒ¡ n|  t|ƒ¡ |  |¡ || }q)Nr€   r    Úrealtyper   r   g        )r{   r   r   r‚   rx   ru   r   )r   r„   ÚlimitÚ	incrementr+   r   r   r   Úps_for÷  s"   
ÿ
ôzPSOperators.ps_forc                 C   sÄ   |   d¡}|   ddd¡}|j}|dkr%|jD ]}|  |¡ |  |¡ qd S |dkr?|jD ]}|  tt|ƒƒ¡ |  |¡ q,d S |dkr^|j ¡ D ]\}}|  t|ƒ¡ |  |¡ |  |¡ qHd S d S )Nr€   rÙ   r¹   rÀ   )	r{   r   r   r‚   r   ru   rá   r\   r-   )r   r„   r}   rÞ   r:   rU   r   r   r   r   Ú	ps_forall
  s(   


þ
þ
üzPSOperators.ps_forallc                 C   s@   |   d¡}|   ¡ }t|jƒ}|| jd d j|j< |  |¡ d S )NrÀ   r   ÚFontDirectory)r{   r^   r   r|   r‚   )r   Úfontr   r   r   r   Úps_definefont  s
   

zPSOperators.ps_definefontc                 C   s,   |   ¡ }| jd d j|j }|  |¡ d S )Nr   rí   )r{   r|   r   r‚   )r   r   rî   r   r   r   Úps_findfont#  s   zPSOperators.ps_findfontc                 C   s   |   ¡  d S rw   )r{   r   r   r   r   Úps_pop(  s   zPSOperators.ps_popc                 C   s   |   d¡ |  ti ƒ¡ d S r×   )r{   r‚   rf   r   r   r   r   rf   +  s   
zPSOperators.ps_dictc                 C   s   | j  |  d¡j¡ d S )NrÀ   )r|   Úappendr{   r   r   r   r   r   Úps_begin/  r”   zPSOperators.ps_beginc                 C   s"   t | jƒdkr| jd= d S tdƒ‚)Nr   rs   zdictstack underflow)r(   r|   rŠ   r   r   r   r   Úps_end2  s   zPSOperators.ps_endN)6r   r   r   r~   r…   r   r   rŽ   r’   r“   r™   r›   r   rŸ   rr   r£   r¤   r¦   r©   r«   r¬   r®   r´   r·   r¸   ro   r(   r¿   rÃ   rÇ   rÊ   rÍ   rÏ   rÐ   rÑ   rÓ   rÖ   r6   rÚ   rÛ   rà   râ   rã   rä   rå   rç   rë   rì   rï   rð   rñ   rf   ró   rô   r   r   r   r   ry   ç   sd    

ry   rX   r   )ÚStandardEncodingN)r9   Úobjectr	   r   r!   r-   r1   r6   rb   Ú_type1_fontinfo_orderrd   rV   rT   rS   r^   re   rf   rg   rk   rm   ro   rr   ru   rx   ry   ÚnotdefÚ$fontTools.encodings.StandardEncodingrõ   ÚlistÚmapÚps_StandardEncodingr   r   r   r   Ú<module>   s:    

"  T