|e~@dZddlmZddlmZmZdgZGddeZy)z pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. ) Formatter) get_int_opt surrogatepair RtfFormatterc8eZdZdZdZdgZdgZdZdZdZ dZ y ) ra Format tokens as RTF markup. This formatter automatically outputs full RTF documents with color information and other useful stuff. Perfect for Copy and Paste into Microsoft(R) Word(R) documents. Please note that ``encoding`` and ``outencoding`` options are ignored. The RTF format is ASCII natively, but handles unicode characters correctly thanks to escape sequences. .. versionadded:: 0.6 Additional options accepted: `style` The style to use, can be a string or a Style subclass (default: ``'default'``). `fontface` The used font family, for example ``Bitstream Vera Sans``. Defaults to some generic font which is supposed to have fixed width. `fontsize` Size of the font used. Size is specified in half points. The default is 24 half-points, giving a size 12 font. .. versionadded:: 2.0 RTFrtfz*.rtfc tj|fi||jdxsd|_t |dd|_y)a Additional options accepted: ``fontface`` Name of the font used. Could for example be ``'Courier New'`` to further specify the default which is ``'\fmodern'``. The RTF specification claims that ``\fmodern`` are "Fixed-pitch serif and sans serif fonts". Hope every RTF implementation thinks the same about modern... fontfacefontsizerN)r__init__getr rr )selfoptionss 9/usr/lib/python3/dist-packages/pygments/formatters/rtf.pyrzRtfFormatter.__init__2s< 4+7+ J/52 #GZ; cf|jddjddjddS)N\z\\{z\{}z\})replace)rtexts r_escapezRtfFormatter._escapeBs-||D&)GC'GC' (rc`|sy|j|}g}|D]s}t|}|dkr|jt|.d|cxkrdkrnn|jd|zQd|ksW|jdt |zudj |j ddS)Nr iz{\u%d}z {\u%d}{\u%d} z\par )rordappendstrrjoinr)rrbufccns r _escape_textzRtfFormatter._escape_textGs||D! AAQBT{ 3q6"2'' 9r>*B +mB.??@ Awws|##D)44rc |jd|jxrd|j|jzxsdzi}d}|jD]h\}}|d|d|dfD]R}|s||vs |||<|jdt |d d d t |d d d t |d d d fz|dz }Tj|jd|j r|jd|j z|D]y\}} |jj |s@|jr4|j}|jj |s |jr4|jj|}g} |dr| jd||dz|dr| jd||dz|dr| jd|dr| jd|dr| jd|dr| jd||dzdj| } | r|jd| z|j|j| | si|jd||jdy)NzJ{\rtf1\ansi\uc0\deff0{\fonttbl{\f0\fmodern\fprq1\fcharset0%s;}}{\colortbl; r colorbgcolorborderz\red%d\green%d\blue%d;rz}\f0 z\fs%dz\cb%dz\cf%dboldz\bitalicz\i underlinez\ulz\chbrdr\chcfpat%dz{%s r) writer rstyleintr styles_tokenparentstyle_for_tokenrr!r%) r tokensourceoutfile color_mappingoffset_r4r)ttypevaluer"starts rformat_unencodedzRtfFormatter.format_unencoded_s} %(, )J(+dll4==.I(I)+(* , -  HAuwy)95?J U-7+1M%(MM"=E!AJ+E!AJ+E!AJ+A# aKF    h == MM(T]]2 3( #LE5jj--e4 jj--e4JJ..u5ECY 8mE)4D&EEFW~ 8mE'N&CCDV} 5!X 5![! 6"X 0(x9:;GGCLE fun- MM$++E2 3 c"/ #2  crN) __name__ __module__ __qualname____doc__namealiases filenamesrrr%rArrrrs06 DgG I< ( 503rN)rEpygments.formatterr pygments.utilrr__all__rrIrrrMs*)4  @9@r