+
    bIiu                        R t Rt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
HtHtHtHtHtHtHt ^ RIHtHt ^ RIHtHt ^ RIHt R	t]P4                  P7                  4        ]P8                  t]P:                  t/ t/ t/ t / t! ! R
 R]"4      t# ! R R]"4      t$R t% ! R R4      t&R1R lt'R t( ! R R4      t). t* ! R R4      t+],! ^4      t-],! ^4      t.],! ^4      t/],! ^4      t0R t1Rs2 ! R R]&4      t3R t4R t5R2R lt6R t7R t8R t9R  t:R! t;];! R"4      t<]*P{                  ];! R#4      ]<.4       R1R$ lt>R1R% lt?R1R& lt@R' tAR3R( ltBR) tCR* tDR+ tER, tF]G! ]P                  4       ]P                  4       ] P                  4       ]!P                  4       R-7      3R. ltI^ R/IHJtJ ]J! ]I4       AJ]KR08X  d   ]F! 4        ]E! 4        R# R# )4z3.3.0a  This provides a database of font metric information and
efines Font, Encoding and TypeFace classes aimed at end users.

There are counterparts to some of these in pdfbase/pdfdoc.py, but
the latter focus on constructing the right PDF objects.  These
classes are declarative and focus on letting the user construct
and query font objects.

The module maintains a registry of font objects at run time.

It is independent of the canvas or any particular context.  It keeps
a registry of Font, TypeFace and Encoding objects.  Ideally these
would be pre-loaded, but due to a nasty circularity problem we
trap attempts to access them and do it on first access.
N)	_fontdata)warnOnce)	rl_isfilerl_globrl_isdiropen_and_readopen_and_readlinesfindInPathsisSeqisStr)defaultEncodingT1SearchPath)
unicode2T1instanceStringWidthT1)	rl_codecs   nc                       ] tR t^'tRtR# )	FontError N__name__
__module____qualname____firstlineno____static_attributes__r       څC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/pdfbase/pdfmetrics.pyr   r   '       r   r   c                       ] tR t^)tRtR# )FontNotFoundErrorr   Nr   r   r   r   r   r   )   r   r   r   c           	        \        V R4      p\        V4      ^8:  dC   V'       d   V^ ,          P                  R4      p\        V4      ^8:  d   \        RV ,          4      h/ p. pV Uu. uF  qDP	                  4       NK  	  ppV Uu. uF+  qDP                  4       P                  R4      '       d   K)  VNK-  	  pp^ pV EF  pVR,          R8X  d   ^pK  VR,          R8X  d   ^ pK(  V'       g   K2  VP                  R	4      pV Uu. uF  qP	                  4       NK  	  ppVR
,          w  rpV	P                  4       w  rLVR8X  g   Q RV,          4       h\        V4      pV
P                  4       w  rLVR8X  g   Q RV,          4       h \        V4      pVP                  4       w  rLVR8X  g   Q RV,          4       hTpVP                  WV34       EK  	  ^ pV Fe  pVR,          R8X  d   ^pVR,          R8X  d   ^ pK%  V'       g   K/  VR,          R8X  d     VP                  R^4      w  pp \        T4      pTTT&   Kg  	  W#3# u upi u upi u upi   \         d    \        T4      p Li ; i   \        RT : RT: R24      h; i    LT; i)a  Quick and dirty - gives back a top-level dictionary
with top-level items, and a 'widths' key containing
a dictionary of glyph names and widths.  Just enough
needed for embedding.  A better parser would accept
options for what data you wwanted, and preserve the
order.rzAFM file %s hasn't enough datacomment:       NStartCharMetrics:r$      NEndCharMetrics;:r$      NCzbad line in font file %sWXNStartFontMetrics:r$      NComment z Header information error in afm z: line='')
r   lensplit
ValueErrorstriplower
startswithintfloatappend)afmFileNamelinestopLevel
glyphLevell	inMetricslinechunkschunkcidChunk
widthChunk	nameChunkr!   cidwidthnameinHeaderleftrights   &                  r   parseAFMFilerN   ,   su    {C0E
5z1}%(...%u:q=>LMMHJ %&1WWYE&E1WWY%9%9)%DQQEEI:++I$Z++IYZZ_F178kkmF8.4Sk+H) >>#DA8>7$>>8a&C ##%DA9?84??9!A
 ??$DA8>7$>>8Ds4019 > H:++H:++HXCyI%th"jjQ/eE
 #HTN $ !!m 'E 9  !a!*h T_ae!fggsB   'H?&I0II	II*(JI'&I'*J Jc                   <   a  ] tR t^ut o R tR tR tRR ltRtV t	R# )TypeFacec                   Wn         . V n        / V n        ^ V n        ^ V n        RV n        ^ V n        ^ V n        VR8X  d	   RV n        MVR8X  d	   RV n        MRV n        V\        9   d   ^V n
        V P                  V4       R# ^ V n
        R# )r$   NZapfDingbatsZapfDingbatsEncodingSymbolSymbolEncoding)rJ   
