
    h                     F    S r SSKJr  SSKJrJr  S rS r " S S\5      rg)	z0ttLib.macUtils.py -- Various Mac-specific stuff.    )BytesIO)ResourceReaderResourceErrorc                      [        U 5      nUR                  S5      nUR                  5         U$ ! [         a    / s $ f = f)z;Determine whether a file has a 'sfnt' resource fork or not.sfnt)r   
getIndicescloser   )pathreaderindicess      J/var/www/html/env/lib/python3.13/site-packages/fontTools/ttLib/macUtils.pygetSFNTResIndicesr      sC    %##F+ 	s   -0 ??c                    SSK Jn  / n[        U 5      nU(       d"  UR                  UR	                  U 5      5        U$ U H#  nUR                  UR	                  X5      5        M%     U(       d  UR                  SU -  5      eU$ )zGiven 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      su      Ed#EU\\$'( L	 ELLd23 ""#@4#GHHL    c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )SFNTResourceReader&   z3Simple read-only file wrapper for 'sfnt' resources.c                 <  > SSK Jn  [        U5      n[        U[        5      (       a  UR                  SU5      nOUR                  SU5      nUc  UR                  SU-  5      eUR                  5         XPl	        [        [        U ]3  UR                  5        Xl        g )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%   SFNTResourceReader.__init__)   s    #%'--**63DED((1BCD<""#@CT#TUU	 $0;	r   )r'   r#   )__name__
__module____qualname____firstlineno____doc__r%   __static_attributes____classcell__)r*   s   @r   r   r   &   s    = r   r   N)	r0   ior   fontTools.misc.macResr   r   r   r   r    r   r   <module>r6      s$    6  ?( r   