+
    IV-j[  ã            	       óš  € R t ^ RIt^ RIt^ RIHt ^ RIHtHtHtH	t	 ^ RI
t
 ^ RIHtHtHt Rt ^ RIt. R!OtR. R"ORRR.RR.RRR./tRtRtRt ! R R]4      t ! R R]4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R	]4      t ! R  R
]4      tR#   ] d    Rt Lyi ; i  ] d     ^ RIt L†  ] d    Rt  L’i ; ii ; i)#z¾
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~

Formatter for Pixmap output.

:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
N)Ú	Formatter)Úget_bool_optÚget_int_optÚget_list_optÚget_choice_opt)ÚImageÚ	ImageDrawÚ	ImageFontTFÚImageFormatterÚGifImageFormatterÚJpgImageFormatterÚBmpImageFormatterÚNORMALÚITALICÚObliqueÚItalicÚBOLDÚBoldÚ
BOLDITALICzBold ObliquezBold ItaliczDejaVu Sans MonozCourier NewÚMenloc                   ó   € ] tR t^4tRtRtR# )ÚPilNotAvailablez,When Python imaging library is not available© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Úh/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/pygments/formatters/img.pyr   r   4   s   † Ý6r    r   c                   ó   € ] tR t^8tRtRtR# )ÚFontNotFoundz(When there are no usable fonts specifiedr   Nr   r   r    r!   r#   r#   8   s   † Ý2r    r#   c                   ón   a € ] tR t^<t o RtRR ltR tR tR tR t	RR lt
R tR	 tR
 tR tR tRtV tR# )ÚFontManagerz6
Manages a set of fonts: normal, italic, bold, etc...
c                ó¬  € Wn         W n        / V n        R V n        RV n        \        VR4      '       g&   \        P                  P                  V4      '       dE   \        P                  ! WP                  4      pRV n        \         F  pW0P                  V&   K  	  R # \        P                  P                  R4      '       d&   V'       g   \        V n         V P!                  4        R # \        P                  P                  R4      '       d&   V'       g   \"        V n         V P%                  4        R # V'       g   \&        V n         V P)                  4        R # )NFÚreadTÚwinÚdarwin)Ú	font_nameÚ	font_sizeÚfontsÚencodingÚvariableÚhasattrÚosÚpathÚisfiler	   ÚtruetypeÚSTYLESÚsysÚplatformÚ
startswithÚDEFAULT_FONT_NAME_WINÚ_create_winÚDEFAULT_FONT_NAME_MACÚ_create_macÚDEFAULT_FONT_NAME_NIXÚ_create_nix)Úselfr*   r+   ÚfontÚstyles   &&&  r!   Ú__init__ÚFontManager.__init__A   sâ   € Ø"ŒØ"ŒØˆŒ
ØˆŒØˆŒÜ�9˜f×%Ò%¬¯©¯©¸	×)BÒ)BÜ×%Ò% i·±Ó@ˆDØ ˆDŒMß�Ø$(—
‘
˜5Ó!ñ  ñ ä�<‰<×"Ñ" 5×)Ò)ßÜ!6�”Ø×ÑÖÜ�\‰\×$Ñ$ X×.Ò.ßÜ!6�”Ø×ÑÖçÜ!6�”Ø×ÑÖr    c                ó„  € \         P                  ! R V RV 2R.\         P                  RR7      pVP                  4       w  rEVP                  ^ 8X  dn   VP                  4       pV FU  pVP                  R4      '       d   K  VP                  4       P                  4       P                  R4      pV'       g   KS  Vu # 	  R# R# )zfc-listz:style=ÚfileN)ÚstdoutÚstderrs   Fontconfig warning:Ú:)	Ú
subprocessÚPopenÚPIPEÚcommunicateÚ
returncodeÚ
splitlinesr7   ÚdecodeÚstrip)	r>   Únamer@   ÚprocrE   Ú_ÚlinesÚliner1   s	   &&&      r!   Ú_get_nix_font_pathÚFontManager._get_nix_font_path\   sª   € Ü×Ò ¨t¨f°G¸E¸7Ð,CÀVÐ LÜ'1§¡¸tôEˆà×$Ñ$Ó&‰	ˆØ�?‰?˜aÔØ×%Ñ%Ó'ˆEÛ�Ø—?‘?Ð#9×:Ò:ÙØ—{‘{“}×*Ñ*Ó,×2Ñ2°3Ó7�ß‘4Ø’Kñ ñ ñ  r    c                ój  € \         R ,           FR  pV P                  V P                  V4      pVf   K%  \        P                  ! W P
                  4      V P                  R &    M	  \        RV P                   R24      hR F°  p\         V,           FS  pV P                  V P                  V4      pVf   K%  \        P                  ! W P
                  4      V P                  V&    Ke  	  VR8X  d#   V P                  R,          V P                  V&   K�  V P                  R ,          V P                  V&   K²  	  R# )r   NúNo usable fonts named: "Ú"r   r   ©r   r   r   )r4   rU   r*   r	   r3   r+   r,   r#   )r>   rP   r1   r@   Ú	stylenames   &    r!   r=   ÚFontManager._create_nixj   sú   € Ü˜8×$Ð$ˆDØ×*Ñ*¨4¯>©>¸4Ó@ˆDØÔÜ'0×'9Ò'9¸$ÇÁÓ'O�—
