BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/local/lib64/python3.6/site-packages/PIL/__pycache__/PcfFontFile.cpython-36.pyc
3

Zƍh��@s�ddlZddlmZmZddlmZddlmZddlmZ	ddlm
ZddlmZ
d	ZdZdZdZdZdZdZd Zd!Zd"Zdd�dd�dd�dd�gZdd�ZGdd�dej�ZdS)#�N�)�FontFile�Image)�i8)�i16be)�i16le)�i32be)�i32leifcp�������cCs|dd?S)Nrr�)�bitsrr�;/usr/local/lib64/python3.6/site-packages/PIL/PcfFontFile.py�<lambda>,srcCs|dd?d@S)N�rr���r)rrrrr-scCs|dd?d@S)N�r���r)rrrrr.scCs|dd?d@S)N�?rri����r)rrrrr/scCs|||jd|��S)N�)�index)�s�orrr�sz3srcsNeZdZdZdZd�fdd�	Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)�PcfFontFilez(Font file plugin for the X11 PCF format.�name�	iso8859-1c	s.||_t|jd��}|tkr$td��t�j�t|jd��}i|_xLt|�D]@}t|jd��}t|jd��t|jd��t|jd��f|j|<qLW||_	|j
�|_|j�}|j
|�}|j�}	xntd�D]b}
|	|
}|dk	r�||\}}
}}}}}}|df|||
|||fdd||
f||f}||j|
<q�WdS)Nrznot a PCF file�r)�charset_encoding�l32�read�	PCF_MAGIC�SyntaxError�super�__init__�toc�range�fp�_load_properties�info�
_load_metrics�
_load_bitmaps�_load_encoding�glyph)�selfr,r#�magic�count�i�type�metrics�bitmaps�encoding�ch�ix�x�y�l�r�w�a�d�fr2)�	__class__rrr)<s*
2

,zPcfFontFile.__init__cCsX|j|\}}}|j}|j|�t|jd��}|d@rBtt}}n
tt}}||||fS)Nr)r*r,�seekr$r%�b16�b32�l16)r3�tag�format�size�offsetr,�i16�i32rrr�
_getformat^s

zPcfFontFile._getformatc
Cs�i}|jt�\}}}}||jd��}g}x>t|�D]2}|j||jd��t|jd��||jd��f�q2W|d@r�|jd|d@tj�|j||jd���}	x2|D]*\}
}}t	|	|
�}
|r�t	|	|�}|||
<q�W|S)Nrrr)
rP�PCF_PROPERTIESr%r+�appendrrF�io�SEEK_CURr)
r3Z
propertiesr,rKrNrOZnprops�pr6�data�kr�vrrrr-ns2

zPcfFontFile._load_propertiesc
Csdg}|jt�\}}}}|j}|d@dkr�x�t||jd���D]�}t|jd��d}t|jd��d}	t|jd��d}
t|jd��d}t|jd��d}|	|}
||}||
|||	|
||df�q<Wn�x�t||jd���D]�}||jd��}||jd��}	||jd��}
||jd��}||jd��}||jd��}|	|}
||}||
|||	|
|||f�q�W|S)Ni�r"r
r�rr)rP�PCF_METRICSrRr+r%r)r3r8r,rKrNrOrRr6�left�right�widthZascentZdescentZxsizeZysize�
attributesrrrr/�s0zPcfFontFile._load_metricsc
Cs:g}|jt�\}}}}||jd��}|t|�kr8td��g}x$t|�D]}	|j||jd���qFWg}
x$td�D]}	|
j||jd���qpW|d@}|d@}|
|}
|j|
�|j|
�}t|}d}|r�d}xht|�D]\}	||	\}}}}}}}}||	||	d}}|jtj	d||f|||�d|||���q�W|S)	NrzWrong number of bitmapsrrz1;R�1r�raw)
rP�PCF_BITMAPSr%�len�OSErrorr+rR�
BYTES_PER_ROWr�	frombytes)r3r8r9r,rKrNrOZnbitmaps�offsetsr6ZbitmapSizesZbitorderZpadindexZ
bitmapsizerV�pad�moder=r>r?r@rArBrCrD�b�errrr0�s2

.zPcfFontFile._load_bitmapscs�dgd}|jt�\�}�}��jd����jd��}}��jd����jd��}}��jd��||d||d}��fdd�t|�D�}	xZt|t|��D]H}
y.|	tt|
g�j|j��}|dkr�|||
<Wq�t	k
r�Yq�Xq�W|S)Nr"r
rcsg|]}��jd���qS)r
)r%)�.0�_)r,rNrr�
<listcomp>�sz.PcfFontFile._load_encoding.<locals>.<listcomp>i��)
rP�PCF_BDF_ENCODINGSr%r+rb�ord�	bytearray�decoder#�UnicodeDecodeError)r3r:rKrOZfirstColZlastColZfirstRowZlastRowZ	nencodingZencodingOffsetsr6ZencodingOffsetr)r,rNrr1�s 

zPcfFontFile._load_encoding)r!)�__name__�
__module__�__qualname__�__doc__r r)rPr-r/r0r1�
__classcell__rr)rErr7s"(+rrr
rr�� �@rYr")rS�rr�_binaryrrrGrrIrrHr	r$r&rQZPCF_ACCELERATORSrZraZPCF_INK_METRICSrnZPCF_SWIDTHSZPCF_GLYPH_NAMESZPCF_BDF_ACCELERATORSrdrrrrrr�<module>s,