glyphNamesglyphWidthsascentdescent
familyNamebolditalicrequiredEncodingstandardFontsbuiltIn_loadBuiltInDataselfrJ   s   &&r   __init__TypeFace.__init__v   s    	
 	>!$:D!X$4D!$(D!= DL!!$'DLr   c                    \        V4      p\        P                  V,          V n        \	        V P                  P                  4       4      V n        \        P                  V,          w  V n        V n	        R# )zyCalled for the built in 14 fonts.  Gets their glyph data.
We presume they never change so this can be a shared reference.N)
strr   widthsByFontGlyphrW   listkeysrV   ascent_descentrX   rY   ra   s   &&r   r`   TypeFace._loadBuiltInData   sT     4y$66t<t//4467#,#;#;D#A DLr   c                    . # )z=Info function, return list of the font files this depends on.r   rb   s   &r   getFontFilesTypeFace.getFontFiles   s    	r   c                   VP                  4       VP                  4       3p\        V R 4      '       d[   \        P                  P                  V P                  4      ^ ,          pV F$  p\        W4,           4      '       g   K  W4,           u # 	   \        P                  ! V P                  4      pXf   \        RT: RT P                  : R24       T#    \        T P                  4      pT'       d~   TP                  4       R8X  dP   T FG  p\        P                  P                  T4      ^ ,          T,           p\        T4      '       d   TpKE  RpKI  	   LTP                  4       R8X  d   Tp LRp L; i)pfbFileName.pfbNz.afmzCan't find z for face 'r2   )r7   upperhasattrospathsplitextrq   r   r   
findT1FilerJ   bruteForceSearchForAFMr   )rb   extpossible_exts
r_basenameer!   afmpfbs   &&      r   rx   TypeFace.findT1File   s   ciik24&&))$*:*:;A>J"Z^,,%>) #	$$TYY/A 9c499EF!	(3C99;&(* gg..s3A6:$S>> #A $A + YY[F*As    C BE2E2.E2)
rX   r[   r_   rY   rZ   rV   rW   r\   rJ   r]   N)rr   )
r   r   r   r   rc   r`   rn   rx   r   __classdictcell____classdict__s   @r   rP   rP   u   s     4B r   rP   c                    Vf   ^ RI Hp \        V 4      '       d   V # \        P                  P                  V 4      pV FJ  p\        V4      '       g   K  \        P                  P                  W24      p\        V4      '       g   KH  Vu # 	  V # )Nr   )reportlab.rl_configr   r   ru   rv   basenamer   join)fn
searchPathbfndirnametfns   &&   r   bruteForceSearchForFiler      si    U}}Ri
''