‘
˜8Ñ$Ùñ	 %ô Ð!9¸$¿.¹.Ð9IÈÐKÓLÐLÛ5ˆEÜ# EŸ]˜]�	Ø×.Ñ.¨t¯~©~¸yÓI�ØÔ#Ü(1×(:Ò(:¸4ÇÁÓ(P�D—J‘J˜uÑ%Úñ	 +ð ˜LÔ(Ø(,¯
©
°6Õ(:�D—J‘J˜uÓ%à(,¯
©
°8Õ(<�D—J‘J˜uÓ%ó 6r    c                óx   € VP                  VR ,           V,           P                  4       P                  4       4      # )Ú )ÚgetrO   Úlower)r>   Úfont_maprP   r@   s   &&&&r!   Ú_get_mac_font_pathÚFontManager._get_mac_font_path~   s,   € Ø�|‰|˜T C�Z¨%Õ/×6Ñ6Ó8×>Ñ>Ó@ÓAÐAr    c                óJ  a€ / p\         P                  P                  \         P                  ! R 4      R4      RR3 F2  oVP	                  V3R l\         P
                  ! S4       4       4       K4  	  \        R,           FR  pV P                  WP                  V4      pVf   K%  \        P                  ! W0P                  4      V P                  R&    M	  \        RV P                   R24      hR F°  p\        V,           FS  pV P                  WP                  V4      pVf   K%  \        P                  ! W0P                  4      V P                  V&    Ke  	  VR
8X  d#   V P                  R	,          V P                  V&   K�  V P                  R,          V P                  V&   K²  	  R# )ÚHOMEzLibrary/Fonts/z/Library/Fonts/z/System/Library/Fonts/c              3   ó2  <"  € T FŒ  w   rV F€  pVP                  4       P                  R4      '       g   K*  \        P                  P	                  V4      ^ ,          P                  4       \        P                  P                  SV4      3x € K‚  	  KŽ  	  R# 5i)ÚttfN)rg   Úttc)r`   Úendswithr0   r1   ÚsplitextÚjoin)Ú.0rR   ÚfilesÚfÚfont_dirs   &   €r!   Ú	<genexpr>Ú*FontManager._create_mac.<locals>.<genexpr>…   sr   øé € ð 7á#4‘K�A�qÛ�AØ—7‘7“9×%Ñ% n×5ô L”—‘×!Ñ! !Ó$ QÕ'×-Ñ-Ó/´·±·±¸hÈÓ1JÕKáñ LÛ#4ùs   ƒ/B·A Br   NrX   rY   r   r   rZ   )r0   r1   rk   ÚgetenvÚupdateÚwalkr4   rb   r*   r	   r3   r+   r,   r#   )r>   ra   rP   r1   r@   r[   ro   s   &     @r!   r;   ÚFontManager._create_mac�   sT  ø€ ØˆÜŸ™Ÿ™¤b§i¢i°Ó&7Ð9IÓJØ*Ð,DóFˆHà�O‰Oô 7ä#%§7¢7¨8Ô#4ó7ö 7ñFô ˜8×$Ð$ˆDØ×*Ñ*¨8·^±^ÀTÓJˆDØÔÜ'0×'9Ò'9¸$ÇÁÓ'O�—
‘
˜8Ñ$Ùñ	 %ô Ð!9¸$¿.¹.Ð9IÈÐKÓLÐLÛ5ˆEÜ# EŸ]˜]�	Ø×.Ñ.¨x¿¹ÈÓS�ØÔ#Ü(1×(:Ò(:¸4ÇÁÓ(P�D—J‘J˜uÑ%Úñ	 +ð ˜LÔ(Ø(,¯
©
°6Õ(:�D—J‘J˜uÓ%à(,¯
©
°8Õ(<�D—J‘J˜uÓ%ó 6r    c                ó  € R FL  pV FC  p RP                  Y&;'       d
    RV,           V4      p\        P                  ! W4      w  r‰Vu u # 	  KN  	  V'       d   \	        RV RV^ ,           R24      hR#   \         d     K|  i ; i)Ú z{}{}{}r^   zFont z (z) not found in registryN)rw   z (TrueType))ÚformatÚ_winregÚQueryValueExÚOSErrorr#   )
r>   ÚkeyÚbasenameÚstylesÚfailÚsuffixr@   ÚvalnameÚvalrR   s
   &&&&&     r!   Ú_lookup_winÚFontManager._lookup_winž   s‰   € Û)ˆFÛ�ðØ&Ÿo™o¨h×8KÐ8KÀ#ÀeÅ)ÈVÓT�GÜ$×1Ò1°#Ó?‘F�CØ”Jó	  ñ *÷ Ü" U¨8¨*°B°v¸aµy°kÐAXÐ#YÓZÐZÙøô ô Úðús   ŒA6 (A6Á6BÂBc                óú  € R p\         P                  R3\         P                  R3\         P                  R3\         P                  R3.pV EF6  p \         P                  ! V!  p V P	                  W@P
                  \        R,          R4      p\        P                  ! WPP                  4      V P                  R&   R Fª  pV P	                  W@P
                  \        V,          4      pV'       d0   \        P                  ! WPP                  4      V P                  V&   Ka  VR8X  d#   V P                  R,          V P                  V&   KŠ  V P                  R,          V P                  V&   K¬  	   \         P                  ! V4        R # 	  V'       d   Vh\        R4      h  \         d   pTp R p?MR p?ii ; i \         P                  ! T4       EK„    \         P                  ! T4       i ; i  \         d     EK®  i ; i)	Nz2Software\Microsoft\Windows NT\CurrentVersion\Fontsz/Software\Microsoft\Windows\CurrentVersion\Fontsr   Tr   r   z$Can't open Windows font registry keyrZ   )ry   ÚHKEY_CURRENT_USERÚHKEY_LOCAL_MACHINEÚOpenKeyrƒ   r*   r4   r	   r3   r+   r,   ÚCloseKeyr#   r{   )r>   ÚlookuperrorÚkeynamesÚkeynamer|   r1   r@   Úerrs   &       r!   r9   ÚFontManager._create_win¬   s™  € ØˆÜ×/Ñ/Ð1fÐgÜ×/Ñ/Ð1cÐdÜ×0Ñ0Ð2gÐhÜ×0Ñ0Ð2dÐeðhˆô  ˆGðÜ—o’o wÑ/�ð*Ø×+Ñ+¨C·±ÄÈÕAQÐSWÓX�DÜ+4×+=Ò+=¸dÇNÁNÓ+S�D—J‘J˜xÑ(Û!A˜Ø#×/Ñ/°·^±^ÄVÈEÅ]ÓS˜ßÜ09×0BÒ0BÀ4ÏÉÓ0X˜DŸJ™J uÓ-à$¨Ô4Ø48·J±J¸vÕ4F §
¡
¨5Ó 1à48·J±J¸xÕ4H §
¡
¨5Ó 1ñ "Bð ô ×$Ò$ S×)ñ'  ÷: Ø!Ð!ÜÐFÓGÐGøô $ô &Ø"%•Kûð&úØä×$Ò$ S×)ø”G×$Ò$ SÕ)ûÜô ÛðúsO   ÁG*Á%DFÅ+G*ÆF2Æ&F-Æ(GÆ-F2Æ2GÆ6G*ÇG'Ç'G*Ç*G:Ç9G:c                ó$   € V P                  R4      # )z
Get the character size.
ÚM)Úget_text_size©r>   s   &r!   Úget_char_sizeÚFontManager.get_char_sizeÓ   s   € ð ×!Ñ! #Ó&Ð&r    c                óž   € V P                   R,          p\        VR4      '       d   VP                  V4      R,          # VP                  V4      # )z$
Get the text size (width, height).
r   Úgetbbox:é   é   N)r,   r/   r–   Úgetsize)r>   Útextr?   s   && r!   r‘   ÚFontManager.get_text_sizeÙ   sB   € ð �z‰z˜(Õ#ˆÜ�4˜×#Ò#Ø—<‘< Ó% cÕ*Ð*à—<‘< Ó%Ð%r    c                óò  € V'       d?   V'       d7   V P                   '       d   V P                  R4      # V P                  R,          # V'       d7   V P                   '       d   V P                  R4      # V P                  R,          # V'       d7   V P                   '       d   V P                  R4      # V P                  R,          # V P                   '       d   V P                  R4      # V P                  R,          # )z.
Get the font based on bold and italic flags.
r   r   r   r   )r.   Ú	get_styler,   )r>   ÚboldÚobliques   &&&r!   Úget_fontÚFontManager.get_fontã   s«   € ÷ —GØ�}�}ˆ}Ø—~‘~ lÓ3Ð3à—:‘:˜lÕ+Ð+ßØ�}�}ˆ}Ø—~‘~ fÓ-Ð-à—:‘:˜fÕ%Ð%ßØ�}�}ˆ}Ø—~‘~ hÓ/Ð/à—:‘:˜hÕ'Ð'à�}�}ˆ}Ø—~‘~ hÓ/Ð/à—:‘:˜hÕ'Ð'r    c                óÀ   € V P                   V,          p\        V,           F  p VP                  V4       Vu # 	  V#   \         d     K+  \         d    Tu u # i ; i)ze
Get the specified style of the font if it is a variable font.
If not found, return the normal font.
)r,   r4   Úset_variation_by_nameÚ
ValueErrorr{   )r>   r@   r?   Ú
style_names   &&  r!   r�   ÚFontManager.get_styleü   sb   € ð
 �z‰z˜%Õ ˆÜ  Ÿ-˜-ˆJðØ×*Ñ*¨:Ô6Ø’ñ (ð ˆøô ô ÚÜô Ø”ðús   ¥>¾AÁAÁAÁA)r-   r*   r+   r,   r.   N)é   )F)r   r   r   r   r   rA   rU   r=   rb   r;   rƒ   r9   r“   r‘   r    r�   r   Ú__classdictcell__©Ú__classdict__s   @r!   r%   r%   <   sI   ø‡ € ñôò6ò=ò(Bò=ô:ò%HòN'ò&ò(÷2ð r    r%   c                   ó®   a € ] tR tRt o RtRt. ROtR.tRtRt	R t
RR 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 tR tR tR tRtV tR# )r
   i  a#	  
Create a PNG image from source code. This uses the Python Imaging Library to
generate a pixmap from the source code.

.. versionadded:: 0.10

Additional options accepted:

`image_format`
    An image format to output to that is recognised by PIL, these include:

    * "PNG" (default)
    * "JPEG"
    * "BMP"
    * "GIF"

`line_pad`
    The extra spacing (in pixels) between each line of text.

    Default: 2

`font_name`
    The font name to be used as the base font from which others, such as
    bold and italic fonts will be generated.  This really should be a
    monospace font to look sane.
    If a filename or a file-like object is specified, the user must
    provide different styles of the font.

    Default: "Courier New" on Windows, "Menlo" on Mac OS, and
             "DejaVu Sans Mono" on \*nix

`font_size`
    The font size in points to be used.

    Default: 14

`image_pad`
    The padding, in pixels to be used at each edge of the resulting image.

    Default: 10

`line_numbers`
    Whether line numbers should be shown: True/False

    Default: True

`line_number_start`
    The line number of the first line.

    Default: 1

`line_number_step`
    The step used when printing line numbers.

    Default: 1

`line_number_bg`
    The background colour (in "#123456" format) of the line number bar, or
    None to use the style background color.

    Default: "#eed"

`line_number_fg`
    The text color of the line numbers (in "#123456"-like format).

    Default: "#886"

`line_number_chars`
    The number of columns of line numbers allowable in the line number
    margin.

    Default: 2

`line_number_bold`
    Whether line numbers will be bold: True/False

    Default: False

`line_number_italic`
    Whether line numbers will be italicized: True/False

    Default: False

`line_number_separator`
    Whether a line will be drawn between the line number area and the
    source code area: True/False

    Default: True

`line_number_pad`
    The horizontal padding (in pixels) between the line number margin, and
    the source code area.

    Default: 6

`hl_lines`
    Specify a list of lines to be highlighted.

    .. versionadded:: 1.2

    Default: empty list

`hl_color`
    Specify the color for highlighting lines.

    .. versionadded:: 1.2

    Default: highlight color of the selected style
ÚimgÚpngz*.pngFc                ó’  € \         '       g   \        R4      h\        P                  ! V 3/ VB  RV n        \        V P                  4      V n        V P                  P                  f	   RV n        MV P                  P                  V n        \        VR. ROV P                  RR7      V n        \        VR^
4      V n        \        VR	^4      V n        \        VR
^4      p\        VP!                  RR4      V4      V n        V P"                  P%                  4       w  V n        V n        VP!                  RR4      V n        VP!                  RR4      V n        \        VR^4      V n        \1        VRR4      V n        \1        VRR4      V n        \        VR^4      V n        \1        VRR4      V n        \1        VRR4      V n        \        VR^4      V n        \        VR^4      V n        V P8                  '       d<   V P&                  V P.                  ,          V P6                  ^,          ,           V n         M^ V n         . V n!        \E        VR. 4      pV F(  p V PB                  PG                  \I        V4      4       K*  	  VP!                  RV P                  PL                  4      ;'       g    RV n'        . V n(        R#   \J         d     Kx  i ; i)z5
See the class docstring for explanation of options.
z5Python Imaging Library is required for this formatterÚlatin1Nz#fffÚimage_formatT)ÚnormcaseÚ	image_padÚline_padr+   r*   rw   Úline_number_fgz#886Úline_number_bgz#eedÚline_number_charsÚline_number_boldFÚline_number_italicÚline_number_padÚline_numbersÚline_number_separatorÚline_number_stepÚline_number_startÚhl_linesÚhl_colorz#f90)r­   ÚjpegÚgifÚbmp))Úpil_availabler   r   rA   r-   Údictr@   r~   Úbackground_colorr   Údefault_image_formatr°   r   r²   r³   r%   r_   r,   r“   ÚfontwÚfonthr´   rµ   r¶   r   r·   r¸   r¹   rº   r»   r¼   r½   Úline_number_widthr¾   r   ÚappendÚintr¤   Úhighlight_colorr¿   Ú	drawables)r>   ÚoptionsÚfontsizeÚhl_lines_strrT   s   &,   r!   rA   ÚImageFormatter.__init__†  s  € ÷ ‹}Ü!ØGóIð Iä×Ò˜4Ñ+ 7Ò+Ø ˆŒä˜4Ÿ:™:Ó&ˆŒØ�:‰:×&Ñ&Ò.Ø$*ˆDÕ!à$(§J¡J×$?Ñ$?ˆDÔ!ä*Ø�^Ò%BØ×%Ñ%°ô6ˆÔô % W¨k¸2Ó>ˆŒÜ# G¨Z¸Ó;ˆŒä˜w¨°RÓ8ˆÜ  §¡¨[¸"Ó!=¸xÓHˆŒ
Ø!%§¡×!9Ñ!9Ó!;ÑˆŒ
�D”Jà%Ÿk™kÐ*:¸FÓCˆÔØ%Ÿk™kÐ*:¸FÓCˆÔÜ!,¨WØ-@À!ó"EˆÔä ,¨WØ-?Àó!HˆÔä".¨wØ/CÀUó#LˆÔä*¨7Ð4EÀqÓIˆÔÜ(¨°.À$ÓGˆÔÜ%1°'Ø2IÈ4ó&QˆÔ"ä +¨GÐ5GÈÓ KˆÔÜ!,¨WÐ6IÈ1Ó!MˆÔØ××ÐØ&*§j¡j°4×3IÑ3IÕ&IØ&*×&:Ñ&:¸QÕ&>õ'?ˆDÕ"ð &'ˆDÔ"ØˆŒÜ# G¨Z¸Ó<ˆÛ ˆDðØ—‘×$Ñ$¤S¨£YÖ/ñ !ð
  Ÿ™ JØ$(§J¡J×$>Ñ$>ó@÷ Jð JØCIð 	ŒàˆŽøô	 ô Úðús   É$J7Ê7KËKc                ó   € \        R 4      h)zWThe -S option is meaningless for the image formatter. Use -O style=<stylename> instead.)ÚNotImplementedError)r>   Úargs   &&r!   Úget_style_defsÚImageFormatter.get_style_defs¾  s   € Ü!ð #Qó Rð 	Rr    c                ó<   € V P                   V P                  ,           # )z
