o
    ÕjT=  ã                   @   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Ú ÚreadonlyZexecuteonlyZ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   ú[/var/www/html/Deteccion_Ine/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   r/   7   ó    r/   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   r4   <   s    r4   )
ZFontInfoZFontNameÚEncodingZ	PaintTypeZFontTypeZ
FontMatrixZFontBBoxZUniqueIDZMetricsZStrokeWidth)	ÚversionZNoticeZFullNameZ
FamilyNameZWeightZItalicAngleZisFixedPitchZUnderlinePositionZUnderlineThickness)ZPrivateÚCharStringsZ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#   r<   z/%s %s def
r:   ú/%s %s %sdef
)r7   r   Ú_type1_CharString_reprr   Ú_type1_Encoding_reprr'   )Úkeyr   r(   r   r   r   r   Ú_type1_item_reprj   s   
þüÿrA   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   r?   {   s   
€r?   c                 C   s   t |  ¡ ƒ}dS )NZxxx)ÚsortedÚitems)ZcharstringsrF   r   r   r   r>   …   s   r>   c                   @   r3   )Ú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
ZcleartomarkÚ
)r&   r   Ú_type1_pre_eexec_orderÚKeyErrorrA   rE   rF   Ú_type1_post_eexec_order)r   r(   r@   r   rF   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__Nr9   r   r   r   r   rG   Š   s    rG   c                   @   s   e Zd ZdS )Úps_fileN)r   r   r   r   r   r   r   rM   ¬   s    rM   c                   @   r3   )Úps_dictc                 C   sb   dt | jƒ }t| j ¡ ƒ}|D ]\}}t|j }|r|d }|dt|ƒt|ƒ|f  }q|d S )NrH   r#   r=   zend )r&   r   rE   rF   r7   r   r'   )r   r(   rF   r@   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__Nr9   r   r   r   r   rN   °   s    
rN   c                   @   r.   )Ú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   rO   ¿   r2   rO   c                   @   r.   )Úps_procmarkc                 C   rP   )NZprocmarkr   r	   r
   r   r   r   r   r   Æ   r   zps_procmark.__init__NrR   r   r   r   r   rS   Å   r2   rS   c                   @   r.   )Úps_nullc                 C   s   | j jdd … d | _d S r   )r   r   r	   r   r   r   r   r   Ì   ó   zps_null.__init__NrR   r   r   r   r   rT   Ë   r2   rT   c                   @   r.   )Ú
ps_booleanc                 C   s   | j rdS dS )NÚtrueÚfalser0   r   r   r   r   r*   Ñ   s   zps_boolean.__str__Nr1   r   r   r   r   rV   Ð   r2   rV   c                   @   r.   )Ú	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__Nr1   r   r   r   r   rY   Ø   r2   rY   c                   @   r.   )Ú
ps_integerc                 C   ó
   t | jƒS ©Nr[   r   r   r   r   r*   Þ   r   zps_integer.__str__Nr1   r   r   r   r   r\   Ý   r2   r\   c                   @   r.   )Úps_realc                 C   r]   r^   r[   r   r   r   r   r*   ã   r   zps_real.__str__Nr1   r   r   r   r   r_   â   r2   r_   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 ©NrZ   )ÚpopÚ	dictstackr   )r   Úobjr   r   r   r   Úps_defè   s   zPSOperators.ps_defc                 C   s"   |   d¡}|  |¡ |  |¡ d S ©NÚproceduretype)rb   Ú	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 )Nrg   Zoperatortype)r%   r&   r   r	   rh   r   Úresolve_name)r   rk   r)   r8   rd   r   r   r   rh   ò   s   



