관리-도구
편집 파일: rtf.cpython-311.pyc
� �܋f� � �H � d Z ddlmZ ddlmZmZ dgZ G d� de� � ZdS )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�RtfFormatterc �: � e Zd ZdZdZdgZdgZd� Zd� Zd� Z d� Z d S ) r a� 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 �RTF�rtfz*.rtfc � � t j | fi |�� |� d� � pd| _ t |dd� � | _ dS )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... �fontface� �fontsizer N)r �__init__�getr r r )�self�optionss �t/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pip/_vendor/pygments/formatters/rtf.pyr zRtfFormatter.__init__2 sL � � ��4�+�+�7�+�+�+����J�/�/�5�2�� �#�G�Z��;�;�� � � � c �~ � |� dd� � � dd� � � dd� � S )N�\z\\�{z\{�}z\})�replace)r �texts r �_escapezRtfFormatter._escapeB s6 � ��|�|�D�&�)�)��G�C��'�'��G�C��'�'� (r c � � |sdS | � |� � }g }|D ]�}t |� � }|dk r#|� t |� � � � �:d|cxk rdk rn n|� d|z � � �cd|k r%|� dt |� � z � � ��d� |� � � dd� � S )Nr � i z{\u%d}z{\u%d}{\u%d}� z\par )r �ord�append�strr �joinr )r r �buf�c�cns r �_escape_textzRtfFormatter._escape_textG s� � �� ��2� �|�|�D�!�!����� A� A�A��Q���B��T�{�{�� � �3�q�6�6�"�"�"�"��2�'�'�'�'��'�'�'�'�'�� � �9�r�>�*�*�*�*��B��� � � �+�m�B�.?�.?�?�@�@�@���w�w�s�|�|�#�#�D�)�4�4�4r c � � |� d| j rd| � | j � � z pdz � � i }d}| j D ]�\ }}|d |d |d fD ]o}|rk||vrg|||<