+
    K<iY                       R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHt ^ RIt^ R	IHt ^ RIt]P(                  ! ]4      t ! R
 R]4      t^tRt^^^^^^^^^^
^^^^^^2^	^d/	t]3R lt ! R R]4      tRt]P>                  ! ]4      t Rt!]P>                  ! ]!4      t"Rt#]P>                  ! ]#4      t$Rt%]P>                  ! ]%4      t&Rt']P>                  ! ]'4      t( ! R R]4      t) ! R R])4      t* ! R R])4      t+ ! R R4      t,R t-R t.R t/]R 8X  d6   ^ RI0t0^ RI1t1]0Pd                  ! ]1Pf                  ! 4       Ph                  4       R# R# )!a  ttLib/sfnt.py -- low-level module to deal with the sfnt file format.

Defines two public classes:

- SFNTReader
- SFNTWriter

(Normally you don't have to use these classes explicitly; they are
used automatically by ttLib.TTFont.)

The reading and writing of sfnt files is separated in two distinct
classes, since whenever the number of tables changes or whenever
a table's length changes you need to rewrite the whole file anyway.
)annotations)KeysView)BytesIO)SimpleNamespace)Tag)sstruct)
TTLibErrorTTLibFileIsCollectionErrorN)OrderedDictc                  r    ] tR t^ tR tRR ltR R lt]tR R ltR R lt	R	 R
 lt
R R ltR tR tRtR# )
SFNTReaderc                   V'       dr   V \         J dh   V^ ,          pVP                  ^ 4       \        VP                  ^4      4      pVP                  ^ 4       VR8X  d   ^ RIHp \        P                  V4      # \        P                  V 4      # )z]Return an instance of the SFNTReader sub-class which is compatible
with the input file type.
wOF2)WOFF2Reader)r   seekr   readfontTools.ttLib.woff2r   object__new__)clsargskwargsinfilesfntVersionr   s   &*,   6/usr/lib/python3/dist-packages/fontTools/ttLib/sfnt.pyr   SFNTReader.__new__!   sh     C:%!WFKKNfkk!n-KKKNf$=~~k22~~c""    c                	B   Wn         W n        R V n        R V n        \        V n        V P                   P                  ^ 4       V P                   P                  ^4      V n        V P                   P                  ^ 4       V P                  R8X  d   \        V P                   4      pVP                  p^ Tu;8:  d   V8  g   M \        RV^,
          ,          4      hWPn
        V P                   P                  VP                  V,          4       V P                   P                  \        4      p\        V4      \        8w  d   \        R4      h\         P"                  ! \$        W`4       MV P                  R8X  dm   RV n        \&        V n        V P                   P                  \(        4      p\        V4      \(        8w  d   \        R4      h\         P"                  ! \*        W`4       MYV P                   P                  \        4      p\        V4      \        8w  d   \        R4      h\         P"                  ! \$        W`4       \-        V P                  4      V n        V P                  R9  d   \        R4      h/ p\/        V P0                  4       FG  pV P                  4       p	V	P3                  V P                   4       \-        V	P4                  4      p
WV
&   KI  	  \7        \9        VP;                  4       R	 R
7      4      V n        V P                  R8X  d   \?        V 4      V n        R # R # )Ns   ttcfz2specify a font number between 0 and %d (inclusive)'Not a Font Collection (not enough data)   wOFFwoffz!Not a WOFF font (not enough data)z1Not a TrueType or OpenType font (not enough data)z1Not a TrueType or OpenType font (bad sfntVersion)c                (    V ^,          P                   # )   )offset)is   &r   <lambda>%SFNTReader.__init__.<locals>.<lambda>`   s    qt{{r   )key)   OTTOtrue) filecheckChecksumsflavor
flavorDataSFNTDirectoryEntryDirectoryEntryr   r   r   readTTCHeadernumFontsr	   offsetTablesfntDirectorySizelenr   r   unpacksfntDirectoryFormatWOFFDirectoryEntrywoffDirectorySizewoffDirectoryFormatr   range	numTablesfromFiletagr
   sorteditemstablesWOFFFlavorData)selfr+   r,   