€ôzPSOperators.proc_bindc                 C   s>   t | jƒdk rtdƒ‚|  ¡ }|  ¡ }|  |¡ |  |¡ d S )Nr   ústack underflow)r&   ÚstackÚRuntimeErrorrb   ri   )r   Úobj1Úobj2r   r   r   Úps_exch  s   
zPSOperators.ps_exchc                 C   s"   | j stdƒ‚|  | j d ¡ d S )Nrn   rZ   )ro   rp   ri   r   r   r   r   Úps_dup	  s   zPSOperators.ps_dupc                 C   s.   |   ¡ }|jdkr|  |¡ d S |  |¡ d S rf   )rb   r	   Úcall_procedureZhandle_object©r   rd   r   r   r   Úps_exec  s   
zPSOperators.ps_execc                 C   s   |   tt| jƒƒ¡ d S r^   )ri   r\   r&   ro   r   r   r   r   Úps_count  ó   zPSOperators.ps_countc                 C   s*   |   ¡ }|   ¡ }|  t|j|jkƒ¡ d S r^   ©rb   ri   rV   r   ©r   Zany1Zany2r   r   r   Úps_eq  ó   zPSOperators.ps_eqc                 C   s*   |   ¡ }|   ¡ }|  t|j|jkƒ¡ d S r^   rz   r{   r   r   r   Úps_ne  r}   zPSOperators.ps_nec                 C   s   |   ¡ }d|_|  |¡ d S ©Nr   )rb   r   ri   rv   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   )r_   r\   ri   r4   )r   Úmatrixr   r   r   Ú	ps_matrix'  s   úzPSOperators.ps_matrixc                 C   s"   |   d¡j}|  td| ƒ¡ d S )NÚintegertypeú )rb   r   ri   rY   )r   Únumr   r   r   rY   2  s   zPSOperators.ps_stringc                 C   s   |   ¡ }|  t|jƒ¡ d S r^   )rb   ri   rY   r	   rv   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   rZ   )rb   r   r%   r&   rc   )r   r   r@   r   r)   r   r   r   Úps_store:  s   þzPSOperators.ps_storec                 C   s   |   ¡ }|  tdƒ¡ d S r   )rb   ri   rV   ©r   r   r   r   r   Úps_whereD  s   zPSOperators.ps_wherec                 C   ó   |   t| jd ƒ¡ d S r   ©ri   rN   rc   r   r   r   r   Úps_systemdictI  ry   zPSOperators.ps_systemdictc                 C   rŠ   ©Nr   r‹   r   r   r   r   Úps_userdictL  ry   zPSOperators.ps_userdictc                 C   rŠ   ra   r‹   r   r   r   r   Úps_currentdictO  ry   zPSOperators.ps_currentdictc                 C   s   |   t| jƒ¡ d S r^   )ri   rM   Ú	tokenizerr   r   r   r   Úps_currentfileR  s   zPSOperators.ps_currentfilec                 C   s   |   d¡j}| ¡  d S ©NÚfiletype)rb   r   Z
starteexec©r   Úfr   r   r   Úps_eexecU  s   zPSOperators.ps_eexecc                 C   s    |   d¡j}| ¡  | ¡  d S r’   )rb   r   Z	skipwhiteZ	stopeexecr”   r   r   r   Úps_closefileY  s   zPSOperators.ps_closefilec                 C   s,   |   ¡ }|| jkr|   ¡ }|| jks	d S d S r^   )rb   rQ   rv   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   )rb   r   ÚposÚreadri   )r   rV   r&   ÚsZoldstrr•   Únewstrr   r   r   Úps_readstringc  s   


zPSOperators.ps_readstringc                 C   s.   |   ¡ }|   dd¡}|  t|j|jv ƒ¡ d S )NÚdicttypeÚfonttyperz   )r   r@   Údr   r   r   Úps_knowno  s   zPSOperators.ps_knownc                 C   s(   |   d¡}|   d¡jr|  |¡ d S d S ©Nrg   Úbooleantype©rb   r   ru   rj   r   r   r   Úps_ift  s   
ÿzPSOperators.ps_ifc                 C   s<   |   d¡}|   d¡}|   d¡jr|  |¡ d S |  |¡ d S r£   r¥   )r   Zproc2Zproc1r   r   r   Ú	ps_ifelsey  s
   

zPSOperators.ps_ifelsec                 C   ó&   |   ¡ }|jdk rd|_|  |¡ d S r   ©rb   r   ri   rv   r   r   r   Úps_readonly  ó   
zPSOperators.ps_readonlyc                 C   r¨   )Nr   r©   rv   r   r   r   Úps_executeonly‡  r«   zPSOperators.ps_executeonlyc                 C   r¨   )Nr   r©   rv   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ƒ   )rb   r	   ri   rV   r   r\   rv   r   r   r   Úps_not“  s   
zPSOperators.ps_notc                 C   s   |   d¡}td|jƒ d S )Nr™   zPS output --->)rb   Ú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   )rb   r&   r   ri   rY   rV   )r   Úseekrœ   Zseeklenr   r   r   Úps_anchorsearchž  s   




