a
    èÝEb
2  ã                   @   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   úZ/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/fontTools/misc/psOperators.pyÚ__init__
   s    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                   @   s    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      s    zps_operator.__repr__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d„ ZdS )Úps_procedurer   c                 C   s   dS )Nz<procedure>r   r   r   r   r   r      s    zps_procedure.__repr__c                 C   sN   d}t t| jƒƒD ]2}|r2|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 d S ©Nú/)r   r   r   r   r   r   r%   ,   s    
zps_name.__str__N)r   r   r   r   r%   r   r   r   r   r&   *   s   r&   c                   @   s   e Zd Zdd„ ZdS )Ú
ps_literalc                 C   s
   d| j  S r'   ©r   r   r   r   r   r%   3   s    zps_literal.__str__N©r   r   r   r%   r   r   r   r   r)   2   s   r)   c                   @   s   e Zd Zdd„ Zdd„ ZdS )Úps_arrayc                 C   sj   d}t t| jƒƒD ]N}| j| }t|j }|r6d| }|rP|d t|ƒ | }q|t|ƒ | }q|d S )Nú[r   ú])r    r!   r   Ú_accessstringsr   r"   )r   r#   r$   Úitemr   r   r   r   r%   7   s    

zps_array.__str__c                 C   s   dS )Nz<array>r   r   r   r   r   r   C   s    zps_array.__repr__N©r   r   r   r%   r   r   r   r   r   r,   6   s   r,   )
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   sp   d}t |j }|r|d }| dkr:|d| t|jƒf  }n2| dkrR|t||ƒ }n|dt| ƒt|ƒ|f  }|S )Nr   r   r4   z/%s %s def
r2   ú/%s %s %sdef
)r/   r   Ú_type1_CharString_reprr   Ú_type1_Encoding_reprr"   )Úkeyr   r#   r   r   r   r   Ú_type1_item_repre   s    
r9   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   r7   r   s    
r7   c                 C   s   t |  ¡ ƒ}dS )NZxxx)ÚsortedÚitems)Zcharstringsr>   r   r   r   r6   {   s    r6   c                   @   s   e Zd Zdd„ Zdd„ ZdS )Úps_fontc              	   C   sÔ   dt | jƒ }tD ]4}z| j| }W n ty6   Y q0 |t||ƒ }qt| j ¡ ƒ}|D ]"\}}|tt vrZ|t||ƒ }qZ|d }tD ]4}z| j| }W n ty®   Y qŠ0 |t||ƒ }qŠ|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ÚKeyErrorr9   r=   r>   Ú_type1_post_eexec_order)r   r#   r8   r   r>   r   r   r   r%   €   s2    ÿÿÿzps_font.__str__c                 C   s   dS )Nz<font>r   r   r   r   r   r   —   s    zps_font.__repr__Nr1   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                   @   s   e Zd Zdd„ Zdd„ ZdS )Úps_dictc                 C   sb   dt | jƒ }t| j ¡ ƒ}|D ]8\}}t|j }|r>|d }|dt|ƒt|ƒ|f  }q |d S )Nr@   r   r5   zend )r!   r   r=   r>   r/   r   r"   )r   r#   r>   r8   r   r   r   r   r   r%   ž   s    
zps_dict.__str__c                 C   s   dS )Nz<dict>r   r   r   r   r   r   §   s    zps_dict.__repr__Nr1   r   r   r   r   rF   �   s   	rF   c                   @   s   e Zd Zdd„ ZdS )Úps_markc                 C   s    d| _ | jjdd … d | _d S )NÚmarkr   r	   r
   r   r   r   r   r   «   s    zps_mark.__init__N©r   r   r   r   r   r   r   r   rG   ª   s   rG   c                   @   s   e Zd Zdd„ ZdS )Úps_procmarkc                 C   s    d| _ | jjdd … d | _d S )NZprocmarkr   r	   r
   r   r   r   r   r   °   s    zps_procmark.__init__NrI   r   r   r   r   rJ   ¯   s   rJ   c                   @   s   e Zd Zdd„ ZdS )Úps_nullc                 C   s   | j jdd … d | _d S r   )r   r   r	   r   r   r   r   r   µ   s    zps_null.__init__NrI   r   r   r   r   rK   ´   s   rK   c                   @   s   e Zd Zdd„ ZdS )Ú