fontNumberheaderr2   datarA   r$   entryr>   s   &&&&       r   __init__SFNTReader.__init__2   sI   	,0		q99>>!,		qw&"499-FH
-X-0H!|%  %MIINN6--j9:99>>"34D4y-- !JKKNN.;( DK"4D99>>"34D4y-- !DEENN.;99>>"34D4y-- !TUUNN.;t//0#GGPQQ,.t~~&A'')ENN499%eii.C3K	 '
 "&=R"ST ;;& ,T2DO !r   c                    V ^8  d   QhRRRR/# )   r>   str | bytesreturnbool )formats   "r   __annotate__SFNTReader.__annotate__f   s     " "; "4 "r   c                	    WP                   9   # NrA   rC   r>   s   &&r   has_keySFNTReader.has_keyf   s    kk!!r   c                   V ^8  d   QhRR/# )rK   rM   zKeysView[Tag]rO   )rP   s   "r   rQ   rR   k   s     " "m "r   c                	6    V P                   P                  4       # rT   )rA   keysrC   s   &r   r[   SFNTReader.keysk   s    {{!!r   c                    V ^8  d   QhRRRR/# )rK   r>   rL   rM   bytesrO   )rP   s   "r   rQ   rR   n   s      { u r   c                   V P                   \        V4      ,          pVP                  V P                  4      pV P                  '       d   VR8X  d)   \        VR,          R,           VR,          ,           4      pM\        V4      pV P                  ^8  d"   WBP                  8X  g   Q RV,          4       h V# WBP                  8w  d   \        P                  RV4       V# )zFetch the raw table data.headN   N          NNzbad checksum for '%s' table)	rA   r   loadDatar+   r,   calcChecksumcheckSumlogwarning)rC   r>   rG   rF   checksums   &&   r   __getitem__SFNTReader.__getitem__n   s    CH%~~dii(f}'R;(>c(JK'-""Q&>>1V3PSV3VV1  ^^+93?r   c                    V ^8  d   QhRRRR/# )rK   r>   rL   rM   NonerO   )rP   s   "r   rQ   rR      s     " "{ "t "r   c                	2    V P                   \        V4       R # rT   )rA   r   rV   s   &&r   __delitem__SFNTReader.__delitem__   s    KKC!r   c                   V ^8  d   QhRR/# )rK   rM   rp   rO   )rP   s   "r   rQ   rR      s      t r   c                	:    V P                   P                  4        R # rT   )r+   closer\   s   &r   rv   SFNTReader.close   s    		r   c                	   \        V P                  \        4      '       d   V P                  # V P                  P	                  4       pVR  V P                  P
                  VR&   V P                  P                  4       VR&   V# )r+   	_filename_filepos)
isinstancer+   r   __dict__copynametellrC   states   & r   __getstate__SFNTReader.__getstate__   sd    dii))==  ""$&M!YY^^k IINN,jr   c                	    R V9  dK   \        VP                  R4      R4      V n        V P                  P                  VP                  R4      4       V P                  P                  V4       R# )r+   ry   rbrz   N)openpopr+   r   r|   updater   s   &&r   __setstate__SFNTReader.__setstate__   sL    UYY{3T:DIIINN599Z01U#r   )r0   r,   r+   r-   r.   r2   r   rA   N)    )__name__
__module____qualname____firstlineno__r   rH   rW   __contains__r[   rm   rr   rv   r   r   __static_attributes__rO   r   r   r   r       s7    #"23h" L"$"
$r   r   Fc                    ^ Tu;8:  d   ^	8:  g   M \        RV,          4      h\        '       d   V^ 8X  d   ^ RIHp V! W4      # ^ RIHp V! V \
        V,          R7      # )a1  Compress 'data' to Zlib format. If 'USE_ZOPFLI' variable is True,
zopfli is used instead of the zlib module.
The compression 'level' must be between 0 and 9. 1 gives best speed,
9 gives best compression (0 gives no compression at all).
The default value is a compromise between speed and compression (6).
zBad compression level: %s)compress)numiterations)
ValueError
USE_ZOPFLIzlibr   zopfli.zlibZOPFLI_LEVELS)rF   levelr   s   && r   r   r      sN     O!O4u<==:!!$$(M%,@AAr   c                  P    ] tR t^tR tRR ltR tR tR tR t	R t
R	 tR
 tRtR# )
SFNTWriterc                    RpV'       d   RV9   d   VR,          pM!V'       d   \        V4      ^8  d
   V^,          pV \        J d#   VR8X  d   ^ RIHp \        P                  V4      # \        P                  V 4      # )z`Return an instance of the SFNTWriter sub-class which is compatible
