Ë
    £ehÉ  ã                   óF   — d Z ddlmZ ddlmZmZ d„ Zd„ Z G d„ de«      Zy)	z0ttLib.macUtils.py -- Various Mac-specific stuff.é    )ÚBytesIO)ÚResourceReaderÚResourceErrorc                 ó‚   — 	 t        | «      }|j                  d«      }|j                  «        |S # t        $ r g cY S w xY w)z;Determine whether a file has a 'sfnt' resource fork or not.Úsfnt)r   Ú
getIndicesÚcloser   )ÚpathÚreaderÚindicess      úV/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/fontTools/ttLib/macUtils.pyÚgetSFNTResIndicesr      sC   € ðÜ Ó%ˆØ×#Ñ# FÓ+ˆØ�‰ŒØˆøÜò ØŠ	ðús   ‚-0 °>½>c                 óð   — ddl m} g }t        | «      }|s"|j                  |j	                  | «      «       |S |D ]#  }|j                  |j	                  | |«      «       Œ% |s|j                  d| z  «      ‚|S )a  Given a pathname, return a list of TTFont objects. In the case
    of a flat TTF/OTF file, the list will contain just one font object;
    but in the case of a Mac font suitcase it will contain as many
    font objects as there are sfnt resources in the file.
    r   ©ÚttLibzno fonts found in file '%s')Ú	fontToolsr   r   ÚappendÚTTFontÚ
TTLibError)r
   r   ÚfontsÚsfntsÚindexs        r   ÚopenTTFontsr      s|   € õ  à€EÜ˜dÓ#€EÙØ�‰�U—\‘\ $Ó'Ô(ð €Lð	 ò 	4ˆEØ�L‰L˜Ÿ™ d¨EÓ2Õ3ð	4áØ×"Ñ"Ð#@À4Ñ#GÓHÐHØ€Ló    c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚSFNTResourceReaderz3Simple read-only file wrapper for 'sfnt' resources.c                 ó4  •— ddl m} t        |«      }t        |t        «      r|j                  d|«      }n|j                  d|«      }|€|j                  d|z  «      ‚|j                  «        || _	        t        t        | �3  |j                  «       || _        y )Nr   r   r   zsfnt resource not found: %s)r   r   r   Ú
isinstanceÚstrÚgetNamedResourceÚgetIndResourcer   r	   ÚrsrcÚsuperr   Ú__init__ÚdataÚname)Úselfr
   Úres_name_or_indexr   r   r"   Ú	__class__s         €r   r$   zSFNTResourceReader.__init__)   s‰   ø€ Ý#ä Ó%ˆÜÐ'¬Ô-Ø×*Ñ*¨6Ð3DÓE‰Dà×(Ñ(¨Ð1BÓCˆDØˆ<Ø×"Ñ"Ð#@ÐCTÑ#TÓUÐUØ�‰ŒØˆŒ	ÜÔ  $Ñ0°·±Ô;Øˆ�	r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r$   Ú__classcell__)r)   s   @r   r   r   &   s   ø„ Ù=÷ð r   r   N)	r-   Úior   ÚfontTools.misc.macResr   r   r   r   r   © r   r   ú<module>r2      s$   ðÙ 6å ß ?òòô(˜õ r   