eric6/ThirdParty/Pygments/pygments/formatters/rtf.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
equal deleted inserted replaced
7546:bf5f777260a6 7547:21b0534faebc
3 pygments.formatters.rtf 3 pygments.formatters.rtf
4 ~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 A formatter that generates RTF files. 6 A formatter that generates RTF files.
7 7
8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 from pygments.formatter import Formatter 12 from pygments.formatter import Formatter
13 from pygments.util import get_int_opt, _surrogatepair 13 from pygments.util import get_int_opt, _surrogatepair
33 `style` 33 `style`
34 The style to use, can be a string or a Style subclass (default: 34 The style to use, can be a string or a Style subclass (default:
35 ``'default'``). 35 ``'default'``).
36 36
37 `fontface` 37 `fontface`
38 The used font famliy, for example ``Bitstream Vera Sans``. Defaults to 38 The used font family, for example ``Bitstream Vera Sans``. Defaults to
39 some generic font which is supposed to have fixed width. 39 some generic font which is supposed to have fixed width.
40 40
41 `fontsize` 41 `fontsize`
42 Size of the font used. Size is specified in half points. The 42 Size of the font used. Size is specified in half points. The
43 default is 24 half-points, giving a size 12 font. 43 default is 24 half-points, giving a size 12 font.
68 return text.replace(u'\\', u'\\\\') \ 68 return text.replace(u'\\', u'\\\\') \
69 .replace(u'{', u'\\{') \ 69 .replace(u'{', u'\\{') \
70 .replace(u'}', u'\\}') 70 .replace(u'}', u'\\}')
71 71
72 def _escape_text(self, text): 72 def _escape_text(self, text):
73 # empty strings, should give a small performance improvment 73 # empty strings, should give a small performance improvement
74 if not text: 74 if not text:
75 return u'' 75 return u''
76 76
77 # escape text 77 # escape text
78 text = self._escape(text) 78 text = self._escape(text)

eric ide

mercurial