+
    i7                         ^ RI Ht ^ RIHtHt ^ RIHtHtHt ^ RI	H
t
HtHt ^RIHt ^RIHt ^RIHt ^RIHt ]! R	R
7       ! R R4      4       t]! R	R
7       ! R R4      4       t] ! R R4      4       tR# )    )Sequence)	dataclassfield)AnyUnioncast)ArrayObjectDictionaryObject
NameObject)get_encodingadobe_glyphs)logger_warning)	FontFlagsT)frozenc                   h   a  ] tR t^t o RtRtRtRtRtRt	Rt
RtRt^ t]! R R7      tV 3R	 ltR
tV tR# )FontDescriptorz
Represents the FontDescriptor dictionary as defined in the PDF specification.
This contains both descriptive and metric information.

The defaults are derived from the mean values of the 14 core fonts, rounded
to 100.
Unknowng     @g     @g     @@        c                     R# )g      Y@)g      Y      ig     @@g      @ r       Q/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/pypdf/_font.py<lambda>FontDescriptor.<lambda>!   s    Lkr   default_factoryc                   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[;R&   S[;R&   S[;R&   S[;R&   S[;R&   S[;R	&   S[S[S[S[S[3,          ;R
&   # )   namefamilyweightascentdescent
cap_heightx_heightitalic_angleflagsbbox)strfloatinttuple)format__classdict__s   "r   __annotate__FontDescriptor.__annotate__   s                 ! " # $ % & O' ( ueU*
+l) r   r   Nr   )__name__
__module____qualname____firstlineno____doc__r!   r"   r#   r$   r%   r&   r'   r(   r)   r   r*   __annotate_func____static_attributes____classdictcell__r0   s   @r   r   r      sK      DFFFGJHLE.3Dk.lD)  r   r   c                   ,   a  ] tR t^$t o V 3R ltRtV tR# )CoreFontMetricsc                H   < V ^8  d   Qh/ S[ ;R&   S[S[S[3,          ;R&   # )r    font_descriptorcharacter_widths)r   dictr+   r-   )r/   r0   s   "r   r1   CoreFontMetrics.__annotate__$   s%     ##  38n$ r   r   N)r3   r4   r5   r6   r8   r9   r:   r;   s   @r   r=   r=   $   s      r   r=   c                   (  a  ] tR t^*t o Rt]! ]R7      tRt]! ]	R7      t
]! R R7      t^tRt]V 3R lR l4       t]V 3R lR	 l4       t]V 3R
 lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltRV 3R lR lltV 3R ltRtV tR# )Fonta  
A font object for use during text extraction and for producing
text appearance streams.

Attributes:
    name: Font name, derived from font["/BaseFont"]
    character_map: The font's character map
    encoding: Font encoding
    sub_type: The font type, such as Type1, TrueType, or Type3.
    font_descriptor: Font metrics, including a mapping of characters to widths
    character_widths: A mapping of characters to widths
    space_width: The width of a space, or an approximation
    interpretable: Default True. If False, the font glyphs cannot
        be translated to characters, e.g. Type3 fonts that do not define
        a '/ToUnicode' mapping.