2
C  (ggll7'S>>#:  Ir   c           	        ^ RI Hp V Fh  p\        V4      '       g   K  \        V\        P
                  ,           R,           4      pV F%  p \        V4      w  rVVR,          V 8X  d   Vu u # K'  	  Kj  	  R#    \        P                  ! 4       w  rxp	RP                  \        \        TP                  4      4      RT ,          ,           3Tn        h ; i)z_Looks in all AFM files on path for face with given name.

Returns AFM file name or None.  Ouch!r   z*.[aA][fF][mM]FontNamer1   z, while looking for faceName=%rN)r   r   r   r   ru   seprN   sysexc_infor   maprf   args)
faceNamer   r   	possiblespossibletopDict	glyphDicttvbs
   &         r   ry   ry      s     1  (Gbff,/??@	!H%1(%;":&(2#O 3 "  llnA((3s166?34UX`4``bs   A77ACc                   X   a  ] tR t^t o RtRR ltR tR tR tR t	R t
R	 tR
 tRtV tR# )Encodingz1Object to help you create and refer to encodings.Nc                d   Wn         ^ V n        V\        9   d0   Ve   Q R4       hWn        \        P
                  V,          V n        R# VR8X  d.   \        V n        \        P
                  \        ,          V n        R# \        V4      '       d7   \        V4      pVP                   V n        VP                  R,          V n        R# \        V4      '       d   \        V n        VR,          V n        R# \        V\        4      '       d,   VP                   V n        VP                  R,          V n        R# R# )r$   Nz2Can't have a base encoding for a standard encoding:NNN)rJ   frozenstandardEncodingsbaseEncodingNamer   	encodingsvectorr   r   getEncodingr
   
isinstancer   )rb   rJ   basebaseEncs   &&& r   rc   Encoding.__init__   s    	$$<U!UU<$(!#--d3DKT\$3D!#--o>DK4[[!$'G$+LLD!!..+DK4[[$3D!q'DKh''$(IID!++a.DK (r   c                (    V P                   V,          # )z.Return glyph name for that code point, or None)r   )rb   indexs   &&r   __getitem__Encoding.__getitem__   s     {{5!!r   c                    V P                   ^ 8X  g   Q R4       hV P                  V,          V8w  d,   \        V P                  4      pW#V&   \        V4      V n        R# R# )r$   Cannot modify a frozen encodingN)r   r   rh   tuple)rb   r   valueLs   &&& r   __setitem__Encoding.__setitem__   sP    {{aB!BB;;uu$T[[!AeH(DK %r   c                H    \        V P                  4      V n        ^V n        R# )   N)r   r   r   rm   s   &r   freezeEncoding.freeze   s    DKK(r   c                    V P                   VP                   8H  ;'       d,    \        V P                  4      \        VP                  4      8H  # N)rJ   r   r   )rb   others   &&r   isEqualEncoding.isEqual  s4    yy%**$PPt{{);U5<<=P)PPr   c                z    V P                   ^ 8X  g   Q R4       hTpV F  pW@P                  V&   V^,           pK  	  R# )zASet a group of character names starting at the code point 'base'.r   N)r   r   )rb   r   newNamesidxrJ   s   &&&  r   modifyRangeEncoding.modifyRange  s>    {{aB!BBD#KK'C r   c                l   . pRp\        \        V P                  4      4       Ft  pV P                  V,          pWQP                  V,          8X  d    V'       d   VP                  V4       . pKJ  KL  V'       d   VP                  V4       Kg  V'       g   Kq  WE.pKv  	  V'       d   VP                  V4       V# )a  
Return a compact list of the code points differing between two encodings

This is in the Adobe format: list of
   [[b1, name1, name2, name3],
   [b2, name4]]
   
where b1...bn is the starting code point, and the glyph names following
are assigned consecutive code points.

N)ranger3   r   r;   )rb   otherEncrangescurRangeiglyphs   &&    r   getDifferencesEncoding.getDifferences  s     s4;;'(AKKNEooa((MM(+!H  OOE*U !zH ) MM(#r   c                   ^ RI Hp / pV P                  p\        V4      pV P	                  V4      pV. 8X  d   VP                  V4      # . pV FI  pVP                  V^ ,          4       VR,           F!  pVf   K	  VP                  RV,           4       K#  	  KK  	  VP                  V4      VR&   VR9   d   VP                  V4      VR&   VP                  R4      VR&   VP                  V4      p	V	# )	z&Returns a PDF Object representing selfpdfdoc:r   NN/DifferencesBaseEncodingr   Type)MacRomanEncodingMacExpertEncodingWinAnsiEncoding)	reportlab.pdfbaser   r   r   r   PDFNamer;   PDFArrayPDFDictionary)
rb   r   Dr   r   differences	diffArrayr   	glyphNamePDs
   &         r   makePDFObjectEncoding.makePDFObject,  s     	-00./))'2 ">>"233 I$  q*!&rI ,!((y9 "+ %  &y9Am#]]$*NN3C$D.!z2AfI%%a(BIr   )r   r   rJ   r   r   )r   r   r   r   __doc__rc   r   r   r   r   r   r   r   r   r   r   s   @r   r   r      s6     ;)."
#Q< r   r   c                   \   a  ] tR tRt o Rt^ t^ tRtRR ltRR lt	R t
R tR	 tR
 tRtV tR# )FontiQ  a0  Represents a font (i.e combination of face and encoding).

Defines suitable machinery for single byte fonts.  This is
a concrete class which can handle the basic built-in fonts;
not clear yet if embedded ones need a new font class or
just a new typeface class (which would do the job through
composition)FNc                H   Wn         \        V4      ;qPn        \        V4      V n        W0n        VP                  '       d   VP                  f   \        MT;'       g    . V n	        V P                  4        \        V n        VR8H  ;'       d    T ;'       g    \        V n        R # )NrR   )fontNamegetTypeFacefacer   encodingencNamer_   r]   standardT1SubstitutionFontssubstitutionFonts_calcWidths_notdefChar_notdefFont)rb   rJ   r   r   r   r   s   &&&&& r   rc   Font.__init__^  s    &x00y"7+'+|||8M8M8U #>):)@)@b 	 	&/88DGGKr   c                    \        WW#R 7      # )r   )r   )rb   textsizer   s   &&&&r   stringWidthFont.stringWidthj  s    $TIIr   c                h    R V P                   P                  : RV P                  P                  : R2# )<r1   >)	__class__r   r   rJ   rm   s   &r   __repr__Font.__repr__m  s     NN33TYY^^DDr   c           	        ^ .R,          pV P                   P                  pV P                  P                  p\	        R4       F  pW4,          pVf   K   W%,          pWaV&   K   	  Wn        R#   \
         dP    ^ RIpTP                  P                  '       d,   \        RT P                   P                  : RT: R24        K   K  i ; i)z)Vector of widths for stringWidth function   Nz
typeface "z" does not have a glyph "z", bad font!)r   rW   r   r   r   KeyErrorr   	rl_configwarnOnMissingFontGlyphsprintrJ   widths)rb   wgwvecr   r   rI   	reportlabs   &       r   r   Font._calcWidthsp  s     C#IYY""mm""sAI$ME aD     . **BBBW[W`W`WeWegpqrs   A,,*C(CCc                    Rp\        R4       F`  pVR,           \        \        V P                  V,          4      R4      ,           pV^8X  d
   VR,           pV^,          ^8X  g   KW  VR,           pKb  	  V# )z<returns a pretty block in PDF Array format to aid inspection   [r       utf8s    ]   
)r   bytesrf   r  )rb   r   r   s   &  r   _formatWidthsFont._formatWidths  sb    sA$;s4;;q>':6!BBDCxe|2v|e|  r   c                   ^ RI Hp R\        \        VP                  4      ^,           4      ,           pVP                  4       pW4n        V P                  P                  Vn	        RV P                  ,          Vn        V P                  P                  4       p\        V4      '       d   VR9   d   WTn        V P                  P                  \         9   gO   ^ Vn        ^Vn        VP'                  V P(                  4      Vn        V P                  P-                  V4      Vn        VP1                  WC4      pVP2                  R,          P4                  pWGV&   RV,           VP                  V P                  &   R# )zMakes and returns one or more PDF objects to be added
to the document.  The caller supplies the internal name
to be used (typically F1, F2... in sequence) r   FzFont %s
BasicFontsr   N)z/MacRomanEncodingz/MacExpertEncodingz/WinAnsiEncoding)r   r   reprr3   fontMappingPDFType1FontNamer   rJ   BaseFontr   __Comment__r   r   r   r   r^   	FirstCharLastCharr   r  Widths
addObjectsFontDescriptor	Reference
idToObjectdict)rb   docr   internalNamepdfFontr}   reffontDicts   &&      r   r  Font.addObjects  s   
 	- T#coo"6q"899%%'#99>>'$--7MM'')Qxx1 ]]  yy~~. !G"G#__T[[9GN%)YY%9%9#%>G"mmG2 >>,/44!( *-|);&r   )r   r   r   r   r   r   r   r  r   r  )r   r   r   r   r   
