
    F j9                         S r SSKJr  SSKJrJrJr  SSKJrJrJ	r	  SSK
JrJrJrJrJr  SSKJrJrJr  SSKJrJrJr  \" S5      r\" S5      r\" S5      r\" S	S
9 " S S5      5       r\r " S S5      rS	S	S	S	S.rg)a]  
Mixin class for managing a stack of graphics state variables.

The contents of this module are internal to fpdf2, and not part of the public API.
They may change at any time without prior warning or any deprecation period,
in non-backward-compatible ways.

Usage documentation at: <https://py-pdf.github.io/fpdf2/Internals.html#graphicsstatemixin>
    )copy)	dataclassfieldfields)TYPE_CHECKINGAnyOptional   )
ColorInput
DeviceCMYK
DeviceGray	DeviceRGBconvert_to_device_color)CharVPosTextEmphasisTextMode)CoreFontFontFaceTTFFontT)slotsc                   (   \ rS rSr% Sr\r\\\	-  \
-     \S'   \r\\\	-  \
-     \S'   \r\\\	-  \
-     \S'   Sr\\S'   Sr\\S'   S	r\\S
'   Sr\\S'   Sr\\S'   S	r\\S'   Sr\\S'   Sr\\\-     \S'   Sr\\S'   \" S S9r\ \\4   \S'   Sr!\\S'   \"RF                  r$\"\S'   \%RL                  r'\%\S'   Sr(\\S'   Sr)\\S'   Sr*\\S'   Sr+\\S'   S r,\\S!'   S"r-\\S#'   S$r.\\S%'   S&r/\\S''   Sr0\\ \\14      \S('   S-S* jr2S)\ \\14   4S+ jr3S,r4g).GraphicsState   zPMutable snapshot of the current graphics state for fragments and local contexts.
draw_color
fill_color
text_colorF	underlinestrikethrough 
font_styled   font_stretchingr   char_spacingfont_familyfont_size_ptNcurrent_fontcurrent_font_is_set_on_pagec                      [        SSSS9$ )Nr   )dashgapphase)dict     d/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/fpdf/graphics_state.py<lambda>GraphicsState.<lambda>/   s    !! <r.   )default_factorydash_pattern
line_width	text_mode	char_vposgffffff?	sub_scale	sup_scaleg      ?	nom_scaledenom_scaleg333333ÿsub_liftg?sup_liftg?nom_liftg        
denom_lifttext_shapingreturnc                 P    [        U 5      n[        UR                  5      Ul        U$ N)r   r?   )self	new_states     r/   r   GraphicsState.copy>   s$    J	!%i&<&<!=	r.   c                     [        U 5       Vs0 s H#  nUR                  [        XR                  5      _M%     sn$ s  snf rB   )r   namegetattr)rC   state_fields     r/   	as_kwargsGraphicsState.as_kwargsC   sC      &d|
+ gd,<,<==+
 	
 
s   *;r-   )r@   r   )5__name__
__module____qualname____firstlineno____doc___DEFAULT_DRAW_COLORr   r	   r   r   r   __annotations___DEFAULT_FILL_COLORr   _DEFAULT_TEXT_COLORr   r   boolr   r    strr"   floatr#   r$   r%   r&   r   r   r'   r   r3   r,   r4   r   FILLr5   r   LINEr6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r   r   rJ   __static_attributes__r-   r.   r/   r   r      sz   Z@SJZ/*<=S@SJZ/*<=S@SJZ/*<=SItM4J OU L%KL%15L(8g-.5(--%*<&L$sEz"  J"--Ix'"--Ix'IuIuIuKHeHeHeJ-1L(4S>*1