Get the height of a line.
)rÈ   r³   r’   s   &r!   Ú_get_line_heightÚImageFormatter._get_line_heightÂ  s   € ð �z‰z˜DŸM™MÕ)Ð)r    c                óP   € WP                  4       ,          V P                  ,           # )z(
Get the Y coordinate of a line number.
)rØ   r²   ©r>   Úlinenos   &&r!   Ú_get_line_yÚImageFormatter._get_line_yÈ  s   € ð ×-Ñ-Ó/Õ/°$·.±.Õ@Ð@r    c                ó   € V P                   # )z
Get the width of a character.
)rÇ   r’   s   &r!   Ú_get_char_widthÚImageFormatter._get_char_widthÎ  s   € ð �z‰zÐr    c                óH   € WP                   ,           V P                  ,           # )z/
Get the X coordinate of a character position.
)r²   rÉ   )r>   Ú
linelengths   &&r!   Ú_get_char_xÚImageFormatter._get_char_xÔ  s   € ð ŸN™NÕ*¨T×-CÑ-CÕCÐCr    c                óF   € V P                  V4      V P                  V4      3# )z<
Get the actual position for a character and line position.
)rä   rÝ   )r>   rã   rÜ   s   &&&r!   Ú_get_text_posÚImageFormatter._get_text_posÚ  s%   € ð ×Ñ 
Ó+¨T×-=Ñ-=¸fÓ-EÐEÐEr    c                ó<   € V P                   V P                  V4      3# )z9
Get the actual position for the start of a line number.
)r²   rÝ   rÛ   s   &&r!   Ú_get_linenumber_posÚ"ImageFormatter._get_linenumber_posà  s   € ð —‘ × 0Ñ 0°Ó 8Ð9Ð9r    c                óD   € VR,          e   RVR,          ,           pV# RpV# )z5
Get the correct color for the token from the style.
ÚcolorÚ#z#000r   )r>   r@   Úfills   && r!   Ú_get_text_colorÚImageFormatter._get_text_coloræ  s/   € ð ��>Ò%Ø˜˜w�Õ'ˆDð ˆð ˆDØˆr    c                óD   € VR,          e   RVR,          ,           pV# RpV# )z@
Get the correct background color for the token from the style.
ÚbgcolorNrî   r   )r>   r@   Úbg_colors   && r!   Ú_get_text_bg_colorÚ!ImageFormatter._get_text_bg_colorð  s1   € ð �ÕÒ'Ø˜U 9Õ-Õ-ˆHð ˆð ˆHØˆr    c                óV   € V P                   P                  VR,          VR,          4      # )z%
Get the correct font for the style.
rž   Úitalic)r,   r    )r>   r@   s   &&r!   Ú_get_style_fontÚImageFormatter._get_style_fontú  s#   € ð �z‰z×"Ñ" 5¨¥=°%¸µ/ÓBÐBr    c                ó˜   € V P                  V4      V P                  ,           V P                  V^ ,           4      V P                  ,           3# )z
Get the required image size.
)rä   r²   rÝ   )r>   ÚmaxlinelengthÚ	maxlinenos   &&&r!   Ú_get_image_sizeÚImageFormatter._get_image_size   sB   € ð × Ñ  Ó/°$·.±.Õ@Ø× Ñ  ¨Q¥Ó/°$·.±.Õ@ðBð 	Br    c                ó  € V P                  V P                  V4      \        V4      P                  V P                  4      V P
                  P                  V P                  V P                  4      V P                  RR7       R# )z1