_multiByte_dynamicFontshapablerc   r   r   r   r  r  r   r   r   s   @r   r   r   Q  sA      JLH
HJE(	 <  <r   r   c                 ^   \        W,          4      \        8w  g   \        W^,           ,          4      V8w  dB   \        RV\        \        4      \        V4      WV ,          W^,           ,          3,          4      hV\        8X  d   R# V ^,           p W^,           ,          ^,          W^,           ,          ^,          ,          W^,           ,          ,          ^,          W,          ,          pV ^,           p W,           \        V4      8  d   \        RW0V\        V4      3,          4      hW V,           3# )r   zGBad pfb file'%s' expected chr(%d)chr(%d) at char %d, got chr(%d)chr(%d)Nz1Bad pfb file'%s' needed %d+%d bytes have only %d!)chr
PFB_MARKERr5   ordPFB_EOFr3   )pdmr   r@   s   &&&& r   	_pfbCheckr4    s   
14y*AcFQdhjknoykz{~  @A  |B  CD  GH  EI  JK  NO  LO  JP  hQ  Q  R  	R'z6	AAsVaK!aC&1$q1v
.	2QT:A	AAs3q6zNRTWXY\]^Y_Q``aac6Mr   c                   B   a  ] tR tRt o RtR tR tR tR tR t	Rt
V tR	# )
EmbeddedType1Facei  z_A Type 1 font other than one of the basic 14.