ps_booleanc                 C   s   | j r
dS dS d S )NÚtrueÚfalser*   r   r   r   r   r%   ¹   s    zps_boolean.__str__Nr+   r   r   r   r   rL   ¸   s   rL   c                   @   s   e Zd Zdd„ ZdS )Ú	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__Nr+   r   r   r   r   rO   ¿   s   rO   c                   @   s   e Zd Zdd„ ZdS )Ú
ps_integerc                 C   s
   t | jƒS ©NrQ   r   r   r   r   r%   Ä   s    zps_integer.__str__Nr+   r   r   r   r   rR   Ã   s   rR   c                   @   s   e Zd Zdd„ ZdS )Úps_realc                 C   s
   t | jƒS rS   rQ   r   r   r   r   r%   È   s    zps_real.__str__Nr+   r   r   r   r   rT   Ç   s   rT   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 ©NrP   )ÚpopÚ	dictstackr   )r   Úobjr   r   r   r   Úps_defÎ   s    zPSOperators.ps_defc                 C   s"   |   d¡}|  |¡ |  |¡ d S ©NÚproceduretype)rW   Ú	proc_bindÚpush©r   Úprocr   r   r   Úps_bindÓ   s    

zPSOperators.ps_bindc                 C   sp   t t|jƒƒD ]\}|j| }|jdkr2|  |¡ q|jsz|  |j¡}W n   Y q0 |jdkr||j|< qd S )Nr\   Zoperatortype)r    r!   r   r	   r]   r   Úresolve_name)r   r`   r$   r0   rY   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ÚRuntimeErrorrW   r^   )r   Úobj1Úobj2r   r   r   Úps_exchç   s    
zPSOperators.ps_exchc                 C   s"   | j stdƒ‚|  | j d ¡ d S )Nrc   rP   )rd   re   r^   r   r   r   r   Úps_dupï   s    zPSOperators.ps_dupc                 C   s,   |   ¡ }|jdkr|  |¡ n
|  |¡ d S r[   )rW   r	   Úcall_procedureZhandle_object©r   rY   r   r   r   Úps_execô   s    
zPSOperators.ps_execc                 C   s   |   tt| jƒƒ¡ d S rS   )r^   rR   r!   rd   r   r   r   r   Úps_countû   s    zPSOperators.ps_countc                 C   s*   |   ¡ }|   ¡ }|  t|j|jkƒ¡ d S rS   ©rW   r^   rL   r   ©r   Zany1Zany2r   r   r   Úps_eqþ   s    zPSOperators.ps_eqc                 C   s*   |   ¡ }|   ¡ }|  t|j|jkƒ¡ d S rS   rn   ro   r   r   r   Úps_ne  s    zPSOperators.ps_nec                 C   s   |   ¡ }d|_|  |¡ d S ©Nr   )rW   r   r^   rk   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   )rT   rR   r^   r,   )r   Zmatrixr   r   r   Ú	ps_matrix  s    (zPSOperators.ps_matrixc                 C   s"   |   d¡j}|  td| ƒ¡ d S )NÚintegertypeú )rW   r   r^   rO   )r   Únumr   r   r   rO     s    zPSOperators.ps_stringc                 C   s   |   ¡ }|  t|jƒ¡ d S rS   )rW   r^   rO   r	   rk   r   r   r   Úps_type  s    zPSOperators.ps_typec                 C   sd   |   ¡ }|   ¡ }|j}tt| jƒd ddƒD ]$}|| j| v r,|| j| |<  qRq,|| jd |< d S )Nr   rP   )rW   r   r    r!   rX   )r   r   r8   r   r$   r   r   r   Úps_store  s    zPSOperators.ps_storec                 C   s   |   ¡ }|  tdƒ¡ d S rr   )rW   r^   rL   ©r   r   r   r   r   Úps_where#  s    zPSOperators.ps_wherec                 C   s   |   t| jd ƒ¡ d S rr   ©r^   rF   rX   r   r   r   r   Úps_systemdict(  s    zPSOperators.ps_systemdictc                 C   s   |   t| jd ƒ¡ d S ©Nr   r|   r   r   r   r   Úps_userdict+  s    zPSOperators.ps_userdictc                 C   s   |   t| jd ƒ¡ d S rV   r|   r   r   r   r   Úps_currentdict.  s    zPSOperators.ps_currentdictc                 C   s   |   t| jƒ¡ d S rS   )r^   rE   Ú	tokenizerr   r   r   r   Úps_currentfile1  s    zPSOperators.ps_currentfilec                 C   s   |   d¡j}| ¡  d S ©NÚfiletype)rW   r   Z
starteexec©r   Úfr   r   r   Úps_eexec4  s    zPSOperators.ps_eexecc                 C   s    |   d¡j}| ¡  | ¡  d S rƒ   )rW   r   Z	skipwhiteZ	stopeexecr…   r   r   r   Úps_closefile8  s    zPSOperators.ps_closefilec                 C   s    |   ¡ }|| jkr|   ¡ }qd S rS   )rW   rH   rk   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   )rW   r   ÚposÚreadr^   )r   rL   r!   ÚsZoldstrr†   Únewstrr   r   r   Úps_readstringB  s    


zPSOperators.ps_readstringc                 C   s.   |   ¡ }|   dd¡}|  t|j|jv ƒ¡ d S )NÚdicttypeÚfonttypern   )r   r8   Údr   r   r   Úps_knownP  s    zPSOperators.ps_knownc                 C   s$   |   d¡}|   d¡jr |  |¡ d S ©Nr\   Úbooleantype©rW   r   rj   r_   r   r   r   Úps_ifU  s    
zPSOperators.ps_ifc                 C   s:   |   d¡}|   d¡}|   d¡jr,|  |¡ n
|  |¡ d S r”   r–   )r   Zproc2Zproc1r   r   r   Ú	ps_ifelseZ  s
    

zPSOperators.ps_ifelsec                 C   s&   |   ¡ }|jdk rd|_|  |¡ d S r~   ©rW   r   r^   rk   r   r   r   Úps_readonlyb  s    
zPSOperators.ps_readonlyc                 C   s&   |   ¡ }|jdk rd|_|  |¡ d S )Nr   r™   rk   r   r   r   Úps_executeonlyh  s    
zPSOperators.ps_executeonlyc                 C   s&   |   ¡ }|jdk rd|_|  |¡ d S )Nr   r™   rk   r   r   r   Úps_noaccessn  s    
zPSOperators.ps_noaccessc                 C   s@   |   dd¡}|jdkr*|  t|j ƒ¡ n|  t|j ƒ¡ d S )Nr•   ru   )rW   r	   r^   rL   r   rR   rk   r   r   r   Úps_nott  s    
zPSOperators.ps_notc                 C   s   |   d¡}td|jƒ d S )NrŠ   zPS output --->)rW   Úprintr   )r   r"   r   r   r   Úps_print{  s    
zPSOperators.ps_printc                 C   s€   |   d¡}|   d¡}t|jƒ}|jd |… |jkrd|  t|j|d … ƒ¡ |  |¡ |  tdƒ¡ n|  |¡ |  tdƒ¡ d S )NrŠ   r   r   )rW   r!   r   r^   rO   rL   )r   Úseekr�   Zseeklenr   r   r   Úps_anchorsearch  s    




zPSOperators.ps_anchorsearchc                 C   s(   |   d¡}td g|j ƒ}|  |¡ d S ©Nru   )rW   r,   r   r^   )r   rw   Úarrayr   r   r   r,   ‹  s    
zPSOperators.ps_arrayc                 C   sB   |   d¡}tt|jƒd ddƒD ]}|   ¡ |j|< q |  |¡ d S )NÚ	arraytyper   rP   )rW   r    r!   r   r^   )r   r£   r$   r   r   r   Ú	ps_astore�  s    
zPSOperators.ps_astorec                 C   s   |   ¡ }|  |  |j¡¡ d S rS   )rW   r^   rb   r   rz   r   r   r   Úps_load–  s    zPSOperators.ps_loadc                 C   s˜   |   ¡ }|   ¡ }|   dddd¡}|j}|dks6|dkrD||j|j< nP|dkrZ||j|j< n:|dkr”|j}|jd |… t|jƒ |j|d d …  |_d S )Nr¤   r�   rŠ   r\   r   )rW   r	   r   Úchr)r   rf   rg   Úobj3ÚtpÚindexr   r   r   Úps_putš  s    zPSOperators.ps_putc                 C   s–   |   ¡ }|jdkr|   ddddd¡}|j}|dv rF|  |j|j ¡ nL|dv rb|  |j|j ¡ n0|dkr†|  tt|j|j ƒƒ¡ nd	s’J d
ƒ‚d S )Nr2   r¤   r�   rŠ   r\   r‘   )r¤   r\   )r�   r‘   Fzshouldn't get here)rW   r   r	   r^   rR   Úord)r   rf   rg   r©   r   r   r   Úps_get§  s    
zPSOperators.ps_getc                 C   s€   |   d¡}|   d¡}|   dd¡}|j}|dkrR|  t|j|j|j|j … ƒ¡ n*|dkr||  t|j|j|j|j … ƒ¡ d S )Nru   r¤   rŠ   )rW   r	   r^   r,   r   rO   )r   rf   rg   r¨   r©   r   r   r   Úps_getinterval¶  s    

$zPSOperators.ps_getintervalc                 C   sš   |   dd¡}|   d¡}|   dd¡}|j}|dkrP|j|j|j|jt|jƒ …< nF|dkr–|jd |j… }||j }||j|jt|jƒ d …  }||_d S )Nr¤   rŠ   ru   )rW   r	   r   r!   )r   rf   rg   r¨   r©   rŽ   r   r   r   Úps_putintervalÀ  s    
 
zPSOperators.ps_putintervalc                 C   s   |   t|  d¡jƒ¡ d S )NrŠ   )r^   r&   rW   r   r   r   r   r   Úps_cvnÍ  s    zPSOperators.ps_cvnc                 C   s4   |   d¡j}|dk rtdƒ‚|  | jd|  ¡ d S )Nru   r   zindex may not be negativerP   )rW   r   re   r^   rd   )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rH||krRq”n
||k rRq”t|ƒtdƒkrr|  t|ƒ¡ n|  t|ƒ¡ |  |¡ || }q4d S )Nr\   ru   Zrealtyper   g        )rW   r   r	   r^   rT   rR   rj   )r   r`   ÚlimitÚ	incrementr$   r   r   r   Úps_forÖ  s    