with the specified 'flavor'.
Nr-   woff2)WOFF2Writer)r5   r   r   r   r   r   )r   r   r   r-   r   s   &*,  r   r   SFNTWriter.__new__   sd     h&(H%Fc$i!m!WF* =~~k22~~c""r   Nc                	   Wn         W n        \        V4      V n        W@n        WPn        V P                  R 8X  dG   \        V n        \        V n	        \        V n        RV n        \        V\        ,          ,           V n        MmV P                  '       d   Q RV P                  ,          4       h\         V n        \        V n	        \"        V n        ^ RIHp V! V^4      w  V n        V n        V n        V P                   P/                  4       V n        V P0                  V P                  ,           W P                  P2                  ,          ,           V n        V P                   P7                  V P4                  4       V P                   P9                  RV P4                  V P                   P/                  4       ,
          ,          4       \;        4       V n        R# )r    wOFFUnknown flavor '%s'getSearchRange    N)r+   r<   r   r   r-   r.   r:   directoryFormatr9   directorySizer8   r0   	signaturer4   sfntDirectoryEntrySizeorigNextTableOffsetr7   r/   fontTools.ttLibr   searchRangeentrySelector
rangeShiftr   directoryOffset
formatSizenextTableOffsetr   writer
   rA   )rC   r+   r<   r   r-   r.   r   s   &&&&&& r   rH   SFNTWriter.__init__   sX    	"{+$;;& #6D !2D"4D#DN "I0F$FF $ {{{G$9DKK$GG?#6D !2D"4D6DR2EADd0$/  $yy~~/    !--8889 	 			t++,		!5!5		8H!HIJ!mr   c                	f    WP                   9   d   \        R V,          4      hW P                   V&   R# )cannot rewrite '%s' tableN)rA   r   )rC   r>   rG   s   &&&r   setEntrySFNTWriter.setEntry  s)    ++83>?? Cr   c                   WP                   9   d   \        RV,          4      hV P                  4       pWn        V P                  Vn        VR8X  d;   \        VR,          R,           VR,          ,           4      Vn        W n        RVn	        M\        V4      Vn        VP                  V P                  V4       V P                  R8X  dC   V P                  Vn        V ;P                  VP                  ^,           R
,          ,          un        V P                  VP                   ^,           R
,          ,           V n        V P                  P#                  RV P                  V P                  P%                  4       ,
          ,          4       V P                  V P                  P%                  4       8X  g   Q hV P'                  W4       R	# )zWrite raw table data to disk.r   ra   rb   rd   re   Tr    r   N)rA   r   r0   r>   r   r#   rh   ri   	headTableuncompressedsaveDatar+   r-   r   
origOffset
origLengthlengthr   r   r   )rC   r>   rF   rG   s   &&& r   __setitem__SFNTWriter.__setitem__  sA   ++83>??##%	++&=)$r([*@49*LMEN!N!%E)$/ENtyy$';;& #77E$$)9)9A)=(CC$#33q8HB7NO
 			!5!5		8H!HIJ##tyy~~'7777c!r   c                	(    V P                   V,          # rT   rU   rV   s   &&r   rm   SFNTWriter.__getitem__1  s    {{3r   c                :	   \        V P                  P                  4       4      p\        V4      V P                  8w  d(   \        RV P                  \        V4      3,          4      hV P                  R8X  Ed   RV n        ^ V n        ^V n	        V ;P                  ^\        V4      ,          ,          un	        V F6  w  r#V ;P                  VP                  ^,           R,          ,          un	        K8  	  V P                  '       d   V P                  M	\        4       pVP                  e2   VP                  e$   VP                  V n        VP                  V n        MV\        V R4      '       d7   \         P"                  ! RV P$                  R,          4      w  V n        V n        M^ ;V n        V n        VP&                  '       d   \        VP&                  4      V n        V P*                  P-                  ^ ^4       V P*                  P/                  4       V n        \3        VP&                  4      p\        V4      V n        V P*                  P7                  V4       M^ ;V n        ;V n        V n        VP8                  '       d   V P*                  P-                  ^ ^4       V P*                  P/                  4       pV^,           R,          pV P*                  P7                  RWv,
          ,          4       V P*                  P/                  4       V n        \        VP8                  4      V n        V P*                  P7                  VP8                  4       M^ ;V n        V n        V P*                  P-                  ^ ^4       V P*                  P/                  4       V n        M+V P                  '       d   Q R	V P                  ,          4       h \@        PB                  ! V PD                  V 4      pV P*                  P-                  V PF                  V PH                  ,           4       ^ p	V F$  w  r#VR