4S> 
r.   r   c                     ^  \ rS rSrSr\r\r\	r
S\S\SS4U 4S jjrSDS\\   S\4S	 jjrS\4S
 jrS\4S jrS\4S jr\S\\\-  \-     4S j5       r\R2                  S\\   SS4S j5       r\S\\\-  \-     4S j5       r\R2                  S\\   SS4S j5       r\S\\\-  \-     4S j5       r\R2                  S\\   SS4S j5       r\S\4S j5       r\R2                  S\SS4S j5       r\S\4S j5       r\R2                  S\SS4S j5       r\S\4S j5       r \ R2                  S\SS4S j5       r \S\!4S j5       r"\"R2                  S\!SS4S j5       r"\S\!4S j5       r#\#R2                  S\!SS4S j5       r#\S\4S j5       r$\$R2                  S\SS4S j5       r$\S\!4S  j5       r%\%R2                  S\!SS4S! j5       r%\S\!4S" j5       r&\&R2                  S\!SS4S# j5       r&\S\\'\(-     4S$ j5       r)\)R2                  S\'\(-  SS4S% j5       r)\S\4S& j5       r*\*R2                  S\SS4S' j5       r*\S\+\\!4   4S( j5       r,\,R2                  S\+\\!4   SS4S) j5       r,\S\!4S* j5       r-\-R2                  S\!SS4S+ j5       r-\S\.4S, j5       r/\/R2                  S\.\-  \0-  SS4S- j5       r/\S\14S. j5       r2\2R2                  S\1\-  SS4S/ j5       r2\S\!4S0 j5       r3\3R2                  S\!SS4S1 j5       r3\S\!4S2 j5       r4\4R2                  S\!SS4S3 j5       r4\S\!4S4 j5       r5\5R2                  S\!SS4S5 j5       r5\S\!4S6 j5       r6\6R2                  S\!SS4S7 j5       r6\S\!4S8 j5       r7\7R2                  S\!SS4S9 j5       r7\S\!4S: j5       r8\8R2                  S\!SS4S; j5       r8\S\!4S< j5       r9\9R2                  S\!SS4S= j5       r9\S\!4S> j5       r:\:R2                  S\!SS4S? j5       r:\S\\+\\4      4S@ j5       r;\;R2                  S\\+\\4      SS4SA j5       r;S\<4SB jr=SCr>U =r?$ )EGraphicsStateMixinM   a}  Mixin class for managing a stack of graphics state variables.

To the subclassing library and its users, the variables look like
normal instance attributes. But by the magic of properties, we can
push and pop levels as needed, and users will always see and modify
just the current version.

This class is mixed in by fpdf.FPDF(), and is not meant to be used
directly by user code.
argskwargsr@   Nc                 F   > [        5       /U l        [        TU ]  " U0 UD6  g rB   )r   _GraphicsStateMixin__statestacksuper__init__)rC   r^   r_   	__class__s      r/   rc   GraphicsStateMixin.__init__]   s"    3@?2C$)&)r.   newc                 b    Uc  U R                  5       nU R                  R                  U5        U$ )z"Push a graphics state on the stack)_get_current_graphics_statera   append)rC   rf   s     r/   _push_local_stack$GraphicsStateMixin._push_local_stacka   s.    ;224C  %
r.   c                 6    U R                   R                  5       $ )z(Pop the last graphics state on the stack)ra   poprC   s    r/   _pop_local_stack#GraphicsStateMixin._pop_local_stackh   s      $$&&r.   c                 <    U R                   S   R                  5       $ )z#Retrieve the current graphics state)ra   r   rn   s    r/   rh   .GraphicsStateMixin._get_current_graphics_statel   s      $))++r.   c                 2    [        U R                  5      S:  $ )z-Indicate if a nested graphics state is activer
   )lenra   rn   s    r/   !_is_current_graphics_state_nested4GraphicsStateMixin._is_current_graphics_state_nestedp   s    4$$%))r.   c                 4    U R                   S   R                  $ Nrr   )ra   r   rn   s    r/   r   GraphicsStateMixin.draw_colort         $///r.   vc                 H    Uc  S O