Remember a line number drawable to paint later.
N©r?   Útext_fgÚtext_bg)
Ú
_draw_textrê   ÚstrÚrjustr¶   r,   r    r·   r¸   r´   )r>   ÚposnorÜ   s   &&&r!   Ú_draw_linenumberÚImageFormatter._draw_linenumber  sj   € ð 	�‰Ø×$Ñ$ UÓ+Ü�‹K×Ñ˜d×4Ñ4Ó5Ø—‘×$Ñ$ T×%:Ñ%:Ø%)×%<Ñ%<ó>à×'Ñ'Øð 	ö 	
r    c                óB   € V P                   P                  WW4V34       R# )z2
Remember a single drawable tuple to paint later.
N)rÍ   rÊ   )r>   Úposrš   r?   r  r  s   &&&&&&r!   r  ÚImageFormatter._draw_text  s   € ð 	�‰×Ñ˜s¨$¸ÐAÖBr    c                óÞ  € ^ ;p;r4^ ;rVV EFK  w  rxWpP                   9  d   VP                  pK  V P                   V,          p	VP                  ^4      pVP                  R4      p
\	        V
4       Fã  w  r¼VP                  R4      pV'       d    V P                  V P                  Wb4      VV P                  V	4      V P                  V	4      V P                  V	4      R7       V P                  P                  V4      w  rïWn,          p\        WV4      pV\        V4      ,          p\        WC4      pVP                  R4      '       g   KÖ  ^ p^ pV^,          pKå  	  EKN  	  WPn        W@n        W n        R# )z)
Create drawables for the token content.
TÚ
r  N)r~   ÚparentÚ
expandtabsrM   Ú	enumerateÚrstripr  rç   rù   rð   rõ   r,   r‘   ÚmaxÚlenri   rü   Ú	maxcharnorý   )r>   ÚtokensourcerÜ   Úcharnor  rü   rã   ÚttypeÚvaluer@   rS   ÚirT   ÚtempÚ
temp_widthrR   s   &&              r!   Ú_create_drawablesÚ ImageFormatter._create_drawables  sL  € ð '(Ð'ˆÐ'�Ø%&Ð&ˆÜ'‰LˆEØŸ{™{Ô*ØŸ™’Ø—K‘K Õ&ˆEð ×$Ñ$ QÓ'ˆEØ×$Ñ$ TÓ*ˆEä$ UÖ+‘�Ø—{‘{ 4Ó(�ßØ—O‘OØ×*Ñ*¨:Ó>ØØ#×3Ñ3°EÓ:Ø"&×"6Ñ"6°uÓ"=Ø"&×"9Ñ"9¸%Ó"@ð $ô ð %)§J¡J×$<Ñ$<¸TÓ$B‘M�JØÕ,�JÜ$'¨Ó$B�MØœc $›iÕ'�FÜ # IÓ 6�IØ—=‘= ×&Ô&à!"�JØ�FØ˜a•K’Fô' ,ñ (ð< +ÔØ"ŒØŽr    c                óÞ   € V P                   '       g   R# \        V P                  4       F?  pWP                  ,           pW P                  ,          ^ 8X  g   K.  V P                  W4       KA  	  R# )z(
Create drawables for the line numbers.
N)rº   Úrangerý   r½   r¼   r  )r>   ÚpÚns   &  r!   Ú_draw_line_numbersÚ!ImageFormatter._draw_line_numbersB  sS   € ð × × Ð ÙÜ�t—~‘~Ö&ˆAØ×*Ñ*Õ*ˆAØ×)Ñ)Õ)¨aÖ/Ø×%Ñ% aÖ+ó 'r    c                ó¦  € V P                   '       g   R# V P                  f   R# \        P                  ! V4      pVP                  R,          pV P
                  V P                  ,           V P                  ,
          pVP                  RWC3.V P                  R7       V P                  '       d#   VP                  V^ 3WC3.V P                  R7       ?R# )z0