zPSOperators.ps_forc                 C   s¼   |   d¡}|   ddd¡}|j}|dkrH|jD ]}|  |¡ |  |¡ q,np|dkrz|jD ] }|  tt|ƒƒ¡ |  |¡ qVn>|dkr¸|j ¡ D ]*\}}|  t|ƒ¡ |  |¡ |  |¡ qŒd S )Nr\   r¤   rŠ   r�   )	rW   r	   r   r^   rj   rR   r¬   r>   r&   )r   r`   rY   r©   r0   r8   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)rW   r?   r   rX   r^   )r   Úfontr   r   r   r   Úps_definefontû  s
    

zPSOperators.ps_definefontc                 C   s,   |   ¡ }| jd d j|j }|  |¡ d S )Nr   r·   )rW   rX   r   r^   )r   r   r¸   r   r   r   Úps_findfont  s    zPSOperators.ps_findfontc                 C   s   |   ¡  d S rS   )rW   r   r   r   r   Úps_pop  s    zPSOperators.ps_popc                 C   s   |   d¡ |  ti ƒ¡ d S r¢   )rW   r^   rF   r   r   r   r   rF   
  s    
zPSOperators.ps_dictc                 C   s   | j  |  d¡j¡ d S )Nr�   )rX   ÚappendrW   r   r   r   r   r   Úps_begin  s    zPSOperators.ps_beginc                 C   s$   t | jƒdkr| jd= ntdƒ‚d S )Nr   rP   zdictstack underflow)r!   rX   re   r   r   r   r   Úps_end  s    
zPSOperators.ps_endN)6r   r   r   rZ   ra   r]   rh   ri   rl   rm   rp   rq   rs   rt   rO   rx   ry   r{   r}   r   r€   r‚   r‡   rˆ   r‰   rL   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»   rF   r½   r¾   r   r   r   r   rU   Ì   sf   
þ

rU   r;   r   )ÚStandardEncodingN)r/   Úobjectr   r   r   r&   r)   r,   rB   Z_type1_fontinfo_orderrD   r9   r7   r6   r?   rE   rF   rG   rJ   rK   rL   rO   rR   rT   rU   ZnotdefZ$fontTools.encodings.StandardEncodingr¿   ÚlistÚmapZps_StandardEncodingr   r   r   r   Ú<module>   s8   	  M