Its glyph data will be embedded in the PDF file.c                T   \         P                  V R 4       \        V\        4      p\        V\        4      p\        P
                  P                  V4      V n        \        P
                  P                  V4      V n        R V n	        V P                  V4       V P                  V4       R # r   )rP   rc   r	   r   ru   rv   abspathr<   rq   r]   _loadGlyphs_loadMetrics)rb   r<   rq   s   &&&r   rc   EmbeddedType1Face.__init__  sz    $% "+l;!+l;77??;777??;7 $%+&r   c                2    V P                   V P                  .# r   )r<   rq   rm   s   &r   rn   EmbeddedType1Face.getFontFiles  s      $"2"233r   c                   \        V4      p\        V4      '       g   Q RV,          4       h\        VR4      p\        ^ V\        V4      w  r4\        WB\
        V4      w  rV\        Wb\        V4      w  rx\        W\        V4       W#V W%V ,           W'V ,           V n        \        V P                  4      V n	        WC,
          V n
        We,
          V n        W,
          V n        R# )zaLoads in binary glyph data, and finds the four length
measurements needed for the font descriptorzfile %s not foundr   N)r   r   r   r4  	PFB_ASCII
PFB_BINARYr0  _binaryDatar3   _length_length1_length2_length3)	rb   rq   r2  s1l1s2l2s3l3s	   &&       r   r9  EmbeddedType1Face._loadGlyphs  s     .k:%%H':['HH%+s+1Qy52
;72	+6"w{+8AH,Q"X54++,r   c                   \        V4      p\        V4      w  r#VR,          V n        VR,          V n        VP	                  RR4      V n        VP	                  R^ 4      V n        VP	                  RR4      V n        VP	                  R^ 4      V n        VP	                  R^ 4      V n	        VP	                  R	R4      V n
        VP	                  R
. RO4      pVP                  4       p. V n        V F'  pV P                  P                  \        V4      4       K)  	  / pV F
  w  rp
