class_docstr: 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
code: def _escape_text(self, text):
      # empty strings, should give a small performance improvement
      if not text:
          return ""
  
      # escape text
      text = self._escape(text)
  
      buf = []
      for c in text:
          cn = ord(c)
          if cn < (2**7):
              # ASCII character
              buf.append(str(c))
          elif (2**7) <= cn < (2**16):
              # single unicode escape sequence
              buf.append("{\\u%d}" % cn)
          elif (2**16) <= cn:
              # RTF limits unicode to 16 bits.
              # Force surrogate pairs
              buf.append("{\\u%d}{\\u%d}" % surrogatepair(cn))
  
      return "".join(buf).replace("\n", "\\par\n")
  
file_path: catboost/contrib/python/Pygments/py3/pygments/formatters/rtf.py
imports: from pygments.formatter import Formatter
  from pygments.util import get_int_opt, surrogatepair
label_desc: Use image node_id 3 for calling the RtfFormatter obj's underlying member method code with example usage: obj._escape_text(text) and returns: str, str