zPSOperators.ps_anchorsearchc                 C   s(   |   d¡}td g|j ƒ}|  |¡ d S ©Nrƒ   )rb   r4   r   ri   )r   r…   Úarrayr   r   r   r4   ª  s   
zPSOperators.ps_arrayc                 C   sB   |   d¡}tt|jƒd ddƒD ]	}|   ¡ |j|< q|  |¡ d S )NÚ	arraytyper   rZ   )rb   r%   r&   r   ri   )r   r´   r)   r   r   r   Ú	ps_astore¯  s   
zPSOperators.ps_astorec                 C   s   |   ¡ }|  |  |j¡¡ d S r^   )rb   ri   rm   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™   rg   r   )rb   r	   r   Úchr)r   rq   rr   Ú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™   rg   r    )rµ   rg   )rŸ   r    Fzshouldn't get here)rb   r   r	   ri   r\   Úord)r   rq   rr   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™   )rb   r	   ri   r4   r   rY   )r   rq   rr   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ƒ   )rb   r	   r   r&   )r   rq   rr   r¹   rº   r   r   r   r   Úps_putintervalá  s   
"

üzPSOperators.ps_putintervalc                 C   s   |   t|  d¡jƒ¡ d S )Nr™   )ri   r+   rb   r   r   r   r   r   Úps_cvnî  rU   zPSOperators.ps_cvnc                 C   s4   |   d¡j}|dk rtdƒ‚|  | jd|  ¡ d S )Nrƒ   r   zindex may not be negativerZ   )rb   r   rp   ri   ro   )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)Nrg   rƒ   Zrealtyper   r   g        )rb   r   r	   ri   r_   r\   ru   )r   rk   Ú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 )Nrg   rµ   r™   rŸ   )	rb   r	   r   ri   ru   r\   r½   rF   r+   )r   rk   rd   rº   r8   r@   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)rb   rG   r   rc   ri   )r   Úfontr   r   r   r   Úps_definefont  s
   

zPSOperators.ps_definefontc                 C   s,   |   ¡ }| jd d j|j }|  |¡ d S )Nr   rÈ   )rb   rc   r   ri   )r   r   rÉ   r   r   r   Úps_findfont#  s   zPSOperators.ps_findfontc                 C   s   |   ¡  d S r^   )rb   r   r   r   r   Úps_pop(  s   zPSOperators.ps_popc                 C   s   |   d¡ |  ti ƒ¡ d S r³   )rb   ri   rN   r   r   r   r   rN   +  s   
zPSOperators.ps_dictc                 C   s   | j  |  d¡j¡ d S )NrŸ   )rc   Úappendrb   r   r   r   r   r   Úps_begin/  ry   zPSOperators.ps_beginc                 C   s"   t | jƒdkr| jd= d S tdƒ‚)Nr   rZ   zdictstack underflow)r&   rc   rp   r   r   r   r   Úps_end2  s   zPSOperators.ps_endN)6r   r   r   re   rl   rh   rs   rt   rw   rx   r|   r~   r€   r‚   rY   r†   r‡   r‰   rŒ   rŽ   r   r‘   r–   r—   r˜   rV   r&   rž   r¢   r¦   r§   rª   r¬   r­   r®   r°   r²   r4   r¶   r·   r¼   r¾   r¿   rÀ   rÁ   rÃ   rÆ   rÇ   rÊ   rË   rÌ   rN   rÎ   rÏ   r   r   r   r   r`   ç   sd    

r`   rC   r   )ÚStandardEncodingN)r7   Úobjectr   r   r   r+   r/   r4   rJ   Z_type1_fontinfo_orderrL   rA   r?   r>   rG   rM   rN   rO   rS   rT   rV   rY   r\   r_   r`   ZnotdefZ$fontTools.encodings.StandardEncodingrÐ   ÚlistÚmapZps_StandardEncodingr   r   r   r   Ú<module>   s:    

"  T