gtksource.print_compositor
Module for [PrintCompositor] class
Types 3
Compose a gtksource.buffer.Buffer for printing.
The gtksource.print_compositor.PrintCompositor object is used to compose a gtksource.buffer.Buffer for printing. You can set various configuration options to customize the printed output. gtksource.print_compositor.PrintCompositor is designed to be used with the high-level printing API of gtk+, i.e. gtk.print_operation.PrintOperation.
The margins specified in this object are the layout margins: they define the blank space bordering the printed area of the pages. They must not be confused with the "print margins", i.e. the parts of the page that the printer cannot print on, defined in the gtk.page_setup.PageSetup objects. If the specified layout margins are smaller than the "print margins", the latter ones are used as a fallback by the gtksource.print_compositor.PrintCompositor object, so that the printed area is not clipped.
PrintCompositorGidBuilder builder() static nothrowGet builder for [gtksource.print_compositor.PrintCompositor] Returns: New builder objectstring bodyFontName() @property nothrowGet `bodyFontName` property. Returns: Name of the font used for the text body.void bodyFontName(string propval) @property nothrowSet `bodyFontName` property. Params: propval = Name of the font used for the text body.gtksource.buffer.Buffer buffer() @property nothrowGet `buffer` property. Returns: The [gtksource.buffer.Buffer] object to print.string footerFontName() @property nothrowGet `footerFontName` property. Returns: Name of the font used to print page footer. If this property is unspecified, the text body font is used.void footerFontName(string propval) @property nothrowSet `footerFontName` property. Params: propval = Name of the font used to print page footer. If this property is unspecified, the text body font is used.string headerFontName() @property nothrowGet `headerFontName` property. Returns: Name of the font used to print page header. If this property is unspecified, the text body font is used.void headerFontName(string propval) @property nothrowSet `headerFontName` property. Params: propval = Name of the font used to print page header. If this property is unspecified, the text body font is used.bool highlightSyntax() @property nothrowGet `highlightSyntax` property. Returns: Whether to print the document with highlighted syntax.void highlightSyntax(bool propval) @property nothrowSet `highlightSyntax` property. Params: propval = Whether to print the document with highlighted syntax.string lineNumbersFontName() @property nothrowGet `lineNumbersFontName` property. Returns: Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.void lineNumbersFontName(string propval) @property nothrowSet `lineNumbersFontName` property. Params: propval = Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.int nPages() @property nothrowGet `nPages` property. Returns: The number of pages in the document or <code>-1</code> if the document has not been completely paginated.bool printFooter() @property nothrowGet `printFooter` property. Returns: Whether to print a footer in each page.void printFooter(bool propval) @property nothrowSet `printFooter` property. Params: propval = Whether to print a footer in each page.bool printHeader() @property nothrowGet `printHeader` property. Returns: Whether to print a header in each page.void printHeader(bool propval) @property nothrowSet `printHeader` property. Params: propval = Whether to print a header in each page.uint printLineNumbers() @property nothrowGet `printLineNumbers` property. Returns: Interval of printed line numbers.void printLineNumbers(uint propval) @property nothrowSet `printLineNumbers` property. Params: propval = Interval of printed line numbers.uint tabWidth() @property nothrowGet `tabWidth` property. Returns: Width of a tab character expressed in spaces.void tabWidth(uint propval) @property nothrowSet `tabWidth` property. Params: propval = Width of a tab character expressed in spaces.gtk.types.WrapMode wrapMode() @property nothrowGet `wrapMode` property. Returns: Whether to wrap lines never, at word boundaries, or at character boundaries.void wrapMode(gtk.types.WrapMode propval) @property nothrowSet `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries.gtksource.print_compositor.PrintCompositor newFromView(gtksource.view.View view) static nothrowCreates a new print compositor that can be used to print the buffer associated with view.void drawPage(gtk.print_context.PrintContext context, int pageNr) nothrowDraw page page_nr for printing on the the Cairo context encapsuled in context.gtksource.buffer.Buffer getBuffer() nothrowGets the [gtksource.buffer.Buffer] associated with the compositor.bool getHighlightSyntax() nothrowDetermines whether the printed text will be highlighted according to the buffer rules.string getLineNumbersFontName() nothrowReturns the name of the font used to print line numbers on the left margin.int getNPages() nothrowReturns the number of pages in the document or <code>-1</code> if the document has not been completely paginated. Returns: the number of pages in the document or <code>-1</code> if the document has...double getPaginationProgress() nothrowReturns the current fraction of the document pagination that has been completed. Returns: a fraction from 0.0 to 1.0 inclusive.uint getTabWidth() nothrowReturns the width of tabulation in characters for printed text. Returns: width of tab.gtk.types.WrapMode getWrapMode() nothrowGets the line wrapping mode for the printed text. Returns: the line wrap mode.void ignoreTag(gtk.text_tag.TextTag tag) nothrowSpecifies a tag whose style should be ignored when compositing the document to the printable page.bool paginate(gtk.print_context.PrintContext context) nothrowPaginate the document associated with the compositor.void setBottomMargin(double margin, gtk.types.Unit unit) nothrowSets the bottom margin used by compositor.void setFooterFormat(bool separator, string left = null, string center = null, string right = null) nothrowSee [gtksource.print_compositor.PrintCompositor.setHeaderFormat] for more information about the parameters.void setHeaderFormat(bool separator, string left = null, string center = null, string right = null) nothrowSets strftime like header format strings, to be printed on the left, center and right of the top of each page.void setHighlightSyntax(bool highlight) nothrowSets whether the printed text will be highlighted according to the buffer rules. Both color and font style are applied.void setLeftMargin(double margin, gtk.types.Unit unit) nothrowSets the left margin used by compositor.void setLineNumbersFontName(string fontName = null) nothrowSets the font for printing line numbers on the left margin.void setRightMargin(double margin, gtk.types.Unit unit) nothrowSets the right margin used by compositor.void setTopMargin(double margin, gtk.types.Unit unit) nothrowSets the top margin used by compositor.void setWrapMode(gtk.types.WrapMode wrapMode) nothrowSets the line wrapping mode for the printed text.this(gtksource.buffer.Buffer buffer)Creates a new print compositor that can be used to print buffer.Fluent builder implementation template for gtksource.print_compositor.PrintCompositor
T bodyFontName(string propval) nothrowSet `bodyFontName` property. Params: propval = Name of the font used for the text body.T buffer(gtksource.buffer.Buffer propval) nothrowSet `buffer` property. Params: propval = The [gtksource.buffer.Buffer] object to print. Returns: Builder instance for fluent chainingT footerFontName(string propval) nothrowSet `footerFontName` property. Params: propval = Name of the font used to print page footer. If this property is unspecified, the text body font is used.T headerFontName(string propval) nothrowSet `headerFontName` property. Params: propval = Name of the font used to print page header. If this property is unspecified, the text body font is used.T highlightSyntax(bool propval) nothrowSet `highlightSyntax` property. Params: propval = Whether to print the document with highlighted syntax.T lineNumbersFontName(string propval) nothrowSet `lineNumbersFontName` property. Params: propval = Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.T printFooter(bool propval) nothrowSet `printFooter` property. Params: propval = Whether to print a footer in each page.T printHeader(bool propval) nothrowSet `printHeader` property. Params: propval = Whether to print a header in each page.T printLineNumbers(uint propval) nothrowSet `printLineNumbers` property. Params: propval = Interval of printed line numbers.T tabWidth(uint propval) nothrowSet `tabWidth` property. Params: propval = Width of a tab character expressed in spaces.T wrapMode(gtk.types.WrapMode propval) nothrowSet `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries.Fluent builder for gtksource.print_compositor.PrintCompositor