8X  d   ^p	WPK                  4       ,           pK&  	  V	'       d   V PM                  V4       V P*                  P-                  V PF                  4       V P*                  P7                  V4       R# )zDAll tables must have been written to disk. Now write the
directory.
z-wrong number of tables; expected %d, found %dr    r   Nr   z>HH:   rc   Nr   r   ra   r   )'r?   rA   r@   r5   r<   r   r-   r   reservedtotalSfntSizer   r.   rB   majorVersionminorVersionhasattrstructr6   r   metaDatametaOrigLengthr+   r   r   
metaOffsetr   
metaLengthr   privData
privOffset
privLengthr   r   packr   r   r   toStringwriteMasterChecksum)
rC   rA   r>   rG   rF   compressedMetaDataoff	paddedOff	directoryseenHeads
   &         r   rv   SFNTWriter.close4  sB    ))+,v;$..(?>>3v;/0 
 ;;& $DNDM!#D"s6{"22$
""u'7'7!';r&AA" % '+ooo4??>;KD  ,1B1B1N$($5$5!$($5$5!4--;A==t~~c2<8D%t'8 =>=D%(9}}}&)$--&8#		q!$"&)).."2%-dmm%<""%&8"9		 23JKKK$/D4G}}}		q!$iinn& 1WN			 9:"&)).."2"%dmm"4		.455$/IINN1a ))..*DK {{{G$9DKK$GG?LL!5!5t<			t++d.@.@@A JCf}!NN$44I ! $$Y/		t++,			"r   c                	r   . pV P                   P                  4        F/  pVP                  V P                   V,          P                  4       K1  	  V P                  \
        8w  d   ^ RIHp V! V P                  ^4      w  V n	        V n
        V n        \        P                  ! \        V 4      p\        V P                   P!                  4       4      pV Fi  w  r6\        4       pVP"                  Vn        VP                  Vn        VP$                  Vn        VP(                  Vn        WP-                  4       ,           pKk  	  \.        \1        V P                   4      \2        ,          ,           pV\1        V4      8X  g   Q hVP                  \5        V4      4       \7        V4      R,          p	RV	,
          R,          p
V
# )r   r       l   /ac )rA   r[   appendri   r0   r/   r   r   r<   r   r   r   r   r   r7   r?   r@   r>   r   r#   r   r   r   r4   r5   r   rh   sum)rC   r   	checksumsr>   r   rA   rG   	sfntEntrydirectory_endrl   checksumadjustments   &&         r   _calcMasterChecksumSFNTWriter._calcMasterChecksum{  sX   	;;##%CT[[-667 & "446DREADd0$/  %8$?IDKK--/0F$
.0	 %			%*^^	"#(#3#3	 #(#3#3	 %(:(:(<<	 % *C,<?U,UUI...i01y>J.(83zA!!r   c                	   V P                  V4      pV P                  P                  V P                  R ,          P                  ^,           4       V P                  P                  \        P                  ! RV4      4       R# )ra   z>LN)r   r+   r   rA   r#   r   r   r   )rC   r   r   s   && r   r   SFNTWriter.writeMasterChecksum  sS    !55i@		t{{6*11A56		D*<=>r   c                	    R # )FrO   r\   s   &r   reordersTablesSFNTWriter.reordersTables  s    r   )r0   r   r   r   r   r+   r-   r.   r   r   r   r   r   r   r   r   r<   r   r   r   r   r   r   r   r   rA   r   )r(   NN)r   r   r   r   r   rH   r   r   rm   rv   r   r   r   r   rO   r   r   r   r      s3    #$/$b!"< E#N"@?r   r   a  
		> # big endian
		TTCTag:                  4s # "ttcf"
		Version:                 L  # 0x00010000 or 0x00020000
		numFonts:                L  # number of fonts
		# OffsetTable[numFonts]: L  # array with offsets from beginning of file
		# ulDsigTag:             L  # version 2.0 only
		# ulDsigLength:          L  # version 2.0 only
		# ulDsigOffset:          L  # version 2.0 only
z
		> # big endian
		sfntVersion:    4s
		numTables:      H    # number of tables
		searchRange:    H    # (max2 <= numTables)*16
		entrySelector:  H    # log2(max2 <= numTables)
		rangeShift:     H    # numTables*16-searchRange
zc
		> # big endian
		tag:            4s
		checkSum:       L
		offset:         L
		length:         L
ab  
		> # big endian
		signature:      4s   # "wOFF"
		sfntVersion:    4s
		length:         L    # total woff file size
		numTables:      H    # number of tables
		reserved:       H    # set to 0
		totalSfntSize:  L    # uncompressed size
		majorVersion:   H    # major version of WOFF file
		minorVersion:   H    # minor version of WOFF file
		metaOffset:     L    # offset to metadata block
		metaLength:     L    # length of compressed metadata
		metaOrigLength: L    # length of uncompressed metadata
		privOffset:     L    # offset to private data block
		privLength:     L    # length of private data block
z
		> # big endian
		tag:            4s
		offset:         L
		length:         L    # compressed length
		origLength:     L    # original length
		checkSum:       L    # original checksum
c                  L    ] tR tRtR tR tR tR tR tR t	R t
R	 tR
 tRtR# )r0   i  c                	    R V n         R# )FN)r   r\   s   &r   rH   DirectoryEntry.__init__  s
    !r   c                	|    \         P                  ! V P                  VP                  V P                  4      V 4       R # rT   )r   r6   rP   r   r   )rC   r+   s   &&r   r=   DirectoryEntry.fromFile  s#    t{{DIIdoo$>Er   c                	H    \         P                  ! V P                  W4       R # rT   )r   r6   rP   )rC   strs   &&r   
fromStringDirectoryEntry.fromString  s    t{{C.r   c                	D    \         P                  ! V P                  V 4      # rT   )r   r   rP   r\   s   &r   r   DirectoryEntry.toString  s    ||DKK..r   c                	    \        V R 4      '       d4   RV P                  P                  V P                  \	        V 4      3,          # RV P                  P                  \	        V 4      3,          # )r>   z<%s '%s' at %x>z
<%s at %x>)r   	__class__r   r>   idr\   s   &r   __repr__DirectoryEntry.__repr__  sQ    4$(?(?2d8'TTT4>>#:#:BtH"EEEr   c                	   VP                  V P                  4       VP                  V P                  4      p\	        V4      V P                  8X  g   Q h\        V P                  R 4      '       d   V P                  V4      pV# )
decodeData)r   r#   r   r   r5   r   r   r   rC   r+   rF   s   && r   rg   DirectoryEntry.loadData  s^    		$++yy%4yDKK'''4>><00??4(Dr   c                	    \        V P                  R 4      '       d   V P                  V4      p\        V4      V n        VP                  V P                  4       VP                  V4       R# )
encodeDataN)r   r   r  r5   r   r   r#   r   r   s   &&&r   r   DirectoryEntry.saveData  sH    4>><00??4(D$i		$++

4r   c                	    V# rT   rO   )rC   rawDatas   &&r   r   DirectoryEntry.decodeData
  s    r   c                	    V# rT   rO   )rC   rF   s   &&r   r  DirectoryEntry.encodeData  s    r   )r   r   N)r   r   r   r   rH   r=   r   r   r   rg   r   r   r  r   rO   r   r   r0   r0     s1    "F//Fr   r0   c                      ] tR tRt]t]tRtR# )r/   i  rO   N)	r   r   r   r   sfntDirectoryEntryFormatrP   r   r   r   rO   r   r   r/   r/     s    %F'Jr   r/   c                  <   a  ] tR tRt]t]tV 3R ltR t	R t
RtV ;t# )r8   i  c                	r   < \         \        V `  4        \        \        R 4      '       g   \        V n        R# R# )zlibCompressionLevelN)superr8   rH   r   ZLIB_COMPRESSION_LEVELr  )rC   r   s   &r   rH   WOFFDirectoryEntry.__init__  s0     $02 )+ABB(>D% Cr   c                	    ^ RI pV P                  V P                  8X  d   TpV# V P                  V P                  8  g   Q hVP                  V4      p\	        V4      V P                  8X  g   Q hV# r   N)r   r   r   
decompressr5   )rC   r  r   rF   s   &&  r   r   WOFFDirectoryEntry.decodeData%  sb    ;;$//)D
  ;;000??7+Dt9///r   c                	   \        V4      V n        V P                  '       g   \        WP                  4      pV P                  '       g   \        X4      V P                  8  d   TpV P                  V n        V# Tp\        V4      V n        V# rT   )r5   r   r   r   r  r   )rC   rF   compressedDatar  s   &&  r   r  WOFFDirectoryEntry.encodeData0  ss    d)   %d,E,EFNN 3t FG//DK  %Gg,DKr   )r   r   r  )r   r   r   r   woffDirectoryEntryFormatrP   woffDirectoryEntrySizer   rH   r   r  r   __classcell__)r   s   @r   r8   r8     s!    %F'J	?	 r   r8   c                  *    ] tR tRtRtRR ltR tRtR# )rB   i>  r    Nc                	   R V n         R V n        R V n        R V n        V'       EdP   VP                   V n         VP                  V n        VP                  '       d   VP
                  P                  VP                  4       VP
                  P                  VP                  4      p\        V4      VP                  8X  g   Q hV P                  V4      p\        V4      VP                  8X  g   Q hW0n        VP                  '       do   VP
                  P                  VP                  4       VP
                  P                  VP                  4      p\        V4      VP                  8X  g   Q hW0n        R # R # R # rT   )r   r   r   r   r   r+   r   r   r   r5   _decompressr   r   r   )rC   readerr  rF   s   &&  r   rH   WOFFFlavorData.__init__A  s)     6 & 3 3D & 3 3D     !2!23 ++**6+<+<=7|v'8'8888''04yF$9$9999 $     !2!23{{''(9(9:4yF$5$5555 $	 ! r   c                	,    ^ RI pVP                  V4      # r  )r   r  )rC   r  r   s   && r   r  WOFFFlavorData._decompressV  s    w''r   )r   r   r   r   rT   )r   r   r   r   FlavorrH   r  r   rO   r   r   rB   rB   >  s    F%*(r   rB   c                l   \        V 4      ^,          pV'       d   V R^V,
          ,          ,          p ^ pRpV^,          ^ 8X  g   Q h\        ^ \        V 4      V4       FT  pWWC,            p\        P                  ! R\        V4      ^,          ,          V4      pV\	        V4      ,           R,          pKV  	  V# )a  Calculate the checksum for an arbitrary block of data.

If the data length is not a multiple of four, it assumes
it is to be padded with null byte.

        >>> print(calcChecksum(b"abcd"))
        1633837924
        >>> print(calcChecksum(b"abcdxyz"))
        3655064932
r   i   >%dLr   )r5   r;   r   r6   r   )rF   	remaindervalue	blockSizer$   blocklongss   &      r   rh   rh   \  s     D	AIY''EIq=A1c$i+'fE
a8%@U#z1 , Lr   c                D   V P                  ^ 4       V P                  \        4      p\        V4      \        8w  d   \	        R4      h\        4       p\        P                  ! \        W4       VP                  R8w  d   \	        R4      hVP                  R8X  g*   VP                  R8X  g   Q RVP                  ,          4       h\        P                  ! RVP                  ,          V P                  VP                  ^,          4      4      Vn        VP                  R8X  d    V# )r   r   ttcfzNot a Font Collection   i   zunrecognized TTC version 0x%08xr$  )r   r   ttcHeaderSizer5   r   r   r   r6   ttcHeaderFormatTTCTagVersionr   r2   r3   )r+   rF   rC   s   &  r   r1   r1   t  s    IIaL99]#D
4yM!BCCDNN?D/{{f011<<:%)C )DLL8C }}		$--!*; <D ||z!Kr   c                l   \        4       pR Vn        RVn        Wn        V P	                  ^ 4       V P                  \        P                  ! \        V4      4       V P                  4       pV P                  \        P                  ! RVP                  ,          .^ .VP                  ,          O5!  4       V# )r+  r,  r$  )r   r/  r0  r2   r   r   r   r   r.  r   r   )r+   r2   rC   r#   s   &&  r   writeTTCHeaderr2    s}    DDKDLMIIaLJJw||OT23YY[FJJv{{6DMM1JaS4==5HJKMr   __main__)5__doc__
__future__r   collections.abcr   ior   typesr   fontTools.misc.textToolsr   fontTools.miscr   r   r   r	   r   collectionsr
   logging	getLoggerr   rj   r   r   r  r   r   r   r   r.  calcsizer-  r7   r4   r
  r   r:   r9   r  r  r0   r/   r8   rB   rh   r1   r2  sysdoctestexittestmodfailedrO   r   r   <module>rD     s   # $  ! ( " B  #  !|$ |$@   
 qqqqrrrrs 0 B&Y Y|	   1  $$%89   !))*BC  " $$%89   !))*BC &V &R( (
% %P( (<0(	 zHHW__%%&	 r   