r   r   c                 
    R R/# )default  r   r   r   r   r   Font.<lambda>C   s
    iQTEUr   Tc          
         < V ^8  d   QhRS[ RS[S[S[3,          RS[S[S[S[S[3,          3,          RS[S[S[3,          RR/# )r    pdf_font_dictchar_mapencodingcurrent_widthsreturnN)r
   rA   r   r   r+   r-   )r/   r0   s   "r   r1   Font.__annotate__H   s]     6 6'6sCx.6 T#s(^+,6 S#X	6
 
6r   c                   \        \        V R,          4      pV P                  R^ 4      p\        V\        4      '       gW   TP                  \        V4       UUu/ uF-  w  rgVP                  We,           \        We,           4      4      VbK/  	  upp4       R# \        V4       F^  w  rgWe,           p\        V.4      P                  VR4      p	VP                  V	4      p
V
'       d   \        V4      W:&   KQ  \        V4      W9&   K`  	  R# u uppi )zcParses a TrueType or Type1 font's /Widths array from a font dictionary and updates character widths/Widthsz
/FirstCharNsurrogatepass)r   r	   get
isinstancer+   update	enumeratechrbytesdecoder-   )rJ   rK   rL   rM   widths_array
first_charidxwidth	char_coderaw_charunicode_chars   &&&&       r   _collect_tt_t1_character_widths$Font._collect_tt_t1_character_widthsG   s     Ky)AB"&&|Q7
(C((!!"+L"9#"9JC S-s33C/DEuL"9#   $L1JC(Ii[)00?KH#<<1L/25z,+.u:( 2#s   3D
c                \   < V ^8  d   QhRS[ RS[S[S[3,          RS[S[S[3,          RR/# )r    d_fontrK   rM   rN   N)r
   rA   r   r+   r-   )r/   r0   s   "r   r1   rO   h   sF     F F F,0cNFLPQTVYQYNF	Fr   c                   VP                  4        UUu/ uF)  w  r4\        V\        4      '       g   K  \        V4      VbK+  	  ppp^ pV P	                  R. 4      p\        V4       EF  w  rV	P                  4       p	V'       d   V^,          pK)  \        V	\        \        34      '       g   \        RV	 R2\        4       K[  Wx^,           ,          P                  4       p
\        V
\        4      '       d}   YrTP                  \        \        \        \        V4      \        \        V4      \!        V4      ,           ^4      V4       UUu/ uF  w  rW9   g   K  W],          VbK  	  upp4       ^pEK
  \        V
\        \        34      '       d   \        Wx^,           ,          P                  4       \        \        34      '       d   T	T
Wx^,           ,          P                  4       prTP                  \        \        \        V4      \        \        V^,           4      ^4       Uu/ uF  pW9   g   K  W],          VbK  	  up4       ^pEK  \        RV	 R2\        4       EK  	  R# u uppi u uppi u upi )zRParses the /W array from a DescendantFont dictionary and updates character widths.z/Wz&Expected numeric value for width, got z. Ignoring it.z-Invalid font width definition. Last element: .N)itemsrT   r+   ordrS   rV   
get_objectr-   r,   r   r3   r   rU   zipranger   len)rd   rK   rM   _target
_surrogateord_map
skip_count_wr\   w_entryw_next_entry	start_idx
width_list_cidx_widthstop_idxconst_widths   &&&              r   _collect_cid_character_widths"Font._collect_cid_character_widthsg   s:    (0~~'7
'7#'3' %CL*$'7 	 
 
ZZb!%bMLC((*Ga
gU|44 !GyP^_aijAg;113L,11(/:%% .1! $S) 4 $S) 4s: F !
 '..ME !+ /.. 
L3,77J7&&(3,= =  QwK**, &18
 %% &+ i0$sHqL2I1&&E !+	 43& 
 CG9ANg *
60s"   I I 
I&I&I,
,I,
c                @   < V ^8  d   QhRS[ S[S[3,          RS[RR/# )r    rM   r)   rN   N)rA   r+   r-   )r/   r0   s   "r   r1   rO      s/     d d4S> d# d$ dr   c                   V '       g   R V R&   R# RV 9   de   V R,          ^ 8w  dW   V\         P                  ,          \         P                  8X  d   V R,          V R&   R# \        ^V R,          ,          4      V R&   R# V P                  4        Uu. uF  q"^ 8  g   K  VNK  	  ppV'       d   \	        V4      \        V4      ,          MR V R&   R# u upi )rG   rF   N )r   FIXED_PITCHr-   valuessumrl   )rM   r)   wvalid_widthss   &&  r   _add_default_widthFont._add_default_width   s    (+N9%. ^C%8A%=	---)2G2GG,:3,?y)(+As0C,C(DN9% $2#8#8#:D#:a!e#:DNZC$5\9J$J`cy! Es   CCc                <   < V ^8  d   QhRS[ RS[S[S[3,          /# )r    font_descriptor_objrN   )r
   rA   r+   r   )r/   r0   s   "r   r1   rO      s%     & &4D &cSVh &r   c                    / pR F  w  r#W 9   g   K  W,          W&   K  	  RV9   d<   \        \        \        VR,          4      4      p\        V4      ^8X  g   Q V4       hWAR&   V# )	/FontNamer*   )
)r   r!   )z/FontFamilyr"   )z/FontWeightr#   )z/Ascentr$   )z/Descentr%   )z
/CapHeightr&   )z/XHeightr'   )z/ItalicAngler(   )z/Flagsr)   )	/FontBBoxr*   )r.   mapr,   rl   )r   font_descriptor_kwargs
source_key
target_key
bbox_tuples   &    r   _parse_font_descriptorFont._parse_font_descriptor   sr    13'
"J 05H5T&2'
 ++s5*@*HIJJz?a'33'-76*%%r   c                $   < V ^8  d   QhRS[ RR/# )r    rJ   rN   rD   r
   )r/   r0   s   "r   r1   rO      s#     S
 S
'S
 
S
r   c                P   ^ RI Hp VP                  RR4      P                  R4      pVP                  RR4      P                  R4      p\	        V4      w  rVRp/ pRp	VP                  R4      R9   Ed   VR8X  dn   R	V9  dg   \
        ;QJ d5    R
 VP                  R4      ;'       g    .  4       F  '       d   K   RM*	  RM&! R
 VP                  R4      ;'       g    .  4       4      p	V	'       Ed   RV9   d   V P                  WWX4       M*W29   d%   W#,          P                  pW#,          P                  pRV9   dt   VP                  R\        4       4      P                  4       p
RV
9   d)   \        \        V
R,          P                  4       4      VR&   \        R/ V P                  V
4      B pEM=RV9   dR   \        \!        \"        \        \$        VR,          4      4      4      p\'        V4      ^8X  g   Q V4       h\        W;R7      pM\)        \        \$        VR,          4      4       F  w  r\        \        VP                  4       4      pV\        \$        VR,          4      V&   V P+                  WV4       RV9   d)   \        \        VR,          P                  4       4      VR&   VP                  R\        4       4      P                  4       p
\        R/ V P                  V
4      B pK  	  V'       g   \        VR7      pVP                  R^ 4      ^ 8X  d   V P-                  WP.                  4       VP                  R^ 4      pV^ 8X  dO   VP.                  \0        P2                  ,          \0        P2                  8X  d   VR,          pMVR,          ^,          pV ! VVVVVVVV	R7      # )r   )CORE_FONT_METRICS	/BaseFontr   //SubtypeNTType3z
/ToUnicodec              3   4   "   T F  pV\         9   x  K  	  R # 5i)Nr   ).0cnames   & r   	<genexpr>*Font.from_font_resource.<locals>.<genexpr>   s      $!F \)!Fs   z
/CharProcsFrQ   z/FontDescriptorz/MissingWidthrF   r   )r!   r*   z/DescendantFontsz/DW)r!   r~   )r!   sub_typerL   r?   character_mapr@   space_widthinterpretable)/Type1z/MMType1z	/TrueTypez/Type3r   )pypdf._codecs.core_font_metricsr   rS   removeprefixr   allra   r?   r@   r
   ri   r   r-   r   r   r.   r   r,   r	   rl   rV   rz   r   r)   r   r   )clsrJ   r   r!   r   rL   r   r?   r@   r   r   r   
d_font_idxrd   r   s   &&             r   from_font_resourceFont.from_font_resource   sS   
 	F   i8EEcJ $$Z;HHM".}"=+- Z(,YY
 7"|='H # $!.!2!2<!@!F!FB!F$ $!.!2!2<!@!F!FB!F$ ! }-77%h .&7&=&M&MO'8'>'O'O$$5*7*;*;<MO_Oa*b*m*m*o'&*==6:3@STc@d@o@o@q6r(3&4&gs7Q7QRe7f&gO M1!&s5${MR]D^2_'`!aJz?a/;;/&4$&PO '0[-0B"CD'"
 .0A0A0CDSY[-0B"CDZP11+; F?26sF5M<T<T<V2W$Y/&,jj1BDTDV&W&b&b&d#"0"c33M3MNa3b"c' ,$7O	1-2""#35J5JK&**32!%%	(=(==)BWBWW.y9.y9Q>+'-#'	
 		
r   c                    < V ^8  d   QhRS[ /# )r    rN   r   )r/   r0   s   "r   r1   rO   1  s     

 

"2 

r   c                   \        \        R 4      \        R4      \        R4      \        RV P                   24      \        R4      \        R4      \        R4      \        RV P                   24      \        R4      \        R4      /4      # )	r   r   z/Namer   z/Typez/Fontr   z	/Encodingz/WinAnsiEncoding)r
   r   r!   )selfs   &r   as_font_resourceFont.as_font_resource1  sv     :&
8(<7#Z!DII;%@7#Z%8;'a		{O)D;'4F)G 	
r   c                &   < V ^8  d   QhRS[ RS[/# )r    textrN   )r+   r,   )r/   r0   s   "r   r1   rO   =  s     
 
s 
E 
r   c           
         \        V Uu. uF.  q P                  P                  W P                  R,          4      NK0  	  upR4      # u upi )zDSum of character widths specified in PDF font for the supplied text.rF   r   )r   r@   rS   )r   r   chars   && r   
text_widthFont.text_width=  sD    [_`[_SW""&&t-B-B9-MN[_`be
 	
`s   4Ac                   < V ^8  d   Qh/ S[ ;R&   S[S[ S[S[S[ 3,          3,          ;R&   S[S[S[3,          ;R&   S[ ;R&   S[;R&   S[S[ S[3,          ;R&   S[S[S[3,          ;R&   S[;R&   # )	r    r!   rL   r   r   r?   r@   r   r   )r+   r   rA   r-   r   r   r,   bool)r/   r0   s   "r   r1   rO   *   s     ( I) * Cc3h'((+ , S>?- . / 0 $K1 2 38nV3 4 ucz"(5 6 7 r   r   N) )r3   r4   r5   r6   r7   r   rA   r   r   r   r?   r@   r   r   staticmethodra   rz   r   r   classmethodr   r   r   r8   r9   r:   r;   s   @r   rD   rD   *   s     ( %*$$?MH&+N&KO',=U'V%(KM6 6> F FP d d$ & &. S
 S
j

 


 
g  r   rD   N)collections.abcr   dataclassesr   r   typingr   r   r   pypdf.genericr	   r
   r   _cmapr   _codecs.adobe_glyphsr   _utilsr   	constantsr   r   r=   rD   r   r   r   <module>r      s~    $ ( # # C C  . "   $m m m, $% % %
 V
 V
 V
r   