Paint the line number background on the image.
N©rï   éÿÿÿÿ)é    r(  )rº   r´   r   ÚDrawÚsizer²   rÉ   r¹   Ú	rectanglerµ   r»   rT   )r>   ÚimÚdrawÚrecthÚrectws   &&   r!   Ú_paint_line_number_bgÚ$ImageFormatter._paint_line_number_bgM  s¯   € ð × × Ð ÙØ×ÑÒ&ÙÜ�~Š~˜bÓ!ˆØ—‘˜•ˆØ—‘ ×!7Ñ!7Õ7¸$×:NÑ:NÕNˆØ�‰˜  Ð/Ø ×/Ñ/ð 	ô 	1à×%×%Ð%Ø�I‰I˜˜q�z E >Ð2¸×9LÑ9LˆIÔMÚr    c           	     ó„  € V P                  V4       V P                  4        \        P                  ! RV P	                  V P
                  V P                  4      V P                  4      pV P                  V4       \        P                  ! V4      pV P                  '       d¹   V P                  V P                  ,           V P                  ,
          ^,           pV P                  4       pVP                   ^ ,          V,
          pV P                   FI  pV P#                  V^,
          4      p	VP%                  WY3WW,           W–,           3.V P&                  R7       KK  	  V P(                   F®  w  r«rÍpV'       d�   \+        VR4      '       d   VP-                  W¼R7      pMVP/                  V4      R,          pVP%                  V
^ ,          V
^,          V
^ ,          V^ ,          ,           V
^,          V^,          ,           .VR7       VP1                  W«WÍR7       K°  	  VP3                  W P4                  P7                  4       4       R# )zø
Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
tuples and write it into ``outfile``.

This implementation calculates where it should draw each token on the
pixmap, then calculates the required pixmap size and draws the items.
ÚRGBr&  Útextsize)rš   r?   :r—   NN)r?   rï   N)r  r#  r   Únewrþ   rü   rý   rÅ   r0  r   r)  r¾   r²   rÉ   r¹   rØ   r*  rÝ   r+  r¿   rÍ   r/   r4  r–   rš   Úsaver°   Úupper)r>   r  Úoutfiler,  r-  Úxr.  r/  Ú
linenumberÚyr  r  r?   r  r  Ú	text_sizes   &&&             r!   rx   ÚImageFormatter.format^  sÀ  € ð 	×Ñ˜{Ô+Ø×ÑÔ!Ü�YŠYØØ× Ñ  ×!3Ñ!3°T·^±^ÓDØ×!Ñ!ó
ˆð
 	×"Ñ" 2Ô&Ü�~Š~˜bÓ!ˆà�=�=ˆ=Ø—‘ ×!7Ñ!7Õ7¸$×:NÑ:NÕNÐQRÕRˆAØ×)Ñ)Ó+ˆEØ—G‘G˜A•J •NˆEØ"Ÿmœm�
