![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| __init__ (self, **options) | |
| get_style_defs (self, arg='') | |
| format (self, tokensource, outfile) | |
Public Attributes | |
| encoding | |
| styles | |
| background_color | |
| image_format | |
| default_image_format | |
| image_pad | |
| line_pad | |
| fonts | |
| fontw | |
| fonth | |
| line_number_fg | |
| line_number_bg | |
| line_number_chars | |
| line_number_bold | |
| line_number_italic | |
| line_number_pad | |
| line_numbers | |
| line_number_separator | |
| line_number_step | |
| line_number_start | |
| line_number_width | |
| hl_lines | |
| hl_color | |
| drawables | |
| maxlinelength | |
| maxcharno | |
| maxlineno | |
Public Attributes inherited from pip._vendor.pygments.formatter.Formatter | |
| style | |
| full | |
| title | |
| encoding | |
| options | |
Static Public Attributes | |
| str | name = 'img' |
| list | aliases = ['img', 'IMG', 'png'] |
| list | filenames = ['*.png'] |
| bool | unicodeoutput = False |
| str | default_image_format = 'png' |
Static Public Attributes inherited from pip._vendor.pygments.formatter.Formatter | |
| name = None | |
| list | aliases = [] |
| list | filenames = [] |
| bool | unicodeoutput = True |
Protected Member Functions | |
| _get_line_height (self) | |
| _get_line_y (self, lineno) | |
| _get_char_width (self) | |
| _get_char_x (self, linelength) | |
| _get_text_pos (self, linelength, lineno) | |
| _get_linenumber_pos (self, lineno) | |
| _get_text_color (self, style) | |
| _get_text_bg_color (self, style) | |
| _get_style_font (self, style) | |
| _get_image_size (self, maxlinelength, maxlineno) | |
| _draw_linenumber (self, posno, lineno) | |
| _draw_text (self, pos, text, font, text_fg, text_bg) | |
| _create_drawables (self, tokensource) | |
| _draw_line_numbers (self) | |
| _paint_line_number_bg (self, im) | |
Create a PNG image from source code. This uses the Python Imaging Library to
generate a pixmap from the source code.
.. versionadded:: 0.10
Additional options accepted:
`image_format`
An image format to output to that is recognised by PIL, these include:
* "PNG" (default)
* "JPEG"
* "BMP"
* "GIF"
`line_pad`
The extra spacing (in pixels) between each line of text.
Default: 2
`font_name`
The font name to be used as the base font from which others, such as
bold and italic fonts will be generated. This really should be a
monospace font to look sane.
Default: "Courier New" on Windows, "Menlo" on Mac OS, and
"DejaVu Sans Mono" on \\*nix
`font_size`
The font size in points to be used.
Default: 14
`image_pad`
The padding, in pixels to be used at each edge of the resulting image.
Default: 10
`line_numbers`
Whether line numbers should be shown: True/False
Default: True
`line_number_start`
The line number of the first line.
Default: 1
`line_number_step`
The step used when printing line numbers.
Default: 1
`line_number_bg`
The background colour (in "#123456" format) of the line number bar, or
None to use the style background color.
Default: "#eed"
`line_number_fg`
The text color of the line numbers (in "#123456"-like format).
Default: "#886"
`line_number_chars`
The number of columns of line numbers allowable in the line number
margin.
Default: 2
`line_number_bold`
Whether line numbers will be bold: True/False
Default: False
`line_number_italic`
Whether line numbers will be italicized: True/False
Default: False
`line_number_separator`
Whether a line will be drawn between the line number area and the
source code area: True/False
Default: True
`line_number_pad`
The horizontal padding (in pixels) between the line number margin, and
the source code area.
Default: 6
`hl_lines`
Specify a list of lines to be highlighted.
.. versionadded:: 1.2
Default: empty list
`hl_color`
Specify the color for highlighting lines.
.. versionadded:: 1.2
Default: highlight color of the selected style
| pip._vendor.pygments.formatters.img.ImageFormatter.__init__ | ( | self, | |
| ** | options | ||
| ) |
See the class docstring for explanation of options.
Reimplemented from pip._vendor.pygments.formatter.Formatter.
|
protected |
Create drawables for the token content.
|
protected |
Create drawables for the line numbers.
|
protected |
Remember a line number drawable to paint later.
|
protected |
Remember a single drawable tuple to paint later.
|
protected |
Get the width of a character.
|
protected |
Get the X coordinate of a character position.
|
protected |
Get the required image size.
|
protected |
Get the height of a line.
|
protected |
Get the Y coordinate of a line number.
|
protected |
Get the actual position for the start of a line number.
|
protected |
Get the correct font for the style.
|
protected |
Get the correct background color for the token from the style.
|
protected |
Get the correct color for the token from the style.
|
protected |
Get the actual position for a character and line position.
|
protected |
Paint the line number background on the image.
| pip._vendor.pygments.formatters.img.ImageFormatter.format | ( | self, | |
| tokensource, | |||
| outfile | |||
| ) |
Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` tuples and write it into ``outfile``. This implementation calculates where it should draw each token on the pixmap, then calculates the required pixmap size and draws the items.
Reimplemented from pip._vendor.pygments.formatter.Formatter.
| pip._vendor.pygments.formatters.img.ImageFormatter.get_style_defs | ( | self, | |
arg = '' |
|||
| ) |
This method must return statements or declarations suitable to define the current style for subsequent highlighted text (e.g. CSS classes in the `HTMLFormatter`). The optional argument `arg` can be used to modify the generation and is formatter dependent (it is standardized because it can be given on the command line). This method is called by the ``-S`` :doc:`command-line option <cmdline>`, the `arg` is then given by the ``-a`` option.
Reimplemented from pip._vendor.pygments.formatter.Formatter.