
    hp                    J   S r SSKrSSKJr  SSKJr  SSKrSSKrSSKrSSKJ	r	  SSK
r
SSKr
SSKr
SSKr
SSKr
SSKr
SSKr
SSKr
SSKr
SSKJr  SSK7  SSKJr  SS	KJr  SS
KJr  SSKJrJr  / SQrSr \RB                  " \"5      r#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/ " S S\0\\Rb                  5      r2\Rf                  \2l3         " S S\Rb                  5      r4 " S S5      r5 " S  S!\55      r6 " S" S#\65      r7\7r8S$ r9S% r:S& r;S' r<S( r=S) r>\?" \@" SS*5      5      rA/ S+QrB\?" \@" SS,5      5      rC\?" \@" SS-5      5      rD/ S.QrE1 S/krF0 S0\G" \HS19_S2\G" \HS19_S3\G" \HS19_S4\G" \H\IS59_S6\G" \JS19_S7\G" \JS19_S8\G" \JS19_S9\G" \HS19_S:\G" \HS19_S;\G" \J\K4S19_S<\G" \J\K4S19_S=\G" \J\K4S19_S>\G" \J\K4S19_S?\G" \J\K4S19_S@\G" \K\J4S19_SA\G" \HS19_SB\G" \H\LS59_0 SC\G" \J\K4S19_SD\G" SE\M\ASF9_SG\G" \J\K4S19_SH\G" \J\K4S19_SI\G" \J\K4S19_SJ\G" \JS19_SK\G" \JS19_SL\G" \J\K4S19_SM\G" \HS19_SN\G" \HS19_SO\G" \HS19_SP\G" \HS19_SQ\G" \HS19_SR\G" \HS19_SS\G" \HS19_ST\G" \HS19_SU\G" \HS19_E0 SV\G" \HS19_SW\G" \HS19_SX\G" \HS19_SY\G" \HS19_SZ\G" \HS19_S[\G" \HS19_S\\G" \J\NS59_S]\G" \J\OS59_S^\G" SE\M\BSF9_S_\G" \HS19_S`\G" SE\PS59_Sa\G" SE\QS59_Sb\G" SE\M\CSF9_Sc\G" SE\M\DSF9_Sd\G" \J\K4S19_Se\G" \J\K4S19_Sf\G" \J\K4S19_E0 Sg\G" \J\K4S19_Sh\G" \J\K4S19_Si\G" SE\M\ESF9_Sj\G" \J\K4S19_Sk\G" \J\K4S19_Sl\G" \J\K4S19_Sm\G" \J\K4S19_Sn\G" \J\K4S19_So\G" \J\K4S19_Sp\G" \J\K4S19_Sq\G" \J\K4S19_Sr\G" \J\K4S19_Ss\G" \J\K4S19_St\G" \J\K4S19_Su\G" \J\K4S19_Sv\G" \J\K4S19_Sw\G" \JS19_E0 Sx\G" \JS19_Sy\G" \J\K4S19_Sz\G" \HS19_S{\G" \HS19_S|\G" \K\J4S19_S}\G" \JS19_S~\G" \J\K4S19_S\G" \J\K4S19_S\G" \RS19_S\G" SE\SS59_S\G" SE\TS59_S\G" SE\SS59_S\G" SE\TS59_S\G" SE\US59_S\G" SE\US59_S\G" \J\K4S19_S\G" \J\K4S19_E\G" \K\J4S19\G" \RS19\G" \J\K4S19\G" \J\K4S19\G" \HS19\G" \HS19\G" \J\VS59\G" \JS19\G" \HS19S.	ErW\X" \WR                  5       5      rZ\" \W5      r[\[R                  0 S7\G" \J\]S59_S;\G" \J\K4\^S59_SC\G" \J\^S59_SG\G" \JS19_SH\G" \JS19_SI\G" \JS19_SL\G" \JS19_S`\G" SE\_S59_Sd\G" \JS19_Se\G" \JS19_Sf\G" \JS19_Sg\G" \J\^S59_Sh\G" \J\^S59_Sj\G" \JS19_Sk\G" \JS19_Sl\G" \JS19_Sm\G" \JS19_0 Sn\G" \JS19_So\G" \JS19_Sp\G" \JS19_Sq\G" \JS19_Sr\G" \JS19_Ss\G" \JS19_S\G" S\`S59_S\G" S\aS59_St\G" \JS19_Su\G" \JS19_Sv\G" \JS19_Sy\G" \JS19_S\G" \J\]S59_S\G" \J\]S59_S\G" \G\bS59_S\G" \G\cS59_S\G" \G\dS59_E\G" \G\eS59\G" \G\fS59\G" \G\gS59\G" \G\hS59\G" \G\iS59\G" \?\jS59\G" \?\kS59S.E5        \X" \[R                  5       5      rl\?" \WR                  5       5       H  u  rnroS\o;  d  M  \p\oS'   M     \?" \[R                  5       5       H  u  rnroS\o;  d  M  \p\oS'   M     S rq0 SS3_SSM_SSN_SSO_SSP_SSQ_SSR_SSS_SST_SSU_SSV_SSW_SSX_SS_SS]_SS__SS}_SzSSSS|S{S4S\SS.	Err\q" \r5      rs\X" \rR                  5       5      rtSSSSS.ru\q" \u5      rvS\uS'   SSSSSSSSSS.	rw\q" \w5      rxS\wS'   S\wS'   S\wS'   S\wS'   0 SS_SS_SS_SS_S,S_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS*_SS_SS_SSSS.Ery\q" \y5      rzS r{S r|S r}S r~1 SkrS;1r1 SkrS rS rS rS r\"S:X  a  SSKr\GR                  " 5         gg)a  
A library for importing .ufo files and their descendants.
Refer to http://unifiedfontobject.org for the UFO specification.

The main interfaces are the :class:`.UFOReader` and :class:`.UFOWriter`
classes, which support versions 1, 2, and 3 of the UFO specification.

Set variables are available for external use that list the font
info attribute names for the `fontinfo.plist` formats. These are:

- :obj:`.fontInfoAttributesVersion1`
- :obj:`.fontInfoAttributesVersion2`
- :obj:`.fontInfoAttributesVersion3`

A set listing the `fontinfo.plist` attributes that were deprecated
in version 2 is available for external use:

- :obj:`.deprecatedFontInfoAttributesVersion2`

Functions that do basic validation on values for `fontinfo.plist`
are available for external use. These are

- :func:`.validateFontInfoVersion2ValueForAttribute`
- :func:`.validateFontInfoVersion3ValueForAttribute`

Value conversion functions are available for converting
`fontinfo.plist` values between the possible format versions.

- :func:`.convertFontInfoValueForAttributeFromVersion1ToVersion2`
- :func:`.convertFontInfoValueForAttributeFromVersion2ToVersion1`
- :func:`.convertFontInfoValueForAttributeFromVersion2ToVersion3`
- :func:`.convertFontInfoValueForAttributeFromVersion3ToVersion2`
    N)deepcopy)fsdecode)OrderedDict)plistlib)*)userNameToFileName)%convertUFO1OrUFO2KerningToUFO3Kerning)UFOLibError)numberTypes_VersionTupleEnumMixin)makeUFOPathr
   	UFOReader	UFOWriterUFOReaderWriterUFOFileStructurefontInfoAttributesVersion1fontInfoAttributesVersion2fontInfoAttributesVersion3$deprecatedFontInfoAttributesVersion2)validateFontInfoVersion2ValueForAttribute)validateFontInfoVersion3ValueForAttribute6convertFontInfoValueForAttributeFromVersion1ToVersion26convertFontInfoValueForAttributeFromVersion2ToVersion1z3.0.0glyphsdataimageszmetainfo.plistzfontinfo.plistz	lib.plistzgroups.plistzkerning.plistzfeatures.feazlayercontents.plistzlayerinfo.plistzpublic.defaultc                        \ rS rSrSrSrSrSrg)UFOFormatVersiond   )   r   )   r   )   r    N)__name__
__module____qualname____firstlineno__
FORMAT_1_0
FORMAT_2_0
FORMAT_3_0__static_attributes__r#       K/var/www/html/env/lib/python3.13/site-packages/fontTools/ufoLib/__init__.pyr   r   d   s    JJJr,   r   c                       \ rS rSrSrSrSrg)r   p   zippackager#   N)r$   r%   r&   r'   ZIPPACKAGEr+   r#   r,   r-   r   r   p   s    
CGr,   r   c                   *    \ rS rSrS rSS jrS rSrg)
_UFOBaseIOz   c                      U R                   R                  [        U5      S/S9R                  nUR	                  5       $ ! [         R
                  R                  [         R
                  R                  4 a     gf = f)z
Returns the modification time for the file at the given path, as a
floating point number giving the number of seconds since the epoch.
The path must be relative to the UFO path.
Returns None if the file does not exist.
details)
namespacesN)fsgetinfor   modified	timestamperrorsMissingInfoNamespaceResourceNotFound)selfpathdts      r-   getFileModificationTime"_UFOBaseIO.getFileModificationTime{   sd    	"$YKHQQB <<>! 		..		0J0JK 		s   .A   8A;:A;Nc           	          U R                   R                  US5       n[        R                  " U5      sSSS5        $ ! , (       d  f       g= f! [         R                  R
                   a&    Uc  [        SU< SU R                   < S35      eUs $ [         a#  n[        SU SU R                    SU 35      eSnAff = f)a^  
Read a property list relative to the UFO filesystem's root.
Raises UFOLibError if the file is missing and default is None,
otherwise default is returned.

The errors that could be raised during the reading of a plist are
unpredictable and/or too large to list, so, a blind try: except:
is done. If an exception occurs, a UFOLibError will be raised.
rbN'z' is missing on z. This file is requiredz' could not be read on : )r:   openr   loadr>   r@   r
   	Exception)rA   fileNamedefaultfes        r-   	_getPlist_UFOBaseIO._getPlist   s    	Sh-}}Q' .--yy)) 	!FNPTPWPWX   	S(+B477)2aSQRR	Ss8   A >	A 
AA A AB>	B>B99B>c           
      n   U R                   (       ar   [        R                  " U5      nU R
                  R                  U5      (       a  X0R
                  R                  U5      :X  a  gU R
                  R                  X5        gU R
                  R                  USS9 n [        R                  " X%5         SSS5        g! [         a&  n[	        SU< SU R
                  < SU< 35      eSnAff = f! [         a&  n[	        SU< SU R
                  < SU< 35      eSnAff = f! , (       d  f       g= f)a;  
Write a property list to a file relative to the UFO filesystem's root.

Do this sort of atomically, making it harder to corrupt existing files,
for example when plistlib encounters an error halfway during write.
This also checks to see if text matches the text that is already in the
file at path. If so, the file is not rewritten so that the modification
date is preserved.

The errors that could be raised during the writing of a plist are
unpredictable and/or too large to list, so, a blind try: except: is done.
If an exception occurs, a UFOLibError will be raised.
rH   z' could not be written on z- because the data is not properly formatted: Nw)mode)_havePreviousFiler   dumpsrL   r
   r:   exists	readbytes
writebytesopenbindump)rA   rM   objr   rP   fps         r-   _writePlist_UFOBaseIO._writePlist   s     !!~~c* ww~~h''DGG4E4Eh4O,OGGx.4MM#* 54  !@H$''STV  ! % $TWWa1  54sA   C  D& C3 
C0
!C++C03
D#=!DD##D&&
D4r#   N)r$   r%   r&   r'   rD   rQ   r_   r+   r#   r,   r-   r5   r5   z   s    "S0"r,   r5   c                   B   \ rS rSrSrS(S jrS r\" \SS9rS r	\" \	SS9r
\S	 5       rS
 r\" \SS9rS rS rS)S jrS)S jrS)S jrS rS)S jrS)S jrS rS)S jrS rS)S jrS)S jrS rS rS)S jrS)S jrS*S jrS+S jr S  r!S)S! jr"S" r#S)S# jr$S$ r%S% r&S& r'S'r(g),r      a+  Read the various components of a .ufo.

Attributes:
    path: An `os.PathLike` object pointing to the .ufo.
    validate: A boolean indicating if the data read should be
      validated. Defaults to `True`.

By default read data is validated. Set ``validate`` to
``False`` to not validate the data.
c                    [        US5      (       a  UR                  5       n[        U[        5      (       Ga-  [	        U5      n U[
        R                  L a   [        R                  R                  USSS9nO [        R                  R                  U5      n U[
        R                  L a  UR                  S5       Vs/ s H4  nUR                   (       d  M  UR"                  S:w  d  M(  UR"                  PM6     nn[%        U5      S	:X  a1  UR'                  US
   [        R(                  R*                  S9U l        O[        S[%        U5      -  5      eX@l        SU l        X0l        O[        U[        R0                  R2                  5      (       aH  Un UR5                  5         Xl         UR9                  S5      nSU l        [
        R<                  U l        O![?        S[A        U5      RB                  -  5      e[E        U5      U l#        X l$        S U l%         U RM                  US9  g ! [        R                  R                   a  n[        SU SU 35      eS nAff = fs  snf ! [        R                  R6                   a    [        SU-  5      ef = f! [        R                  R:                   a    [        U5      n GNf = f! [         a    U RO                  5         e f = f)N
__fspath__Futf-8writeencodingunable to open 'z': /__MACOSXr    r   factory+Expected exactly 1 root directory, found %dTthe filesystem '%s' is closedz7Expected a path string or fs.base.FS object, found '%s'validate)(hasattrre   
isinstancestr_sniffFileStructurer   r2   r:   zipfsZipFSosfsOSFSr>   CreateFailedr
   scandiris_dirnamelenopendirsubfsClosingSubFS_shouldClose_fileStructurebaseFScheckFilesystemClosed
getsyspath	NoSysPathr3   	TypeErrortyper$   r   _path	_validate_upConvertedKerningDatareadMetaInfoclose)	rA   rB   rr   	structureparentFSrP   prootDirs
filesystems	            r-   __init__UFOReader.__init__   s   4&&??$DdC  +D1IC 0 4 44!xx~~d%'~RH!ww||D1H ,000
 &--c22xx  %&FFj$8 AFF2   x=A% '.. RXX-B-B / DG &EHU 
 # !%D"+bggjj))J%  " %'!,,S1 !&D"2":":DIt*%%&  d^
!'+$	x0s 99)) C!$4TF#aS"ABBC6 99-- J!"AD"HIIJ 99&& ':'&  	JJL	sZ   2H% 7H% =II(II! (J K %III!-J)J>=J>Kc                 L    SS K nUR                  S[        SS9  U R                  $ )Nr   zBThe 'path' attribute is deprecated; use the 'fs' attribute insteadr!   
stacklevel)warningswarnDeprecationWarningr   rA   r   s     r-   	_get_pathUFOReader._get_path"  s+    P 	 	

 zzr,   z!The path of the UFO (DEPRECATED).docc                 `    SS K nUR                  S[        SS9  U R                  R                  $ )Nr   zIThe 'formatVersion' attribute is deprecated; use the 'formatVersionTuple'r!   r   )r   r   r   _formatVersionmajorr   s     r-   _get_formatVersionUFOReader._get_formatVersion.  s3    W 	 	

 ""(((r,   zIThe (major) format version of the UFO. DEPRECATED: Use formatVersionTuplec                     U R                   $ )zlThe (major, minor) format version of the UFO.
This is determined by reading metainfo.plist during __init__.
)r   rA   s    r-   formatVersionTupleUFOReader.formatVersionTuple=  s    
 """r,   c                     U R                   $ ra   )r   r   s    r-   _get_fileStructureUFOReader._get_fileStructureD  s    """r,   zVThe file structure of the UFO: either UFOFileStructure.ZIP or UFOFileStructure.PACKAGEc                 f   U R                   (       a[  U R                  5       nX R                   S   :w  a  [        S5      eU R                  5       nX0R                   S   :w  a  [        S5      eg
U R                  5       nU(       a  Sn[	        U[
        5      (       d  [        U5      eUR                  5        Hn  u  pg[	        U[        5      (       d  [        U5      e[	        U[        5      (       d  [        U5      eU H#  n[	        U[        5      (       a  M  [        U5      e   Mp     [        0 U R                  5       0 US9U l         [        U R                   S   [        U R                   S   5      U R                  5       5      u  pn
XR                   S'   X@R                   S'   XR                   S	'   g
)a8  
Up convert kerning and groups in UFO 1 and 2.
The data will be held internally until each bit of data
has been retrieved. The conversion of both must be done
at once, so the raw data is cached and an error is raised
if one bit of data becomes obsolete before it is called.

``validate`` will validate the data.
originalKerningzSThe data in kerning.plist has been modified since it was converted to UFO 3 format.originalGroupszRThe data in groups.plist has been modified since it was converted to UFO 3 format.z'groups.plist is not properly formatted.)kerningr   groupsr   r   r   groupRenameMapsN)r   _readKerningr
   _readGroupsrt   dictitemsru   listr	   r   getGlyphSet)rA   rr   testKerning
testGroupsr   invalidFormatMessage	groupName	glyphList	glyphNamer   conversionMapss              r-   _upConvertKerningUFOReader._upConvertKerningQ  s    ''++-K::;LMM!i  ))+J99:JKK!h  L
 %%'F'P$!&$//%&:;;,2LLN(I%i55)*>??'	488)*>??%.	))S99"-.B"CC &/ -; ,0 $ 1 1 3%	,D( /T,,->?556FGH  "/+G^ 7>((35;((2>L(():;r,   c                      U R                   R                  [        U5      5      $ ! [         R                  R                   a     gf = f)z
Returns the bytes in the file at the given path.
The path must be relative to the UFO's filesystem root.
Returns None if the file does not exist.
N)r:   rY   r   r>   r@   )rA   rB   s     r-   readBytesFromPathUFOReader.readBytesFromPath  s<    	77$$Xd^44yy)) 		s   #& AANc                     [        U5      n Uc  U R                  R                  U5      $ U R                  R                  USUS9$ ! [        R                  R
                   a     gf = f)aV  
Returns a file (or file-like) object for the file at the given path.
The path must be relative to the UFO path.
Returns None if the file does not exist.
By default the file is opened in binary mode (reads bytes).
If encoding is passed, the file is opened in text mode (reads str).

Note: The caller is responsible for closing the open file.
NrrU   ri   )r   r:   r[   rJ   r>   r@   )rA   rB   ri   s      r-   getReadFileForPathUFOReader.getReadFileForPath  s`     ~	wwt,,ww||DsX|FFyy)) 		s   A A A'&A'c           	      0   Uc  U R                   nU R                  [        5      nU(       a   [        U[        5      (       d  [        S5      e US   nUR                  SS5      n [        X445      nXRS'   U$ ! [         a     [        S[         SU R                   35      ef = f! [         ag  nSU S	U S
[         SU R                   3nU(       a  SSKJn  U" U5      Ue[        R                  5       n[        R                  SUU5         SnANSnAff = f)z
Read metainfo.plist and return raw data. Only used for internal operations.

``validate`` will validate the read data, by default it is set
to the class's validate value, can be overridden.
Nz)metainfo.plist is not properly formatted.formatVersionz#Missing required formatVersion in '' on formatVersionMinorr   zUnsupported UFO format (.z) in 'UnsupportedUFOFormatz^%s. Assuming the latest supported version (%s). Some data may be skipped or parsed incorrectlyr   )r   rQ   METAINFO_FILENAMErt   r   r
   KeyErrorr:   
setdefaultr   
ValueErrorfontTools.ufoLib.errorsr   rN   loggerwarning)	rA   rr   r   formatVersionMajorr   r   rP   unsupportedMsgr   s	            r-   _readMetaInfoUFOReader._readMetaInfo  s:    ~~H~~/0JtT22IJJ	!%o!6
 "__-A1E	,.@-UVM$ &3!"5  	56G5HdggYW 	  	*+=*>a@R?S T()twwi9  H*>:A,446MNNA	 	s%   A7 %B$ 7*B!$
D.ADDc                 6    U R                  US9nUS   U l        g)z
Read metainfo.plist and set formatVersion. Only used for internal operations.

``validate`` will validate the read data, by default it is set
to the class's validate value, can be overridden.
rq   r   N)r   r   rA   rr   r   s      r-   r   UFOReader.readMetaInfo  s%     !!8!4"#78r,   c                     U R                  [        0 5      nUR                  5        H>  u  p#UR                  S5      (       d  M  [	        [
        R                  " U5      5      X'   M@     U$ )N)zpublic.kern1.zpublic.kern2.)rQ   GROUPS_FILENAMEr   
startswithr   r   fromkeys)rA   r   r   r   s       r-   r   UFOReader._readGroups  sV    4$*LLN I##$FGG$()=)=i)H$I! %3 r,   c                    Uc  U R                   nU R                  [        R                  :  a!  U R	                  U5        U R
                  S   nOU R                  5       nU(       a  [        U5      u  p4U(       d  [        U5      eU$ )z
Read groups.plist. Returns a dict.
``validate`` will validate the read data, by default it is set to the
class's validate value, can be overridden.
r   )	r   r   r   r*   r   r   r   groupsValidatorr
   )rA   rr   r   validmessages        r-   
readGroupsUFOReader.readGroups  sx     ~~H!1!<!<<""8,11(;F %%'F,V4NE!'**r,   c                     Uc  U R                   nU R                  [        R                  :  a
  [	        0 0 S9$ U R                  US9  U R                  S   $ )a  
Get maps defining the renaming that was done during any
needed kerning group conversion. This method returns a
dictionary of this form::

        {
                "side1" : {"old group name" : "new group name"},
                "side2" : {"old group name" : "new group name"}
        }

When no conversion has been performed, the side1 and side2
dictionaries will be empty.

``validate`` will validate the groups, by default it is set to the
class's validate value, can be overridden.
side1side2rq   r   )r   r   r   r*   r   r   r   )rA   rr   s     r-   #getKerningGroupConversionRenameMaps-UFOReader.getKerningGroupConversionRenameMaps  sW    " ~~H"2"="==b++ 	*++,=>>r,   c                     U R                  [        0 5      nU(       a   [        U[        5      (       d  [	        S5      eU$ )Nz)fontinfo.plist is not properly formatted.)rQ   FONTINFO_FILENAMErt   r   r
   r   s      r-   	_readInfoUFOReader._readInfo  s3    ~~/4JtT22IJJr,   c                    Uc  U R                   nU R                  U5      n0 nU R                  [        R                  :X  a>  [
         H  nUR                  U5      nUc  M  XdU'   M     [        U5      n[        U5      nOU R                  [        R                  :X  aL  [        [        R                  5       5       H  u  pWUR                  U5      nUc  M  XdU'   M!     [        U5      nOU R                  R                  [        R                  R                  :X  aA  [        [        R                  5       5       H  u  pWUR                  U5      nUc  M  XdU'   M!     O[!        U R                  5      eU(       a  [#        U5      n[        UR                  5       5       H  u  pV [%        XU5        M     g! [&         a    [)        SU-  5      ef = f)aD  
Read fontinfo.plist. It requires an object that allows
setting attributes with names that follow the fontinfo.plist
version 3 specification. This will write the attributes
defined in the file into the object.

``validate`` will validate the read data, by default it is set to the
class's validate value, can be overridden.
NzMThe supplied info object does not support setting a necessary attribute (%s).)r   r   r   r   r(   r   get&_convertFontInfoDataVersion1ToVersion2&_convertFontInfoDataVersion2ToVersion3r)   r   #fontInfoAttributesVersion2ValueDatar   r   r*   #fontInfoAttributesVersion3ValueDataNotImplementedErrorvalidateInfoVersion3DatasetattrAttributeErrorr
   )rA   inforr   infoDictinfoDataToSetattrvaluedataValidationDicts           r-   readInfoUFOReader.readInfo  s    ~~H>>(+"2"="==2 T*$*/$' 3 C=QMB=QM  $4$?$??,0399;-( !T*=&+d#- C=QM  &&*:*E*E*K*KK,0399;-( !T*=&+d#- &d&9&9::4]CM 3 3 56KDE* 7 " !c s   "F33Gc                 2    U R                  [        0 5      nU$ ra   )rQ   KERNING_FILENAME)rA   r   s     r-   r   UFOReader._readKerningW  s    ~~.3r,   c                 R   Uc  U R                   nU R                  [        R                  :  a!  U R	                  U5        U R
                  S   nOU R                  5       nU(       a  [        U5      u  p4U(       d  [        U5      e0 nU H  nX&    H  nX&   U   nXXg4'   M     M     U$ )z
Read kerning.plist. Returns a dict.

``validate`` will validate the kerning data, by default it is set to the
class's validate value, can be overridden.
r   )	r   r   r   r*   r   r   r   kerningValidatorr
   )	rA   rr   kerningNestedr   r   r   leftrightr  s	            r-   readKerningUFOReader.readKerning[  s     ~~H!1!<!<<""8, 88CM !--/M-m<NE!'**!D&,%+E2',$ - " r,   c                     Uc  U R                   nU R                  [        0 5      nU(       a  [        U5      u  p4U(       d  [	        U5      eU$ )z
Read lib.plist. Returns a dict.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
)r   rQ   LIB_FILENAMEfontLibValidatorr
   )rA   rr   r   r   r   s        r-   readLibUFOReader.readLiby  sE     ~~H~~lB/-d3NE!'**r,   c                      U R                   R                  [        SSS9 nUR                  5       sSSS5        $ ! , (       d  f       g= f! [         R                  R
                   a     gf = f)zZ
Read features.fea. Return a string.
The returned string is empty if the file is missing.
r   rf   ri   N )r:   rJ   FEATURES_FILENAMEreadr>   r@   )rA   rO   s     r-   readFeaturesUFOReader.readFeatures  sQ    
	/wG1vvx HGGyy)) 		s+   A ;	A 
A	A 	A A-,A-c                     U R                   [        R                  :  a  [        [        4/$ U R                  [        5      nU(       a)  [        X R                  5      u  p4U(       d  [        U5      eU$ )z
Rebuild the layer contents list by checking what glyphsets
are available on disk.

``validate`` will validate the layer contents.
)
r   r   r*   DEFAULT_LAYER_NAMEDEFAULT_GLYPHS_DIRNAMErQ   LAYERCONTENTS_FILENAMElayerContentsValidatorr:   r
   )rA   rr   contentsr   errors        r-   _readLayerContentsUFOReader._readLayerContents  s]     !1!<!<<')?@AA>>"891(GGDLE!%((r,   c                 ~    Uc  U R                   nU R                  U5      nU VVs/ s H  u  p4UPM	     nnnU$ s  snnf )z
Get the ordered layer names from layercontents.plist.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
)r   r&  )rA   rr   layerContents	layerNamedirectoryName
layerNamess         r-   getLayerNamesUFOReader.getLayerNames  sF     ~~H//9@MN$<Ii
N Os   9c                     Uc  U R                   nU R                  U5      nU H  u  p4U[        :X  d  M  Us  $    [        S5      e)z
Get the default layer name from layercontents.plist.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
z8The default layer is not defined in layercontents.plist.)r   r&  r!  r
   )rA   rr   r)  r*  layerDirectorys        r-   getDefaultLayerNameUFOReader.getDefaultLayerName  sM     ~~H//9)6%I!77   *7 TUUr,   c                    SSK Jn  Uc  U R                  nUc  U R                  nUc  U R                  US9nSnU R	                  U5      nU H  u  pxX:X  d  M  Un  O   Uc  [        SU-  5      e U R                  R                  U5      n	U" U	U R                  UUS	S
9$ ! [        R                  R                   a    [        SU SU S35      ef = f)a  
Return the GlyphSet associated with the
glyphs directory mapped to layerName
in the UFO. If layerName is not provided,
the name retrieved with getDefaultLayerName
will be used.

``validateRead`` will validate the read data, by default it is set to the
class's validate value, can be overridden.
``validateWrite`` will validate the written data, by default it is set to the
class's validate value, can be overridden.
r   GlyphSetNrq   z&No glyphs directory is mapped to "%s".zNo 'z' directory for layer 'rH   T)ufoFormatVersionvalidateReadvalidateWriteexpectContentsFile)fontTools.ufoLib.glifLibr5  r   r1  r&  r
   r:   r   r>   r@   r   )
rA   r*  r7  r8  r5  	directoryr)  storedLayerNamestoredLayerDirectory
glyphSubFSs
             r-   r   UFOReader.getGlyphSet  s     	6>>L  NNM00,0GI	//=5B1O+0	 6C FRSS	U3J !00%'#
 	
 yy)) 	UYK/FykQRSTT	Us   0B 1Cc                     Uc  U R                   nU R                  XSS9nUR                  5       n0 nUR                  5        H-  u  pgU H"  nX;   a  XX   R	                  U5        M  U/XX'   M$     M/     U$ )zN
Return a dictionary that maps unicode values (ints) to
lists of glyph names.
T)r7  r8  )r   r   getUnicodesr   append)	rA   r*  rr   glyphSetallUnicodescmapr   unicodescodes	            r-   getCharacterMappingUFOReader.getCharacterMapping  s    
 ~~H##D $ 
 **,#.#4#4#6I <J%%i0"+DJ	 ! $7 r,   c                     U R                   R                  [        5      U l         U R                  R                  R                  5        Vs/ s H  oR                  S5      PM     sn$ ! [         R                  R
                   a    / s $ [         R                  R                   a    [        S5      ef = fs  snf ! [         R                  R                   a    / s $ f = f)z
Returns a list of all files in the data directory.
The returned paths will be relative to the UFO.
This will not list directory names, only file names.
Thus, empty directories will be skipped.
z6The UFO contains a "data" file instead of a directory.rk   )r:   r   DATA_DIRNAME_dataFSr>   r@   DirectoryExpectedr
   walkfileslstripResourceError)rA   r   s     r-   getDataDirectoryListing!UFOReader.getDataDirectoryListing  s    	X77??<8DL
	 ,0<<+<+<+B+B+DE+DaHHSM+DEE yy)) 	Iyy** 	XVWW	X Fyy&& 	I	s4   $A* &B= B8'B= * B5)B58B= = C C c                    U R                   [        R                  :  a  / $ Uc  U R                  n U R                  R                  [        5      =U l        n/ nUR                  S5       H  nUR                  (       a  M  U(       aU  UR                  UR                  5       n[!        US9u  pgSSS5        W(       a  UR#                  UR                  5        Mp  Mr  UR#                  UR                  5        M     U$ ! [        R                  R                   a    / s $ [        R                  R                   a    [        S5      ef = f! , (       d  f       N= f)z
Returns a list of all image file names in
the images directory. Each of the images will
have been verified to have the PNG signature.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
Nz9The UFO contains an "images" file instead of a directory.rk   )fileObj)r   r   r*   r   r:   r   IMAGES_DIRNAME	_imagesFSr>   r@   rM  r
   r|   r}   r[   r~   pngValidatorrB  )rA   rr   imagesFSresultrB   r^   r   r%  s           r-   getImageDirectoryListing"UFOReader.getImageDirectoryListing  s    !1!<!<<I~~H	(,(GGDNX $$S)D{{ %%dii0B#/#;LE 1MM$)),  dii( * ' yy)) 	Iyy** 	K 	 10s   &C= "E= E)E
E	c                 2   [        U5      n  U R                  nUR                  U5      nU$ ! [         a"    U R                  R	                  [
        5      n N>f = f! [        R                  R                   a    [        SU SU R                   35      ef = f)zJ
Return bytes for the file named 'fileName' inside the 'data/' directory.
zNo data file named 'r   )
r   rL  r   r:   r   rK  rY   r>   r@   r
   )rA   rM   dataFSr   s       r-   readDataUFOReader.readData=  s     H%	O7 ##H-D  " 767 yy)) 	O 4XJeDGG9MNN	Os&   - A )AA AA :Bc                    Uc  U R                   nU R                  [        R                  :  a#  [	        SU R                  R
                   S35      e[        U5      n  U R                  nUR                  U5      nU(       a  [        US9u  pVU(       d  [	        U5      eU$ ! [         a"    U R                  R                  [        5      n Nbf = f! [        R                  R                   a    [	        SU SU R                   35      ef = f)z
Return image data for the file named fileName.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
z%Reading images is not allowed in UFO r   zNo image file named 'r   r   )r   r   r   r*   r
   r   r   rW  r   r:   r   rV  rY   r>   r@   rX  )rA   rM   rr   rY  r   r   r%  s          r-   	readImageUFOReader.readImageM  s    ~~H!1!<!<<78K8K8Q8Q7RRST  H%	P;>> %%h/D 'T2LE!%(( " ;77??>:; yy)) 	P 5hZuTWWINOO	Ps*   B! *C !)C
C CC :D
c                 \    U R                   (       a  U R                  R                  5         g g ra   )r   r:   r   r   s    r-   r   UFOReader.closej  s    GGMMO r,   c                     U $ ra   r#   r   s    r-   	__enter__UFOReader.__enter__n  s    r,   c                 $    U R                  5         g ra   )r   )rA   exc_type	exc_valueexc_tbs       r-   __exit__UFOReader.__exit__q  s    

r,   )	rL  r   r   rW  r   r   r   r   r:   )Tra   )NNNNN))r$   r%   r&   r'   __doc__r   r   propertyrB   r   r   r   r   fileStructurer   r   r   r   r   r   r   r   r   r  r   r  r  r  r&  r-  r1  r   rH  rR  r[  r_  rc  r   rh  rn  r+   r#   r,   r-   r   r      s    	GV I#FGD) WM
 # ## FM2Ml	*(T9*?87v<$	 V '
R,*"H :r,   r   c                   :  ^  \ rS rSrSr    S!S jrS r\" \SS9rS r	S r
S"S	 jrS#S
 jr\rS rS rS rS$S jrS$S jrS$S jrS$S jrS$S jrS%S jrS r      S&S jr  S'S jr    S(S jrS)S jrS rS rS rS$S jrS$S jr S$S jr!U 4S jr"S r#U =r$$ )*r   iz  a  Write the various components of a .ufo.

Attributes:
    path: An `os.PathLike` object pointing to the .ufo.
    formatVersion: the UFO format version as a tuple of integers (major, minor),
        or as a single integer for the major digit only (minor is implied to be 0).
        By default, the latest formatVersion will be used; currently it is 3.0,
        which is equivalent to formatVersion=(3, 0).
    fileCreator: The creator of the .ufo file. Defaults to
        `com.github.fonttools.ufoLib`.
    structure: The internal structure of the .ufo file: either `ZIP` or `PACKAGE`.
    validate: A boolean indicating if the data read should be validated. Defaults
        to `True`.

By default, the written data will be validated before writing. Set ``validate`` to
``False`` if you do not want to validate the data. Validation can also be overriden
on a per-method level if desired.

Raises:
    UnsupportedUFOFormat: An exception indicating that the requested UFO
        formatVersion is not supported.
c                 V    [        U5      n[	        US5      (       a  UR                  5       n[        U[        5      (       Ga  [        R                  R                  U5      n[        R                  R                  U5      nU(       a6  [        U5      n	Ub%   [        U5      nXILa  [        SU	< SU< S35      eOnU	nOkUc  [        R                  n[        R                  R!                  U5      n
U
(       a2  [        R                  R#                  U
5      (       d  [        S	U-  5      eU[        R$                  L Ga  U(       Ga  [&        R(                  R+                  5       n[&        R,                  R/                  US
S9 n[&        R0                  R3                  X5        S S S 5        UR5                  S5       Vs/ s H4  nUR6                  (       d  M  UR8                  S:w  d  M(  UR8                  PM6     nn[;        U5      S:w  a  [        S[;        U5      -  5      eUR=                  US   [&        R>                  R@                  S9U l        O[        R                  RC                  [        R                  RE                  U5      5      S   S-   n[&        R,                  R/                  USS
S9nURG                  U5        UR=                  U[&        R>                  R@                  S9U l        O#[&        RH                  RK                  USS9U l        X@l&        Xl'        SU l(        O[        U[&        RR                  RT                  5      (       a  Un URW                  5         UU l         UR]                  S5      nU(       a,  U[        R                  La  SS K0nURc                  S[d        SS9  [        R                  U l&        UR                  [f        5      U l'        SU l(        O![i        S[k        U5      Rl                  -  5      e[o        U5      U l8        X l9        X0l:        S U l;        XPl<        S nU RN                  (       a/  U R{                  US9nUS   nUU:  a  SSKJn  U" SU SU S35      e0 U l>        Ub0  UR~                  S :  a   [        U R                  U5      5      U l>        O5U R&                  R                  [        5      (       a  [        [        0U l>        U R                  5         g ! [         a  nSSKJn  U" SU< 35      UeS nAff = f! [         a    [        SU-  5      ef = f! , (       d  f       GN= fs  snf ! [&        RX                  RZ                   a    [        SU-  5      ef = f! [&        RX                  R^                   a    [        U5      n GN*f = f)!Nr   r   zUnsupported UFO format: re   z&Invalid or unsupported structure: '%s'z"A UFO with a different structure (z%) already exists at the given path: 'rH   z.Cannot write to '%s': directory does not existrf   r  rk   rl   r    ro   rm   .ufoTrg   createrp   z?The 'structure' argument is not used when input is an FS objectr!   r   Fz-Expected a path string or fs object, found %srq   r   z2The UFO located at this path is a higher version (z) than the version (z6) that is trying to be written. This is not supported.r"   )Er   r   r   r   rs   re   rt   ru   osrB   normpathrX   rv   r   r
   r3   dirnameisdirr2   r:   tempfsTempFSrw   rx   copycopy_fsr|   r}   r~   r   r   r   r   splitextbasenamemakedirry   rz   r   rV   r   r   r   r   r>   r   r   r   r   r   UserWarningr   r   r   r$   r   r   r   _fileCreator_downConversionKerningDatar   r   r)  r   r   r&  r!  r   _writeMetaInfo)rA   rB   r   fileCreatorr   rr   rP   r   havePreviousFileexistingStructuredirNamer   origFSr   r   rootDirr   r   previousFormatVersionmetaInfos                       r-   r   UFOWriter.__init__  s   	,];M 4&&??$DdC  77##D)D!ww~~d3$7$=!($4Y$?	
 !9)9JDR  : !2I $ 0 8 8I''//$/277==#9#9%H4O  ,000#  "yy//1Hw?69 @ "*!1!1#!6 !6A88  )**(< !6    8}))I!(m,  #+"2"2$QK1F1F #3 # !gg..rww/?/?/EFqIFRG!xx~~d$~QH$$W-&..w@U@U.VDG'',,tD,9"+%5" $Dbggjj))J%  " %'!,,S1
 Y.>.F.FFU   
 #3":":D%/%6%67H%ID" %D?$t*BUBUU 
 d^
+'*.'! !%!!))8)<H$,-A$B!$}4H*-..B=/ RKK    ,1F1L1LPQ1Q!,T-D-DX-N!OD ww~~455&8:P%Q"a  	D&*=*;<	( & )DyP 4 @?
 B 99-- J!"AD"HIIJ 99&& ':'s_   S3 T  T4=UU(UU ,U; 3
T=TTT14
U-U8;)V('V(c                     U R                   $ ra   )r  r   s    r-   _get_fileCreatorUFOWriter._get_fileCreator0  s       r,   zMThe file creator of the UFO. This is set into metainfo.plist during __init__.r   c                    [        U[        5      (       d  [        S5      e[        U5      n[        U5      nUR                  R                  U5      (       d  [        SU-  5      eU R                  R                  U5      (       a  [        SU-  5      eU R                  R                  [        R                  R                  U5      SS9  UR                  R                  U5      (       a6  [        R                  R                  UR                  X R                  U5        g[        R                  R                  UR                  X R                  U5        g)z
Copy the sourcePath in the provided UFOReader to destPath
in this writer. The paths must be relative. This works with
both individual files and directories.
z,The reader must be an instance of UFOReader.z.The reader does not have data located at "%s".z!A file named "%s" already exists.TrecreateN)rt   r   r
   r   r:   rX   makedirsrB   r{  r|  r  copy_dir	copy_file)rA   reader
sourcePathdestPaths       r-   copyFromReaderUFOWriter.copyFromReader:  s     &),,LMMj)
H%yy
++@:M  77>>(##AHLMM2TB99??:&&GGVYY
GGXFGGfiiWWhGr,   c                 4   [        U5      nU R                  (       a?  U R                  R                  U5      (       a  X R                  R	                  U5      :X  a  g U R                  R                  X5        g! [        R                  R                   a    [        SU-  5      e[        R                  R                   aU    U R                  R                  [        R                  R                  U5      SS9  U R                  R                  X5         gf = f)a5  
Write bytes to a path relative to the UFO filesystem's root.
If writing to an existing UFO, check to see if data matches the data
that is already in the file at path; if so, the file is not rewritten
so that the modification date is preserved.
If needed, the directory tree for the given path will be built.
NzA directory exists at '%s'Tr  )r   rV   r:   isfilerY   rZ   r>   FileExpectedr
   r@   r  rB   r{  )rA   rB   r   s      r-   writeBytesToPathUFOWriter.writeBytesToPathQ  s     ~!!ww~~d##0A0A$0G(G	+GGt*yy%% 	C:TABByy)) 	+GGRWW__T2TBGGt*	+s   A9 9BDDc           	         [        U5      n U R                  R                  XUS9$ ! [        R                  R                   a  nUS   nUS:X  a   SnAgUS:X  d  US:X  d  US:X  aV  U R                  R                  [        R                  R                  U5      SS	9  U R                  R                  XUS9s SnA$  SnAgSnAf[        R                  R                   a(  n[        S
U SU R                   SU 35      s SnA$ SnAff = f)a/  
Returns a file (or file-like) object for the
file at the given path. The path must be relative
to the UFO path. Returns None if the file does
not exist and the mode is "r" or "rb.
An encoding may be passed if the file is opened in text mode.

Note: The caller is responsible for closing the open file.
r   r   r   NrT   axTr  rj   r   rI   )
r   r:   rJ   r>   r@   r  rB   r{  rQ  r
   )rA   rB   rU   ri   rP   ms         r-   getFileObjectForPathUFOWriter.getFileObjectForPathe  s     ~	M77<<(<CCyy)) 	HQACx cQ#Xc  !6 Fww||Dh|GG *2 yy&& 	M!1$uTWWIRsKLL	Ms4   ' DCA"C7D!D#D DDc                    [        U5      n U R                  R                  U5        U(       aR  [        R                  R                  U5      nU(       a+  [        R                  R                  U R                  U5        ggg! [        R                  R                   a    U R                  R                  U5         N[        R                  R                   a%    U(       d  [        SU SU R                   35      e Nf = f)a'  
Remove the file (or directory) at path. The path
must be relative to the UFO.
Raises UFOLibError if the path doesn't exist.
If force=True, ignore non-existent paths.
If the directory where 'path' is located becomes empty, it will
be automatically removed, unless 'removeEmptyParents' is False.
rH   z' does not exist on N)r   r:   remover>   r  
removetreer@   r
   rB   r{  toolsremove_empty)rA   rB   forceremoveEmptyParentsparents        r-   
removePathUFOWriter.removePath~  s     ~	KGGNN4  WW__T*F%%dggv6   yy%% 	%GGt$yy)) 	K!AdV+?y"IJJ 	Ks   B 9C?=?C?>C?c                     U R                   nUb>  [        R                  R                  U5      (       a   [        R                  " US5        ggg! [
         a   n[        R                  SU5         SnAgSnAff = f)z
Set the UFO modification time to the current time.
This is never called automatically. It is up to the
caller to call this when finished working on the UFO.
NzFailed to set modified time: %s)r   ry  rB   rX   utimeOSErrorr   r   )rA   rB   rP   s      r-   setModificationTimeUFOWriter.setModificationTime  sg     zzt 4 4Et$ !5  E@!DDEs   A 
A9A44A9c                     [        U R                  U R                  R                  S9nU R                  R                  S:w  a  U R                  R                  US'   U R                  [        U5        g )N)creatorr   r   r   )r   r  r   r   minorr_   r   )rA   r  s     r-   r  UFOWriter._writeMetaInfo  sb    %%--33
 $$)-1-@-@-F-FH)**H5r,   c                     U R                   [        R                  :  a  g0 nS H+  n[        X   R	                  5       5       H	  u  pEXBU'   M     M-     [        US9U l        g)a  
Set maps defining the renaming that should be done
when writing groups and kerning in UFO 1 and UFO 2.
This will effectively undo the conversion done when
UFOReader reads this data. The dictionary should have
this form::

        {
                "side1" : {"group name to use when writing" : "group name in data"},
                "side2" : {"group name to use when writing" : "group name in data"}
        }

This is the same form returned by UFOReader's
getKerningGroupConversionRenameMaps method.
Nr   )groupRenameMap)r   r   r*   r   r   r   r  )rA   mapsremapside	writeNamedataNames         r-   #setKerningGroupConversionRenameMaps-UFOWriter.setKerningGroupConversionRenameMaps  s_      "2"="==&D'+DJ,<,<,>'?#	"+h (@ ' +/e*D'r,   c                    Uc  U R                   nU(       a  [        U5      u  p4U(       d  [        U5      eU R                  [        R
                  :  a~  U R                  bq  U R                  S   n0 n[        UR                  5       5       H  u  pxXu;   a  M  XU'   M     [        UR                  5       5       H  u  pxXu;  a  M  XW   nXU'   M     Un0 n	UR                  5        H  u  p[        U5      X'   M     U	(       a  U R                  [        U	5        gU R                  (       a  U R                  [        SSS9  gg)z
Write groups.plist. This method requires a
dict of glyph groups as an argument.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
Nr  TFr  r  )r   r   r
   r   r   r*   r  r   r   r_   r   rV   r  )rA   r   rr   r   r   r  remappedGroupsr~   r$  	groupsNewkeyr  s               r-   writeGroupsUFOWriter.writeGroups  s    ~~H,V4NE!'** "2"="==//;334DEEN #'v||~"6='/t$ #7 #'v||~"6${'/t$	 #7
 $F	 ,,.JC!%[IN )_i8##OOO4EOR $r,   c                    Uc  U R                   n0 n[        [        R                  5       5       H*  n[	        X5      (       d  M   [        X5      nUc  M&  XSU'   M,     U R                  [        R                  :X  a  U(       a  [        U5      nOU R                  [        R                  :X  a  [        U5      nU(       a  [        U5      nOFU R                  [        R                  :X  a(  [        U5      nU(       a  [        U5      n[!        U5      nU(       a  U R#                  [$        U5        gg! [         a    [        SU-  5      ef = f)aB  
Write info.plist. This method requires an object
that supports getting attributes that follow the
fontinfo.plist version 2 specification. Attributes
will be taken from the given object and written
into the file.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
NzMThe supplied info object does not support getting a necessary attribute (%s).)r   r   r   keysrs   getattrr   r
   r   r   r*   r   r)   &_convertFontInfoDataVersion3ToVersion2validateInfoVersion2Datar(   &_convertFontInfoDataVersion2ToVersion1r_   r   )rA   r  rr   infoDatar  r  s         r-   	writeInfoUFOWriter.writeInfo  s'    ~~H<AACDDt""#D/E =!& E "2"="==3H=  $4$?$??=hGH3H=  $4$?$??=hGH3H==hGH.9 - & %g s   D//Ec                    Uc  U R                   nU(       a  Sn[        U5      (       d  [        U5      e[        UR	                  5       5       H  u  pE[        U[        [        45      (       d  [        U5      e[        U5      S:X  d  [        U5      e[        US   [        5      (       d  [        U5      e[        US   [        5      (       d  [        U5      e[        U[        5      (       a  M  [        U5      e   U R                  [        R                  :  al  U R                  b_  U R                  S   n0 n[        UR	                  5       5       H/  u  u  pnUR                  X5      nUR                  X5      n	XWX4'   M1     Un0 n
UR                  5        H  u  pXU4   nX;  a  0 X'   XZU   U'   M     U
(       a  U R!                  ["        U
5        gU R$                  (       a  U R'                  ["        SSS	9  gg)
a  
Write kerning.plist. This method requires a
dict of kerning pairs as an argument.

This performs basic structural validation of the kerning,
but it does not check for compliance with the spec in
regards to conflicting pairs. The assumption is that the
kerning data being passed is standards compliant.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
Nz&The kerning is not properly formatted.r!   r   r    r  TFr  )r   isDictEnoughr
   r   r   rt   tupler   ru   r   r   r   r*   r  r   r  r_   r
  rV   r  )rA   r   rr   r   pairr  r  remappedKerningr   r   kerningDictr  r  s                r-   writeKerningUFOWriter.writeKerning2  s    ~~H#K ((!"677#GMMO4!$u66%&:;;4yA~%&:;;!$q'3//%&:;;!$q'3//%&:;;!%55%&:;;  5 "2"="==//;334DEE O)-gmmo)>%		%/		%/05- *? &G"<<>KD%K(E&$&!',e$	 *
 -{;##OO,DUOS $r,   c                     Uc  U R                   nU(       a  [        U5      u  p4U(       d  [        U5      eU(       a  U R                  [        U5        gU R
                  (       a  U R                  [        SSS9  gg)z
Write lib.plist. This method requires a
lib dict as an argument.

``validate`` will validate the data, by default it is set to the
class's validate value, can be overridden.
NTFr  )r   r  r
   r_   r  rV   r  )rA   libDictrr   r   r   s        r-   writeLibUFOWriter.writeLibk  sc     ~~H-g6NE!'**\73##OOLOO $r,   c                 j   Uc  U R                   nU R                  [        R                  :X  a  [	        S5      eU(       a   [        U[        5      (       d  [	        S5      eU(       a&  U R                  [        UR                  S5      5        gU R                  (       a  U R                  [        SSS9  gg)zL
Write features.fea. This method requires a
features string as an argument.
Nz4features.fea is not allowed in UFO Format Version 1.zThe features are not text.utf8TFr  )r   r   r   r(   r
   rt   ru   r  r  encoderV   r  )rA   featuresrr   s      r-   writeFeaturesUFOWriter.writeFeatures  s    
 ~~H"2"="==TUUh,,!">??!!"3X__V5LM##OO-TeOT $r,   c                    Uc  U R                   nU R                  [        R                  :  a  gUb(  / nU H  nUc  [        nUR                  U5        M     UnO#[        U R                  R                  5       5      nU(       a;  [        U5      [        U R                  R                  5       5      :w  a  [        S5      eU Vs/ s H  oDU R                  U   4PM     nnU R                  [        U5        gs  snf )zk
Write the layercontents.plist file. This method  *must* be called
after all glyph sets have been written.
NzMThe layer order content does not match the glyph sets that have been created.)r   r   r   r*   r   rB  r   r)  r  setr
   r_   r"  )rA   
layerOrderrr   newOrderr*  r)  s         r-   writeLayerContentsUFOWriter.writeLayerContents  s    
 ~~H!1!<!<<!H'	$ 2I	* ( "Jd005578JJ3t/A/A/F/F/H+II_  IS
HR9**956
 	 
 	/?
s   C6c                     S n[        U R                  R                  5       5       H  u  p4Uc  U[        :X  a  Un  OX1:X  d  M  Un  O   U(       d  [	        SU-  5      eU$ )Nz>Could not locate a glyph set directory for the layer named %s.)r   r)  r   r!  r
   )rA   r*  foundDirectoryexistingLayerNamer+  s        r-   _findDirectoryForLayerName$UFOWriter._findDirectoryForLayerName  ss    04T5G5G5M5M5O0P, ]6L%L!."/!. 1Q P  r,   c           	         Uc  U R                   nUc  U R                   nU R                  [        R                  :  a-  U(       a  Ub#  [	        SU R                  R
                   S35      eUcB  U(       a;  U R                  R                  5        H  u  pxU[        :X  d  M  UnM     Uc  [        nOUc  U(       d  [	        S5      eU R                  [        R                  :  a  U R                  UUUUS9$ U R                  R
                  [        R                  R
                  :X  a  U R                  UUUUUUS9$ [        U R                  5      e)a  
Return the GlyphSet object associated with the
appropriate glyph directory in the .ufo.
If layerName is None, the default glyph set
will be used. The defaultLayer flag indictes
that the layer should be saved into the default
glyphs directory.

``validateRead`` will validate the read data, by default it is set to the
class's validate value, can be overridden.
``validateWrte`` will validate the written data, by default it is set to the
class's validate value, can be overridden.
``expectContentsFile`` will raise a GlifLibError if a contents.plist file is
not found on the glyph set file system. This should be set to ``True`` if you
are reading an existing UFO and ``False`` if you use ``getGlyphSet`` to create
a fresh glyph set.
z,Only the default layer can be writen in UFO r   z5A layer name must be provided for non-default layers.)glyphNameToFileNameFuncr9  )r*  defaultLayerr  r9  )r   r   r   r*   r
   r   r)  r   r!  r   _getDefaultGlyphSet_getGlyphSetFormatVersion3r   )	rA   r*  r  r  r7  r8  r9  r  r;  s	            r-   r   UFOWriter.getGlyphSet  sW   4 >>L  NNM!1!<!<<	 5>t?R?R?X?X>YYZ[  040B0B0H0H0J,! 66 1I 1K  .	|UVV!1!<!<<++(?#5	 ,     &&*:*E*E*K*KK22#)(?#5 3   &d&9&9::r,   c           	      t    SSK Jn  U R                  R                  [        SS9nU" UUU R
                  UUUS9$ )Nr   r4  Tr  r  r6  r7  r8  r9  )r:  r5  r:   r  r!  r   )rA   r7  r8  r  r9  r5  r>  s          r-   r  UFOWriter._getDefaultGlyphSet   sC     	6WW__%;d_K
$;!00%'1
 	
r,   c           	          SSK Jn  U(       aR  U R                  R                  5        H4  u  pU	[        :X  a  X:w  a  [        SU-  5      eM$  X:X  d  M+  [        S5      e   X0R                  ;   a  U R                  U   n	OOU(       a  [        n	OAU R                  R                  5        V
s1 s H  oR                  5       iM     nn
[        X;SS9n	U R                  R                  U	SS9nXR                  U'   U" UUU R                  UUUS	9$ s  sn
f )
Nr   r4  z@Another layer ('%s') is already mapped to the default directory.z8The layer name is already mapped to a non-default layer.glyphs.existingprefixTr  r  )r:  r5  r)  r   r!  r
   valueslowerr   r:   r  r   )rA   r7  r8  r*  r  r  r9  r5  r  r;  dr  r>  s                r-   r  $UFOWriter._getGlyphSetFormatVersion3  s!    	6
 040B0B0H0H0J,! 66(5)^/0  6
 '3%R  1K *****95I 2	 04/A/A/H/H/JK/J!GGI/JK.	 WW__Y_>
(19%$;!00%'1
 	
 Ls   )Dc                    U R                   [        R                  :  a  gX:X  a?  U R                  U   [        :w  a  U(       d  gU R                  U   [        :X  a  U(       a  gOZUc  [
        nX R                  ;   a  [        SU-  5      eU(       a-  [        U R                  R                  5       ;   a  [        S5      eU R                  U5      nU(       a  [        nOAU R                  R                  5        Vs1 s H  ofR                  5       iM     nn[        X'SS9nU R                  U	 XPR                  U'   U R                  R                  XESS9  gs  snf )z
Rename a glyph set.

Note: if a GlyphSet object has already been retrieved for
layerName, it is up to the caller to inform that object that
the directory it represents has changed.
Nz A layer named %s already exists.zA default layer already exists.r  r  Trw  )r   r   r*   r)  r!  r   r
   r  r  r  r   r:   movedir)rA   r*  newLayerNamer  oldDirectorynewDirectoryr~   r  s           r-   renameGlyphSetUFOWriter.renameGlyphSetI  s4    !1!<!<<  $ ""9-1GG$!!),0FF< #1111!"D|"STT 6$:L:L:S:S:U U!"CDD66yA1L151C1C1J1J1LM1L

1LHM-	L y)+7<(4@ Ns   9Ec                     U R                   [        R                  :  a  gU R                  U5      nU R	                  USS9  U R
                  U	 g)z*
Remove the glyph set matching layerName.
NF)r  )r   r   r*   r  r  r)  )rA   r*  r  s      r-   deleteGlyphSetUFOWriter.deleteGlyphSety  sL     !1!<!<< 88C5Ay)r,   c                 L    U R                  [         S[        U5       3U5        g)zR
Write data to fileName in the 'data' directory.
The data must be a bytes string.
rk   N)r  rK  r   )rA   rM   r   s      r-   	writeDataUFOWriter.writeData  s%    
 	a0B/CDdKr,   c                 J    U R                  [         S[        U5       35        g)z9
Remove the file named fileName from the data directory.
rk   N)r  rK  r   )rA   rM   s     r-   
removeDataUFOWriter.removeData  s!     	<.(8*<)=>?r,   c                 8   Uc  U R                   nU R                  [        R                  :  a#  [	        SU R                  R
                   S35      e[        U5      nU(       a  [        US9u  pEU(       d  [	        U5      eU R                  [         SU 3U5        g)zO
Write data to fileName in the images directory.
The data must be a valid PNG.
NImages are not allowed in UFO r   rb  rk   )
r   r   r   r*   r
   r   r   rX  r  rV  )rA   rM   r   rr   r   r%  s         r-   
writeImageUFOWriter.writeImage  s    
 ~~H!1!<!<<01D1D1J1J0K1M  H%'T2LE!%(( 0(<dCr,   c                     U R                   [        R                  :  a#  [        SU R                   R                   S35      eU R                  [         S[        U5       35        g)z;
Remove the file named fileName from the
images directory.
r  r   rk   N)r   r   r*   r
   r   r  rV  r   )rA   rM   rr   s      r-   removeImageUFOWriter.removeImage  s_    
 !1!<!<<01D1D1J1J0K1M  	>*!HX,>+?@Ar,   c                    Uc  U R                   nU R                  [        R                  :  a#  [	        SU R                  R
                   S35      e[         S[        U5       3n[         S[        U5       3nU R                  XU5        g)z
Copy the sourceFileName in the provided UFOReader to destFileName
in this writer. This uses the most memory efficient method possible
for copying the data possible.
Nr  r   rk   )	r   r   r   r*   r
   r   rV  r   r  )rA   r  sourceFileNamedestFileNamerr   r  r  s          r-   copyImageFromReaderUFOWriter.copyImageFromReader  s     ~~H!1!<!<<01D1D1J1J0K1M  ''q.)A(BC
$%Qx'=&>?F9r,   c                   > U R                   (       a  U R                  [        R                  L a  [        R
                  R                  [        R
                  R                  U R                  5      5      S   S-   n[        R                  R                  U R                  SSS9 n[        R                  R                  U R                  UR                  U5      5        S S S 5        [        TU ]A  5         g ! , (       d  f       N= f)Nr   rv  Trf   rg   )rV   r   r   r2   ry  rB   r  r  r   r:   rw   rx   r  r  r  superr   )rA   r  destFS	__class__s      r-   r   UFOWriter.close  s    !!d&9&9=M=Q=Q&Q gg&&rww'7'7

'CDQG&PG

$IV)@A J JIs   %:C66
D)
r  r  r   r   rV   r   r   r   r:   r)  )Nzcom.github.fonttools.ufoLibNT)rT   N)FTra   rp  )NTNNNF)NF)NTNF)F)%r$   r%   r&   r'   rq  r   r  rr  r  r  r  r  r  removeFileForPathr  r  r  r  r  r  r  r  r  r  r   r  r  r
  r  r  r  r  r  r  r   r+   __classcell__)r$  s   @r-   r   r   z  s    4 1Z|! [KH.+(M27. #E 6E23Sn*:\5TrP*U&@6$  $ @;L !% 
.  $ 4
l.A`
*L@D$	B:  r,   r   c                 @   [         R                  " U 5      (       a  [        R                  $ [        R
                  R                  U 5      (       a  [        R                  $ [        R
                  R                  U 5      (       a  [        SU -  5      e[        SU -  5      e)zReturn UFOFileStructure.ZIP if the UFO at path 'ufo_path' (str)
is a zip file, else return UFOFileStructure.PACKAGE if 'ufo_path' is a
directory.
Raise UFOLibError if it is a file with unknown structure, or if the path
does not exist.
z7The specified UFO does not have a known structure: '%s'zNo such file or directory: '%s')
zipfile
is_zipfiler   r2   ry  rB   r|  r3   r  r
   )ufo_paths    r-   rv   rv     s{     (#####	x	 	 '''		!	!EP
 	
 ;hFGGr,   c                     [         R                  R                  U 5      u  pSR                  SR                  UR                  S5      SS 5      S/5      n[         R                  R                  X5      $ )a  
Return a .ufo pathname.

>>> makeUFOPath("directory/something.ext") == (
...         os.path.join('directory', 'something.ufo'))
True
>>> makeUFOPath("directory/something.another.thing.ext") == (
...         os.path.join('directory', 'something.another.thing.ufo'))
True
r   Nufo)ry  rB   splitjoin)rB   dirr~   s      r-   r   r     sV     d#IC88SXXdjjocr23U;<D77<<""r,   c                     [         U    nUR                  S5      nUR                  S5      nUR                  S5      nUb
  U" X5      nU$ U[        :X  a
  U" X5      nU$ U" U5      nU$ )a  
This performs very basic validation of the value for attribute
following the UFO 2 fontinfo.plist specification. The results
of this should not be interpretted as *correct* for the font
that they are part of. This merely indicates that the value
is of the proper type and, where the specification defines
a set range of possible values for an attribute, that the
value is in the accepted range.
r   valueValidatorvalueOptions)r   r   genericTypeValidatorr  r  r  	valueType	validatorr4  isValidValues          r-   r   r          =TB"&&v.I"&&'78I%)).9L 5 	 ,,$U6L  %U+Lr,   c                     0 n[        U R                  5       5       H.  u  p#[        X#5      nU(       d  [        SU SU< S35      eX1U'   M0     U$ )a  
This performs very basic validation of the value for infoData
following the UFO 2 fontinfo.plist specification. The results
of this should not be interpretted as *correct* for the font
that they are part of. This merely indicates that the values
are of the proper type and, where the specification defines
a set range of possible values for an attribute, that the
value is in the accepted range.
Invalid value for attribute  ().)r   r   r   r
   r  validInfoDatar  r  r9  s        r-   r  r    Y     MHNN,-@M <TF"UIRPQQ"'$ . r,   c                     [         U    nUR                  S5      nUR                  S5      nUR                  S5      nUb
  U" X5      nU$ U[        :X  a
  U" X5      nU$ U" U5      nU$ )a  
This performs very basic validation of the value for attribute
following the UFO 3 fontinfo.plist specification. The results
of this should not be interpretted as *correct* for the font
that they are part of. This merely indicates that the value
is of the proper type and, where the specification defines
a set range of possible values for an attribute, that the
value is in the accepted range.
r   r3  r4  )r   r   r5  r6  s          r-   r   r   0  r:  r,   c                     0 n[        U R                  5       5       H.  u  p#[        X#5      nU(       d  [        SU SU< S35      eX1U'   M0     U$ )a  
This performs very basic validation of the value for infoData
following the UFO 3 fontinfo.plist specification. The results
of this should not be interpretted as *correct* for the font
that they are part of. This merely indicates that the values
are of the proper type and, where the specification defines
a set range of possible values for an attribute, that the
value is in the accepted range.
r<  r=  r>  )r   r   r   r
   r?  s        r-   r   r   J  rA  r,      )r    r!   r"            	      @   )r   r    r!   r"   rG  rH  >(   noteyearfondIDnoticelicensexHeightascenderdesignerfondNamefontNamefullNamemenuNamettVendoruniqueID	capHeight	copyright	createdBy	descender	fontStyle	msCharSet	otMacName	styleName	trademark	ttVersion	vendorURL	widthName
familyName
licenseURL
slantAngle
ttUniqueID
unitsPerEm
weightNamedesignerURLitalicAngleotStyleNameweightValuedefaultWidthotFamilyNameversionMajorversionMinorre  )r   r`  styleMapFamilyNamestyleMapStyleName)r   r3  rq  rr  rL  rZ  ra  ri  r\  rP  rY  rQ  rl  rK  openTypeHeadCreatedopenTypeHeadLowestRecPPEMopenTypeHeadFlagsintegerList)r   r3  r4  openTypeHheaAscenderopenTypeHheaDescenderopenTypeHheaLineGapopenTypeHheaCaretSlopeRiseopenTypeHheaCaretSlopeRunopenTypeHheaCaretOffsetopenTypeNameDesigneropenTypeNameDesignerURLopenTypeNameManufactureropenTypeNameManufacturerURLopenTypeNameLicenseopenTypeNameLicenseURLopenTypeNameVersionopenTypeNameUniqueIDopenTypeNameDescriptionopenTypeNamePreferredFamilyName"openTypeNamePreferredSubfamilyNameopenTypeNameCompatibleFullNameopenTypeNameSampleTextopenTypeNameWWSFamilyNameopenTypeNameWWSSubfamilyNameopenTypeOS2WidthClassopenTypeOS2WeightClassopenTypeOS2SelectionopenTypeOS2VendorIDopenTypeOS2PanoseopenTypeOS2FamilyClassopenTypeOS2UnicodeRangesopenTypeOS2CodePageRangesopenTypeOS2TypoAscenderopenTypeOS2TypoDescenderopenTypeOS2TypoLineGapopenTypeOS2WinAscentopenTypeOS2WinDescentopenTypeOS2TypeopenTypeOS2SubscriptXSizeopenTypeOS2SubscriptYSizeopenTypeOS2SubscriptXOffsetopenTypeOS2SubscriptYOffsetopenTypeOS2SuperscriptXSizeopenTypeOS2SuperscriptYSizeopenTypeOS2SuperscriptXOffsetopenTypeOS2SuperscriptYOffsetopenTypeOS2StrikeoutSizeopenTypeOS2StrikeoutPositionopenTypeVheaVertTypoAscenderopenTypeVheaVertTypoDescenderopenTypeVheaVertTypoLineGapopenTypeVheaCaretSlopeRiseopenTypeVheaCaretSlopeRunopenTypeVheaCaretOffsetpostscriptFontNamepostscriptFullNamepostscriptSlantAnglepostscriptUniqueIDpostscriptUnderlineThicknesspostscriptUnderlinePositionpostscriptIsFixedPitchpostscriptBlueValuespostscriptOtherBluespostscriptFamilyBluespostscriptFamilyOtherBluespostscriptStemSnapHpostscriptStemSnapVpostscriptBlueFuzzpostscriptBlueShift)	postscriptBlueScalepostscriptForceBoldpostscriptDefaultWidthXpostscriptNominalWidthXpostscriptWeightNamepostscriptDefaultCharacterpostscriptWindowsCharacterSetmacintoshFONDFamilyIDmacintoshFONDNameopenTypeGaspRangeRecordsdictListopenTypeNameRecordswoffMajorVersionwoffMinorVersionwoffMetadataUniqueIDwoffMetadataVendorwoffMetadataCredits)woffMetadataDescriptionwoffMetadataLicensewoffMetadataCopyrightwoffMetadataTrademarkwoffMetadataLicenseewoffMetadataExtensions
guidelinesr3  c                 V    0 n[        U R                  5       5       H	  u  p#X!U'   M     U$ ra   )r   r   )r  flippedr  r  s       r-   	_flipDictr    s)    G1779o
 &Nr,   rV  rR  rk  r[  rc  rO  rf  rb  rh  rN  rp  rm  r_  rj  r  rn  rW  rX  r  r  r  r  )	rT  rM  rS  ro  rg  rU  r]  rd  r^  regularitalicboldzbold italic)rJ  r        !   r    r!   r"   rE        rF  rG  rH  )	zUltra-condensedzExtra-condensed	CondensedzSemi-condensedzMedium (normal)zSemi-expandedExpandedzExtra-expandedzUltra-expandedNormalAllmediumMediumM                  
                                                   )         c                    [        U[        5      (       a  [        U5      U:X  a  [        U5      nUb  U S:X  a.  [        R	                  U5      nUc  [        SU< SU  S35      eUnOgU S:X  a.  [        R	                  U5      nUc  [        SU< SU  S35      eUnO3U S:X  a-  [        R	                  U5      nUc  [        SU< SU  S35      eUn[        R	                  X 5      n X4$ )z
Convert value from version 1 to version 2 format.
Returns the new attribute name and the converted value.
If the value is None, None will be returned for the new value.
r]  Cannot convert value () for attribute r   rd  r^  )	rt   floatint_fontStyle1To2r   r
   _widthName1To2_msCharSet1To2fontInfoAttributesVersion1To2r  r  vs      r-   r   r     s    %u:JE;""5)Ay!,UI5EdV1M  E[ ""5)Ay!,UI5EdV1M  E[ ""5)Ay!,UI5EdV1M  E(,,T8D;r,   c                     UbS  U S:X  a  [         R                  U5      nO7U S:X  a  [        R                  U5      nOU S:X  a  [        R                  U5      n[        R                  X 5      n X4$ )z
Convert value from version 2 to version 1 format.
Returns the new attribute name and the converted value.
If the value is None, None will be returned for the new value.
rt  r  r  )_fontStyle2To1r   _widthName2To1_msCharSet2To1fontInfoAttributesVersion2To1r  r  s     r-   r   r   	  sm     &&"&&u-E,,"&&u-E44"&&u-E(,,T8D;r,   c                     0 n[        U R                  5       5       HF  u  p#US:X  a  US:X  a  M  [        X#5      u  pEU[        ;  a  M,  Uc  [	        SU< SU S35      eXQU'   MH     U$ )Nrn  r-  r  r  r   )r   r   r   r   r
   r   	convertedr  r  newAttrnewValues         r-   r   r   	  s    IDJJL) = Ub[R
 44=(	1A'!L  &'% *& r,   c                     0 n[        U R                  5       5       H8  u  p#[        X#5      u  pEU[        ;  a  M  Uc  [	        SU< SU S35      eXQU'   M:     U$ )Nr  r  r   )r   r   r   r   r
   r  s         r-   r  r  5	  ss    IDJJL)R
 44=(	1A'!L  &' * r,   >   rr  r  r  rv  >   r{  ry  r  rz  r  r  r~  r  r  r  r  rv  r  r  r  r  r  r  r  r  r  r  r  r  c                    U [         ;   a   [        U5      nU [
        ;   a   [        [        U5      5      nX4$ U [        ;   a6   [        [        U5      5      nU[        U5      :X  a  [        U5      nX!:w  a  UnX4$ ! [        [        4 a    [	        SU -  5      ef = f! [        [        4 a    [	        SU -  5      ef = f! [        [        4 a    [	        SU -  5      ef = f)z
Convert value from version 2 to version 3 format.
Returns the new attribute name and the converted value.
If the value is None, None will be returned for the new value.
zCould not convert value for %s.)
_ufo2To3FloatToIntroundr   r   r
   _ufo2To3NonNegativeIntr  abs_ufo2To3NonNegativeIntOrFloatr   r  s      r-   6convertFontInfoValueForAttributeFromVersion2ToVersion3r  o	  s    !!	H%LE %%	HE
OE ; 
.	.	Hc%j!A A;AA:E;! I& 	H?$FGG	H
 I& 	H?$FGG	H
 I& 	H?$FGG	Hs"   A< B C  <BB= Cc                     X4$ )z
Convert value from version 3 to version 2 format.
Returns the new attribute name and the converted value.
If the value is None, None will be returned for the new value.
r#   r  s     r-   6convertFontInfoValueForAttributeFromVersion3ToVersion2r  	  s     ;r,   c                     0 n[        U R                  5       5       H"  u  p#[        X#5      u  pEU[        ;  a  M  XQU'   M$     U$ ra   )r   r   r  r   r  s         r-   r  r  	  sL    IDJJL)R
 44%' * r,   c                 p    0 n[        U R                  5       5       H  u  p#[        X#5      u  p#X1U'   M     U$ ra   )r   r   r  )r   r  r  r  s       r-   r   r   	  s>    IDJJL)L
  $	 *
 r,   __main__)rq  ry  r  r   r   loggingr)  enumcollectionsr   r:   fs.basefs.subfs	fs.errorsfs.copyfs.osfsfs.zipfs	fs.tempfsfs.toolsfontTools.miscr   fontTools.ufoLib.validatorsfontTools.ufoLib.filenamesr   fontTools.ufoLib.convertersr	   r   r
   fontTools.ufoLib.utilsr   r   __all____version__	getLoggerr$   r   r!  rK  rV  r   r   r  r   r
  r  r"  LAYERINFO_FILENAMEr   r  Enumr   __str__r   r5   r   r   r   rv   r   r   r  r   r   r   range fontInfoOpenTypeHeadFlagsOptions#fontInfoOpenTypeOS2SelectionOptions'fontInfoOpenTypeOS2UnicodeRangesOptions(fontInfoOpenTypeOS2CodePageRangesOptionsfontInfoOpenTypeOS2TypeOptionsr   r   ru   "fontInfoStyleMapStyleNameValidatorr  r   $fontInfoOpenTypeHeadCreatedValidatorgenericIntListValidator&fontInfoOpenTypeOS2WidthClassValidator'fontInfoOpenTypeOS2WeightClassValidator*fontInfoVersion2OpenTypeOS2PanoseValidator'fontInfoOpenTypeOS2FamilyClassValidatorbool fontInfoPostscriptBluesValidator%fontInfoPostscriptOtherBluesValidator fontInfoPostscriptStemsValidator.fontInfoPostscriptWindowsCharacterSetValidatorr   r  r  r   r   updategenericNonNegativeIntValidator!genericNonNegativeNumberValidator*fontInfoVersion3OpenTypeOS2PanoseValidator)fontInfoOpenTypeGaspRangeRecordsValidator$fontInfoOpenTypeNameRecordsValidator%fontInfoWOFFMetadataUniqueIDValidator#fontInfoWOFFMetadataVendorValidator$fontInfoWOFFMetadataCreditsValidator(fontInfoWOFFMetadataDescriptionValidator$fontInfoWOFFMetadataLicenseValidator&fontInfoWOFFMetadataCopyrightValidator&fontInfoWOFFMetadataTrademarkValidator%fontInfoWOFFMetadataLicenseeValidator'fontInfoWOFFMetadataExtensionsValidatorguidelinesValidatorr   r   r  dataDictr5  r  r  r  r   r  r	  r  r
  r  r  r   r   r   r  r  r  r  r  r  r  r   doctesttestmodr#   r,   r-   <module>r[     s   D 
      # 	         # ) 9 M / F"  
		8	$ " $ $  " " . & % u4dii  299  tyy I Ibg

 g
^N	 Nd H&#64(4, $(a#5  &; #*.uQ}*= '+/a+= (!3 ) VM'$C.M'3M' $C.M' !C	M' DcNM' DcNM' DcNM' 3M' 3M' $S%L)M' C<(M' t#u&M' C<(M'  3,'!M'" 4eS\*#M'$ DcN%M'& 4!E'M',  C<!8-M'. .5/M'8 DsEl39M': TU|4;M'< 4c5\2=M'> !$C.?M'@  3AM'B t#u6CM'D DcNEM'F t~GM'H #IM'J "4S>KM'L 4S>MM'N dnOM'P 4S>QM'R DcNSM'T t~UM'V &t~WM'X )$C.YM'Z %dn[M'\ dn]M'^  3_M'` #DcNaM'b T!GcM'h d!HiM'n D.8oM'x 4S>yM'z +U{M'@ d+RAM'F .<!GM'P  .="QM'Z t#u6[M'\ 3, 7]M'^ de5_M'` DsEl3aM'b TU|4cM'd t.3eM'n  C<!8oM'p  C<!8qM'r "4c5\#:sM't "4c5\#:uM'v "4c5\#:wM'x "4c5\#:yM'z $TU|%<{M'| $TU|%<}M'~ 3, 7M'@ #DsEl$;AM'B #DsEl$;CM'D $TU|%<EM'F "4c5\#:GM'H !$C.IM'J  3KM'L t#u6MM'N $C.OM'P $C.QM'R Ducl3SM'T $C.UM'V #DsEl$;WM'X "4c5\#:YM'Z do[M'\ D+K]M'b D+PcM'h T+KiM'n !$+P#oM't 4+KuM'z 4+K{M'@ $S%L1AM'B 4c5\2CM'D  eS\2T?##u6##u6 cN"&C.%)!O& "s^3YM' #\ !!D!I!I!KL &./R&S # # * *O#6TUOdu.O
O
 	$T%F&
O 	#O 	 3O 	t~O 	"4S>O 	TE
O  	"4S>!O" 	#DcN#O$ 	!$C.%O& 	%F!
'O, 	 %F"
-O2 	$Ts^3O4 	$Ts^5O6 	&t~7O8 	&t~9O: 	&t~;O< 	&t~=O> 	(3?O@ 	(3AOB 	#DcNCOD 	'#EOF 	#D,U%
GOL 	t,P 
MOR 	'#SOT 	(3UOV 	&t~WOX 	"4S>YOZ 	D%C
[O` 	D%C
aOf 	&K!
gOl 	d&I
mOr 	t&J 
sOx $(&N$
  $&J 
 "&&L"
 "&&L"
 !%&K!
 #'&M#
 5HI]OQd !!D!I!I!KL  >DDFGND(x'%9!" H >DDFGND(x'%9!" H!$!&! ,! +	!
 .! $! *! &! (! '! 5! 7! 1! (! +!  %!!" $#!$ %%#-($$(07! : !**G H '*+H+M+M+O'P $H&mL>*q  
 >* x  u x x qq q 	
             !" #$ 
		), >*
!H"0*  !  88	 zOO r,   