Ø×$Ñ$ Z°!¥^Ó4�Ø—‘  ¨­°AµIÐ(>Ð?Ø$(§M¡Mð ö 3ñ ,ð 37·.´.Ñ.ˆC˜ wßä˜4 ×,Ò,Ø $§¡°5 Ó D‘Ià $§¡¨UÓ 3°BÕ 7�IØ—‘  A¥¨¨A­°°Aµ¸À1½Õ0EÀsÈ1ÅvÐPYÐZ[ÕP\ÕG\Ð]Ðdk�ÔlØ�I‰I�c tˆIÖ:ñ 3Að 	�‰�×*Ñ*×0Ñ0Ó2Ö3r    )rÅ   rÍ   r-   rÈ   r,   rÇ   r¿   r¾   r°   r²   rµ   r·   r¶   r´   r¸   r¹   r»   r½   r¼   rÉ   rº   r³   r  rü   rý   r~   N)r¬   ÚIMGr­   )rw   )r   r   r   r   r   rP   ÚaliasesÚ	filenamesÚunicodeoutputrÆ   rA   rÕ   rØ   rÝ   rà   rä   rç   rê   rð   rõ   rù   rþ   r  r  r  r#  r0  rx   r   r¨   r©   s   @r!   r
   r
     s’   ø‡ € ñlð^ €DÚ#€GØ�	€Ià€Mà Ðò6ôpRò*òAòòDòFò:òòòCòBò