WV
&   K  	  Wpn        \!        VP#                  4       4      V n        V P$                  P'                  4        VP	                  RR4      R8X  d   \(        f    ^ RIHp Vs?R.R,          p/ p/ pV FC  w  rp
^ Tu;8:  d
   ^8:  g   K  M K  WV&   \(        P	                  V
R4      pVf   K;  VW&   WV&   KE  	  \0        P2                  ! RV P                  ,          4      p\4        P6                  P9                  VW4       VV n        \=        VV4      p\?        V4       R# R#    / s\/        R4      h; i)z Loads in and parses font metricsr   
FamilyNameAscender  	Descender	CapHeightItalicAnglestemVXHeightFontBBoxEncodingSchemeNFontSpecific)_glyphname2unicodezcannot import module reportlab.pdfbase._glyphlist module
you can obtain a version from here
https://www.reportlab.com/ftp/_glyphlist.py
r   zrl-dynamic-%s-encoding)r$   r$   rP  rP  ) r   rN   rJ   rZ   getrX   rY   	capHeightitalicAnglerT  xHeightr4   bboxr;   r9   rW   rh   ri   rV   sort_postScriptNames2Unicodereportlab.pdfbase._glyphlistrY  r5   r   normalize_encodingr   	RL_Codecsadd_dynamic_codecr]   r   registerEncoding)rb   r<   r>   	glyphDatastrBboxtokenstokrW   rH   rI   rJ   rY  namesexrexcodeur   encs   &&                 r   r:  EmbeddedType1Face._loadMetrics  s+    .k: ,[ 9Z(	"<0ll:t4||K3!k48#<<q9\\'1-
||It4,,z?;	CIISX&  "+S % #,&{//12 <<($/>A'/
O/A,* FSLEBC'0#dd<C<<"&$K044T$?A}$%	 $1 (1  223Kdii3WXG11'"A$+D!7E*CS!; B/1,$L s   	I Ic                   ^ RI Hp VP                  4       pV P                  Vn        V P
                  VP                  R&   V P                  VP                  R&   V P                  VP                  R&   VP                  VRV P                  ,           4      pVP                  RRRV P                  R	V P                  R
V P                  R^"RVP                  V P                   4      RVP#                  V P$                  4      RV P&                  RV P(                  RV P*                  RV/4      pVP                  VRV P$                  ,           4      pV# )zFAdd whatever needed to PDF file, and return a FontDescriptor referencer   Length1Length2Length3z	fontFile:r   z/FontDescriptorAscentrR  DescentFlagsrV  r   rS  StemVrU  FontFilezfontDescriptor:)r   r   	PDFStreamrA  contentrC  
dictionaryrD  rE  r  rq   r   rX   r[  rY   r   r^  r   rJ   r\  rT  r]  )rb   r"  r   fontFilefontFileReffontDescriptorfontDescriptorRefs   &&     r   r  EmbeddedType1Face.addObjects%  s   ,##%++)-I&)-I&)-I& mmHkD<L<L.LM--%T[[dllRvtyy1v~~dii0$**DJJdll/   MM.:Kdii:WX  r   )rA  rB  rC  rD  rE  r<   rX   r^  r[  rY   rZ   rV   rW   r\  rJ   rq   r]   rT  r]  N)r   r   r   r   r   rc   rn   r9  r:  r  r   r   r   s   @r   r6  r6    s)     8'4$;"z! !r   r6  c                     \        V \        4      '       g   Q R V ,          4       hV \        V P                  &   V P                  \        9   g   \        V P                  4       R# R# )zNot a TypeFace: %sN)r   rP   
_typefacesrJ   r^   registerFontFamily)r   s   &r   registerTypeFacer  C  sM    dH%%B';d'BB% Jtyy99% 	499% &r   c                 r   \        V \        4      '       g   Q R V ,          4       hV P                  \        9   d[   V P	                  \        V P                  ,          4      '       d   V P                  4        R# \        RV P                  ,          4      hV \        V P                  &   V P                  4        R# )zNot an Encoding: %sz>Encoding "%s" already registered with a different name vector!N)r   r   rJ   
_encodingsr   r   r   )ro  s   &r   re  re  K  s|    c8$$A&;c&AA$
xx:;;z#((+,,JJL\_b_g_gghh"
388

