class documentation

class RtfFormatter(Formatter):

View In Hierarchy

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.

New in version 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.

New in version 2.0.
Method __init__ Additional options accepted:
Method ​_escape Undocumented
Method ​_escape​_text Undocumented
Method format​_unencoded Undocumented
Class Variable aliases Undocumented
Class Variable filenames Undocumented
Class Variable name Undocumented
Instance Variable fontface Undocumented
Instance Variable fontsize Undocumented

Inherited from Formatter:

Method format Format tokensource, an iterable of (tokentype, tokenstring) tuples and write it into outfile.
Method get​_style​_defs Return the style definitions for the current style as a string.
Class Variable unicodeoutput Undocumented
Instance Variable encoding Undocumented
Instance Variable full Undocumented
Instance Variable options Undocumented
Instance Variable style Undocumented
Instance Variable title Undocumented
def __init__(self, **options):

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...
def _escape(self, text):

Undocumented

def _escape_text(self, text):

Undocumented

def format_unencoded(self, tokensource, outfile):

Undocumented

aliases: list[str] =

Undocumented

filenames: list[str] =
name: str =

Undocumented

fontface =

Undocumented

fontsize =

Undocumented