[        U5      U R                  S   l        g ry   )r   ra   r   rC   r|   s     r/   r   rz   x   &     ID#:1#= 	"(r.   c                 4    U R                   S   R                  $ ry   )ra   r   rn   s    r/   r   GraphicsStateMixin.fill_color   r{   r.   c                 H    Uc  S O
[        U5      U R                  S   l        g ry   )r   ra   r   r~   s     r/   r   r      r   r.   c                 4    U R                   S   R                  $ ry   )ra   r   rn   s    r/   r   GraphicsStateMixin.text_color   r{   r.   c                 H    Uc  S O
[        U5      U R                  S   l        g ry   )r   ra   r   r~   s     r/   r   r      r   r.   c                 4    U R                   S   R                  $ ry   ra   r   rn   s    r/   r   GraphicsStateMixin.underline         $...r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r   r      s    *+"'r.   c                 4    U R                   S   R                  $ ry   ra   r   rn   s    r/   r    GraphicsStateMixin.strikethrough   s      $222r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r   r      s    ./"+r.   c                 4    U R                   S   R                  $ ry   ra   r    rn   s    r/   r    GraphicsStateMixin.font_style   r{   r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r    r          +,"(r.   c                 4    U R                   S   R                  $ ry   ra   r"   rn   s    r/   r"   "GraphicsStateMixin.font_stretching   s      $444r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r"   r      s    01"-r.   c                 4    U R                   S   R                  $ ry   ra   r#   rn   s    r/   r#   GraphicsStateMixin.char_spacing         $111r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r#   r          -."*r.   c                 4    U R                   S   R                  $ ry   ra   r$   rn   s    r/   r$   GraphicsStateMixin.font_family   s      $000r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r$   r      s    ,-")r.   c                 4    U R                   S   R                  $ ry   ra   r%   rn   s    r/   r%   GraphicsStateMixin.font_size_pt   r   r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r%   r      r   r.   c                     [         (       a!  [        U R                  [        5      (       d   eU R                  S   R
                  U R                  -  $ ry   )r   
isinstancekrW   ra   r%   rn   s    r/   	font_sizeGraphicsStateMixin.font_size   s>    =dffe,,,,  $11DFF::r.   c                 D    XR                   -  U R                  S   l        g ry   )r   ra   r%   r~   s     r/   r   r      s    -.Z"*r.   c                 4    U R                   S   R                  $ ry   ra   r&   rn   s    r/   r&   GraphicsStateMixin.current_font   r   r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r&   r      r   r.   c                 4    U R                   S   R                  $ ry   ra   r'   rn   s    r/   r'   .GraphicsStateMixin.current_font_is_set_on_page   s      $@@@r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r'   r      s    <="9r.   c                 4    U R                   S   R                  $ ry   ra   r3   rn   s    r/   r3   GraphicsStateMixin.dash_pattern   r   r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r3   r      r   r.   c                 4    U R                   S   R                  $ ry   ra   r4   rn   s    r/   r4   GraphicsStateMixin.line_width   r{   r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r4   r      r   r.   c                 4    U R                   S   R                  $ ry   )ra   r5   rn   s    r/   r5   GraphicsStateMixin.text_mode   r   r.   c                 T    [         R                  " U5      U R                  S   l        g ry   )r   coercera   r5   r~   s     r/   r5   r     s    *2//!*<"'r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )z
Return vertical character position relative to line.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r6   r   rn   s    r/   r6   GraphicsStateMixin.char_vpos  sD     =d//3==xHHHH  $...r.   c                 T    [         R                  " U5      U R                  S   l        g)z~
Set vertical character position relative to line.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)r   r   ra   r6   r~   s     r/   r6   r     s      +3//!*<"'r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zt
Return scale factor for subscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r7   rW   rn   s    r/   r7   GraphicsStateMixin.sub_scale  D     =d//3==uEEEE  $...r.   c                 >    [        U5      U R                  S   l        g)zq
Set scale factor for subscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r7   r~   s     r/   r7   r   !       +0("'r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zv
Return scale factor for superscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r8   rW   rn   s    r/   r8   GraphicsStateMixin.sup_scale)  r   r.   c                 >    [        U5      U R                  S   l        g)zs
Set scale factor for superscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r8   r~   s     r/   r8   r   3  r   r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zt
Return scale factor for nominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r9   rW   rn   s    r/   r9   GraphicsStateMixin.nom_scale;  r   r.   c                 >    [        U5      U R                  S   l        g)zq
Set scale factor for nominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r9   r~   s     r/   r9   r   E  r   r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zv
Return scale factor for denominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r:   rW   rn   s    r/   r:   GraphicsStateMixin.denom_scaleM  sD     =d//3??GGGG  $000r.   c                 >    [        U5      U R                  S   l        g)zs
Set scale factor for denominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r:   r~   s     r/   r:   r   W  s     -2!H")r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zs
Return lift factor for subscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r;   rW   rn   s    r/   r;   GraphicsStateMixin.sub_lift_  D     =d//3<<eDDDD  $---r.   c                 >    [        U5      U R                  S   l        g)zp
Set lift factor for subscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r;   r~   s     r/   r;   r   i       */q"&r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zu
Return lift factor for superscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r<   rW   rn   s    r/   r<   GraphicsStateMixin.sup_liftq  r   r.   c                 >    [        U5      U R                  S   l        g)zr
Set lift factor for superscript text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r<   r~   s     r/   r<   r   {  r   r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zs
Return lift factor for nominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r=   rW   rn   s    r/   r=   GraphicsStateMixin.nom_lift  r   r.   c                 >    [        U5      U R                  S   l        g)zp
Set lift factor for nominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r=   r~   s     r/   r=   r     r   r.   c                     [         (       a.  [        U R                  S   R                  [        5      (       d   eU R                  S   R                  $ )zu
Return lift factor for denominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   )r   r   ra   r>   rW   rn   s    r/   r>   GraphicsStateMixin.denom_lift  sD     =d//3>>FFFF  $///r.   c                 >    [        U5      U R                  S   l        g)zr
Set lift factor for denominator text.
([docs](../TextStyling.html#subscript-superscript-and-fractional-numbers))
rr   N)rW   ra   r>   r~   s     r/   r>   r     s     ,18"(r.   c                 4    U R                   S   R                  $ ry   ra   r?   rn   s    r/   r?   GraphicsStateMixin.text_shaping  r   r.   c                 *    XR                   S   l        g ry   r   r~   s     r/   r?   r     r   r.   c                    [        U R                  [        R                  " U R                  5      U R
                  U R                  U R                  :w  a  U R                  OSU R                  U R                  :w  a  U R                  S9$ SS9$ )zd
Return a `fpdf.fonts.FontFace` instance
representing a subset of properties of this GraphicsState.
N)familyemphasissize_ptcolorr   )
r   r$   r   r   r    r%   r   DEFAULT_TEXT_COLORr   DEFAULT_FILL_COLORrn   s    r/   	font_faceGraphicsStateMixin.font_face  s{    
 ##!((9%%#'??d6M6M#MSW $(??d6M6M#M

 
	
 TX

 
	
r.   )__statestackrB   )@rL   rM   rN   rO   rP   rQ   DEFAULT_DRAW_COLORrS   r   rT   r   r   rc   r	   StateStackTyperj   ro   rh   rU   rv   propertyr   r   r   r   setterr   r   r   r   r   rV   r    rW   r"   r#   r$   r%   r   r   r   r&   r'   r,   r3   r4   r   r5   intr   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r   r   rZ   __classcell__)rd   s   @r/   r\   r\   M   s   	 -,,*c *S *T *Xn%=  '. ',^ ,*4 * 0HY%;j%HI 0 0 
J
 

 
 0HY%;j%HI 0 0 
J
 

 
 0HY%;j%HI 0 0 
J
 

 
 /4 / / ,4 ,D , , 3t 3 3 0t 0 0 0 0C 0 0 -C -D - - 5 5 5 2 24 2 2 2e 2 2 /e / / / 1S 1 1 .S .T . . 2e 2 2 /e / / / ;5 ; ;
 85 8T 8 8 2hx''9: 2 2 /h0 /T / / AT A A !''>T >d > (> 2d3:. 2 2 /d3:. /4 / / 0E 0 0 -E -d - - /8 / / =8c>C/ =D = = /8 / / =8c> =d = = /5 / / 35 3T 3 3 /5 / / 35 3T 3 3 /5 / / 35 3T 3 3 1U 1 1 5U 5t 5 5 .% . . __2% 2D 2 2 .% . . __2% 2D 2 2 .% . . __2% 2D 2 2 0E 0 0 4E 4d 4 4 2htCH~6 2 2 /htCH~6 /4 / /
8 
 
r.   r\   )z$GraphicsStateMixin._push_local_stackz#GraphicsStateMixin._pop_local_stackz.GraphicsStateMixin._get_current_graphics_statez4GraphicsStateMixin._is_current_graphics_state_nestedN)rP   r   dataclassesr   r   r   typingr   r   r	   drawing_primitivesr   r   r   r   r   enumsr   r   r   fontsr   r   r   rQ   rS   rT   r   r   r\   __pdoc__r-   r.   r/   <module>r      s     0 0 / /  4 3 . . m  m  m  (
 (
 (
V q
 q
j -1+/6:<@	r.   