r   c                 J   ^ RI Hp V'       g   T pV P                  4       p V'       g   T;'       g    T;'       g    TpV'       g   TpV'       g   TpVP                  V ^ ^ V4       VP                  V ^^ V4       VP                  V ^ ^V4       VP                  V ^^V4       R# )r$   )fontsN)reportlab.libr  r7   
addMapping)familynormalr[   r\   
boldItalicr  s   &&&&& r   r  r  X  s    #F6\\^FF$<$<d$<$<fzF6	VQ6*	VQ4(	VQ6*	VQ:.r   c                   V P                   pV P                  '       d   V P                  P                  pV\        9  d^   V\
        9   dA   \
        V,          pVP                  '       g   \        RV: RV : RV: 24      hV\        V&   MV ;\
        V&   \        V&   M	V \        V&   V P                  '       d   \        V P                   4       R# R# )zGRegisters a font, including setting up info for accelerated stringWidthzAttempt to register fonts r1   z
 for face N)	r   r*  r   rJ   _fonts_dynFaceNamesr5   r)  r  )fontr   r   ofonts   &   r   registerFontr  d  s     }}H99>>6!=(%h/)))$V[]ack%lmm',F8$=AAh'&*:x 	4==)	 r   c                    \         V ,          #   \         d    T \        9   dE   \        T 4      p\        P
                  T ,          w  Tn        Tn        Tn        \        T4       Tu # \        T 4      pT'       d   R FC  p\        P                  P                  T4      ^ ,          T,           p\        T4      '       g   KC   M	  \        X4      '       g   Q RT,          4       h\        Y$4      p\        T4       Tu # h i ; i)z-Lazily construct known typefaces if not foundzfile %s not found!)rr   z.PFB)r  r   r^   rP   r   standardFontAttributesrZ   r[   r\   r  ry   ru   rv   rw   r   r6  )r   r   r~   r}   r   s   &    r   r   r   |  s    (## }$H%D8A8X8XYa8b5T_diT" K )2C)A''**3/2Q6C ~~u * !~~A';c'AA~(2 &+s    AD )AD ;D >D c                     \         V ,          #   \         d(    T \        9   d   \        T 4      p\	        T4       Tu # h i ; i)z-Lazily construct known encodings if not found)r  r   r   r   re  )r   ro  s   & r   r   r     sD    	'"" ''7#CS!Js    .AAc                   \        V 4      p \        V 4      \         J g   Q R\        V 4      ,          4       h\        V 4      pVP                  '       d   \        W VP                  4      pM\        W \        4      p\        V4       V# )z-search for and register a font given its namez$fontName=%s is not required type str)rf   typeasciir   r]   r   r   r  )r   r   r  s   &  r   findFontAndRegisterr    sp    8}H>S Z"H5QY?"ZZ  x DH(=(=>H8Kr   c                V     \         V ,          #   \         d    \        T 4      u # i ; i)zLazily constructs known fonts if not found.