òCò& òP	,ò÷"#4ð #4r    c                   ó.   € ] tR tRtRtRtR.tR.tRtRt	R# )r   i‡  z�
Create a GIF image from source code. This uses the Python Imaging Library to
generate a pixmap from the source code.

.. versionadded:: 1.0
Úimg_gifrÁ   z*.gifr   N©
r   r   r   r   r   rP   r?  r@  rÆ   r   r   r    r!   r   r   ‡  s"   † ñð €DØˆg€GØ�	€IØ Ôr    c                   ó0   € ] tR tRtRtRtRR.tR.tRtRt	R# )	r   i•  zŽ
Create a JPEG image from source code. This uses the Python Imaging Library to
generate a pixmap from the source code.

.. versionadded:: 1.0
Úimg_jpgÚjpgrÀ   z*.jpgr   NrD  r   r    r!   r   r   •  s$   † ñð €DØ�fˆo€GØ�	€IØ!Ôr    c                   ó0   € ] tR tRtRtRtRR.tR.tRtRt	R# )	r   i£  z�
Create a bitmap image from source code. This uses the Python Imaging Library to
generate a pixmap from the source code.

.. versionadded:: 1.0
Úimg_bmprÂ   Úbitmapz*.bmpr   NrD  r   r    r!   r   r   £  s%   † ñð €DØ�hÐ€GØ�	€IØ Ôr    )r
   r   r   r   )rw   ÚRomanÚBookÚNormalÚRegularÚMedium) r   r0   r5   Úpygments.formatterr   Úpygments.utilr   r   r   r   rH   ÚPILr   r   r	   rÃ   ÚImportErrorry   ÚwinregÚ__all__r4   r<   r8   r:   r   Ú	Exceptionr#   r%   r
   r   r   r   r   r    r!   Ú<module>rW     s  ðñó 
Û 
å (÷ó ó ðß/Ñ/Ø€MðÛò €ð ÒFØ�9˜hÐ'Ø
�6�(Ø�> =Ð1ð	
€ð +Ð Ø%Ð ØÐ ô7�kô 7ô3�9ô 3÷Oñ Oôds4�Yô s4ôr!˜ô !ô"˜ô "ô!˜ö !øðY ô Ø‚Mðûð
 ô ðÝ øØô Ø‹ðúðús:   ¢B ¯B+ Â	B(Â'B(Â+C
Â3B9Â9	CÃC
ÃCÃC
