CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
FontFile.cpython-310.pyc38 linesDownload Raw Back to __pycache__
1o

2��Yi�@sPddlmZddlZddlmZddlmZmZdZdd
d�Z	Gdd�d�Z3dS)�)�annotationsN)�BinaryIO�)�Image�_binaryi �fpr�values�7tuple[int, int, int, int, int, int, int, int, int, int]�return�NonecCs.|D]}|dkr|d7}|�t�|��qdS)z0Write network order (big-endian) 16-bit sequenceriN)�writerZo16be)rr�v�r�vE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\PIL/FontFile.py�puti16s4�rc@sFeZdZUdZdZded<ddd�Zddd
�Zddd�Zddd�Z	dS)�FontFilez)Base class for raster font file handlers.NzImage.Image | None�bitmapr5rcCsi|_dgd|_dS)N�)�info�glyph)�selfrrr�__init__)s	�zFontFile.__init__�ix�int�`tuple[tuple[int, int], tuple[int, int, int, int], tuple[int, int, int, int], Image.Image] | NonecCs6|j|S)N)r)rrrrr�__getitem__5s7	zFontFile.__getitem__cCs�|jrdSd}}}d}|jD]4}|rD|\}}}}	t||d|d�}||d|d}|tkr?|d7}|d|d}t||�}q|}8||}|9dkrU|dkrUdS||_t�d|10|f�|_dgd|_d}}
td�D]Y}||}|r�|\}}}}	|d|d}||
}}||}|tkr�d|
|}}
||
}}|}|d||d||d||d|f}|j�	|	�11|�|�|||f|j|<qodS)zCreate metrics and bitmapNrr���1r)rr�max�WIDTH�ysizer�new�metrics�rangeZpaste�crop)r�h�wZmaxwidth�linesr�d�dst�srcZimZxsizer!�x�y�i�xxZx0Zy0�srrr�compile@sN1213��1415,��zFontFile.compile�filename�strcCs�|��|js
d}t|��|j�tj�|�ddd�ttj�|�ddd��C}|�d�|�d|j	�d	��16d17��|�d�td�D]}|j|}|sTt
|d
�qEt
||d|d|d�qEWd�dS1sowYdS)z	Save fontzNo bitmap createdrz.pbmZPNGz.pil�wbsPILfont18z;;;;;;z;19�asciisDATA20r)21rrrrrrrrrrrrN)r1r�22ValueError�save�os�path�splitext�openrr!�encoder$r#r)rr2�msgr�id�mrrrr7qs 232425 �"�z
FontFile.save)r26r)rrr27r)r2r3r28r)29�__name__�30__module__�__qualname__�__doc__r�__annotations__rrr1r7rrrrr$s313233341r)rrrr	r35r)�36__future__rr8�typingr�rrr rrrrrr�<module>s3738 
Aluode/PerceptionLabPortable · CoolFace