Names of form 'face-encoding' will be built if
face and encoding are known.  Also if the name is
just one of the standard 14, it will make up a font
in the default encoding.)r  r   r  )r   s   &r   getFontr    s,    -h -"8,,-s    ((rR   rT   c                     \        V 4      p VP                  pVP                  pT'       d   TR ,          pY5,          YE,          3# Y43#    TP                  P                  pTP                  P                  p LT; i)g     @@)r  rX   rY   r   )r   fontSizer  rX   rY   norms   &&    r   getAscentDescentr    sm    8D$,, ~{GL(($!!))##s   A	 	.A9c                 &    \        W4      ^ ,          # )r$   r  r   r  s   &&r   	getAscentr        H.q11r   c                 &    \        W4      ^,          # )r   r  r  s   &&r   
getDescentr    r  r   c                 `    \        \        P                  4       4      p V P                  4        V # )zReturns what's in there)rh   r  ri   r_  )regs    r   getRegisteredFontNamesr    s     
v{{}
CHHJJr   c                :    \        V4      P                  WVR7      # )zfCompute width of string in points;
not accelerated as fast enough because of instanceStringWidthT1/TTFr   )r  r   )r   r   r  r   s   &&&&r   r   r     s     8((((KKr   c            
         \        R 4       \        \        P                  4       4      p V P	                  4        V  F  p\        RV4       K  	  \        4        \        R4       \        \
        P                  4       4      pVP	                  4        V F  p\        RV4       K  	  \        4        \        R4       \        \        P                  4       4      pVP	                  4        V FZ  p\        V,          p\        RVP                  : RVP                  P                  : RVP                  P                  : R24       K\  	  R# )	zRegistered Encodings:z   zRegistered Typefaces:zRegistered Fonts:z    z (r   )N)r  rh   r  ri   r_  r  r  r   r   rJ   r   )ri   r   facesr   kkeyr  s          r   dumpFontDatar    s    	
!"
!"DIIKeG  
G	
!""#E	JJLeH  
G	
V[[]AFFHc{$--ASASTU r   c                    ^ RI p\        R,           F  pVP                  4       p\        V4      P                  pV  F&  p^ pV F  pWd\	        V4      ,          ,           pK  	  K(  	  VP                  4       p\        RW,
          ,          4       VP                  4       pV  F  p\        V4      P                  V^
4      p	K   	  VP                  4       p\        RW,
          ,          4       \        4        K  	  R# )r$   N:r$   r   Nzslow stringWidth took %0.4fz'class lookup and stringWidth took %0.4f)timer^   r  r  r/  r  r   )
textsr  r   t0r  r   rI  cht1rK  s
   &         r   test3widthsr    s    !#&& YY[H$$DBCG*_   YY[+rw78YY[D"..tR8B YY[727CD+ 'r   c                  `   \        R 4      P                  4       p \        R\        V 4      ,          4       \        R4       \	        V .4       \        4        V P                  4       p\        R\        V4      R\        V 4      ,          \        V4      ,          3,          4       \	        V4       R# )z-../../rlextra/rml2pdf/doc/rml_user_guide.prepzrawdata length %dztest one huge string...z7test %d shorter strings (average length %0.2f chars)...g      ?N)openreadr  r3   r  r4   )rawdatawordss     r   testStringWidthAlgorithmsr    s    BCHHJG	
G
,-	
#$		GMMOE	
Cs5zSVWZ[bWcScdghmdnSnFo
opr   c                      \        R 4      p \        V 4       \        V P                  R,          4       \        R4      p\        VP                  4       \        V4       \	        4        R# )	Helvetica:r$      NWombatN)rP   r  r  rV   r  )helvwombats     r   testr    sJ    K DT	$//$
 hF	&

VNr   )r  r  r  r  c                     V P                  4        F7  w  r\        4       V,          pVP                  4        VP                  V4       K9  	  \        P
                  P                  4        R # r   )itemsglobalsclearupdater   rc  reset_dynamic_codecs)initial_dictsr  r   r2  s   &   r   _resetr  (  sL     ""$
)A,			 % ,,.r   )register_reset__main__r   )NNNNr(  )L__version__r   ru   r   r   r   r   reportlab.lib.loggerr   reportlab.lib.utilsr   r   r   r   r   r	   r
   r   r   r   r   reportlab.lib.rl_accelr   r   r   r   rc  registerr^   r   r  r  r  r  	Exceptionr   r   rN   rP   r   ry   r   r   r   r-  r.  r?  r@  r0  r4  r`  r6  r  re  r  r  r   r   r  r  r   extendr  r  r  r  r   r  r  r  r  r!  copyr  r  r   r   r   r   <module>r     s  
 	   ' ) z z z = D ' 	     ''// 

			 			 	G"R@ @D0q qn ! ^< ^<@ t9

a&	q6
A	   ! !B&

/*06
- n%  " "GH$5k#B C22L
V.4	 #*#*[[])..0	/ / v ZF r   