gtk.text_tag
Module for [TextTag] class
Types 3
A tag that can be applied to text contained in a gtk.text_buffer.TextBuffer.
You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.
Tags should be in the gtk.text_tag_table.TextTagTable for a given gtk.text_buffer.TextBuffer before using them with that buffer.
gtk.text_buffer.TextBuffer.createTag is the best way to create tags. See “gtk4-demo” for numerous examples.
For each property of gtk.text_tag.TextTag, there is a “set” property, e.g. “font-set” corresponds to “font”. These “set” properties reflect whether a property has been set or not.
They are maintained by GTK and you should not set them independently.
TextTagGidBuilder builder() static nothrowGet builder for [gtk.text_tag.TextTag] Returns: New builder objectbool accumulativeMargin() @property nothrowGet `accumulativeMargin` property. Returns: Whether the margins accumulate or override each other.void accumulativeMargin(bool propval) @property nothrowSet `accumulativeMargin` property. Params: propval = Whether the margins accumulate or override each other.bool allowBreaks() @property nothrowGet `allowBreaks` property. Returns: Whether breaks are allowed.void allowBreaks(bool propval) @property nothrowSet `allowBreaks` property. Params: propval = Whether breaks are allowed.void background(string propval) @property nothrowSet `background` property. Params: propval = Background color as a string.bool backgroundFullHeight() @property nothrowGet `backgroundFullHeight` property. Returns: Whether the background color fills the entire line height or only the height of the tagged characters.void backgroundFullHeight(bool propval) @property nothrowSet `backgroundFullHeight` property. Params: propval = Whether the background color fills the entire line height or only the height of the tagged characters.gdk.rgba.RGBA backgroundRgba() @property nothrowGet `backgroundRgba` property. Returns: Background color as a [gdk.rgba.RGBA].void backgroundRgba(gdk.rgba.RGBA propval) @property nothrowSet `backgroundRgba` property. Params: propval = Background color as a [gdk.rgba.RGBA].gtk.types.TextDirection direction() @property nothrowGet `direction` property. Returns: Text direction, e.g. right-to-left or left-to-right.void direction(gtk.types.TextDirection propval) @property nothrowSet `direction` property. Params: propval = Text direction, e.g. right-to-left or left-to-right.bool editable() @property nothrowGet `editable` property. Returns: Whether the text can be modified by the user.void editable(bool propval) @property nothrowSet `editable` property. Params: propval = Whether the text can be modified by the user.bool fallback() @property nothrowGet `fallback` property. Returns: Whether font fallback is enabled.void fallback(bool propval) @property nothrowSet `fallback` property. Params: propval = Whether font fallback is enabled.string family() @property nothrowGet `family` property. Returns: Name of the font family, e.g. Sans, Helvetica, Times, Monospace.void family(string propval) @property nothrowSet `family` property. Params: propval = Name of the font family, e.g. Sans, Helvetica, Times, Monospace.string font() @property nothrowGet `font` property. Returns: Font description as string, e.g. \"Sans Italic 12\".void font(string propval) @property nothrowSet `font` property. Params: propval = Font description as string, e.g. \"Sans Italic 12\".pango.font_description.FontDescription fontDesc() @property nothrowGet `fontDesc` property. Returns: Font description as a [pango.font_description.FontDescription].void fontDesc(pango.font_description.FontDescription propval) @property nothrowSet `fontDesc` property. Params: propval = Font description as a [pango.font_description.FontDescription].string fontFeatures() @property nothrowGet `fontFeatures` property. Returns: OpenType font features, as a string.void fontFeatures(string propval) @property nothrowSet `fontFeatures` property. Params: propval = OpenType font features, as a string.void foreground(string propval) @property nothrowSet `foreground` property. Params: propval = Foreground color as a string.gdk.rgba.RGBA foregroundRgba() @property nothrowGet `foregroundRgba` property. Returns: Foreground color as a [gdk.rgba.RGBA].void foregroundRgba(gdk.rgba.RGBA propval) @property nothrowSet `foregroundRgba` property. Params: propval = Foreground color as a [gdk.rgba.RGBA].int indent() @property nothrowGet `indent` property. Returns: Amount to indent the paragraph, in pixels.void indent(int propval) @property nothrowSet `indent` property. Params: propval = Amount to indent the paragraph, in pixels.bool insertHyphens() @property nothrowGet `insertHyphens` property. Returns: Whether to insert hyphens at breaks.void insertHyphens(bool propval) @property nothrowSet `insertHyphens` property. Params: propval = Whether to insert hyphens at breaks.void invisible(bool propval) @property nothrowSet `invisible` property. Params: propval = Whether this text is hidden.gtk.types.Justification justification() @property nothrowGet `justification` property. Returns: Left, right, or center justification.void justification(gtk.types.Justification propval) @property nothrowSet `justification` property. Params: propval = Left, right, or center justification.string language() @property nothrowGet `language` property. Returns: The language this text is in, as an ISO code.void language(string propval) @property nothrowSet `language` property. Params: propval = The language this text is in, as an ISO code.int leftMargin() @property nothrowGet `leftMargin` property. Returns: Width of the left margin in pixels.void leftMargin(int propval) @property nothrowSet `leftMargin` property. Params: propval = Width of the left margin in pixels.int letterSpacing() @property nothrowGet `letterSpacing` property. Returns: Extra spacing between graphemes, in Pango units.void letterSpacing(int propval) @property nothrowSet `letterSpacing` property. Params: propval = Extra spacing between graphemes, in Pango units.float lineHeight() @property nothrowGet `lineHeight` property. Returns: Factor to scale line height by.void lineHeight(float propval) @property nothrowSet `lineHeight` property. Params: propval = Factor to scale line height by.pango.types.Overline overline() @property nothrowGet `overline` property. Returns: Style of overline for this text.void overline(pango.types.Overline propval) @property nothrowSet `overline` property. Params: propval = Style of overline for this text.gdk.rgba.RGBA overlineRgba() @property nothrowGet `overlineRgba` property. Returns: This property modifies the color of overlines.void overlineRgba(gdk.rgba.RGBA propval) @property nothrowSet `overlineRgba` property. Params: propval = This property modifies the color of overlines.void paragraphBackground(string propval) @property nothrowSet `paragraphBackground` property. Params: propval = The paragraph background color as a string.gdk.rgba.RGBA paragraphBackgroundRgba() @property nothrowGet `paragraphBackgroundRgba` property. Returns: The paragraph background color as a [gdk.rgba.RGBA].void paragraphBackgroundRgba(gdk.rgba.RGBA propval) @property nothrowSet `paragraphBackgroundRgba` property. Params: propval = The paragraph background color as a [gdk.rgba.RGBA].int pixelsAboveLines() @property nothrowGet `pixelsAboveLines` property. Returns: Pixels of blank space above paragraphs.void pixelsAboveLines(int propval) @property nothrowSet `pixelsAboveLines` property. Params: propval = Pixels of blank space above paragraphs.int pixelsBelowLines() @property nothrowGet `pixelsBelowLines` property. Returns: Pixels of blank space below paragraphs.void pixelsBelowLines(int propval) @property nothrowSet `pixelsBelowLines` property. Params: propval = Pixels of blank space below paragraphs.int pixelsInsideWrap() @property nothrowGet `pixelsInsideWrap` property. Returns: Pixels of blank space between wrapped lines in a paragraph.void pixelsInsideWrap(int propval) @property nothrowSet `pixelsInsideWrap` property. Params: propval = Pixels of blank space between wrapped lines in a paragraph.int rightMargin() @property nothrowGet `rightMargin` property. Returns: Width of the right margin, in pixels.void rightMargin(int propval) @property nothrowSet `rightMargin` property. Params: propval = Width of the right margin, in pixels.int rise() @property nothrowGet `rise` property. Returns: Offset of text above the baseline, in Pango units.void rise(int propval) @property nothrowSet `rise` property. Params: propval = Offset of text above the baseline, in Pango units.double scale() @property nothrowGet `scale` property. Returns: Font size as a scale factor relative to the default font size.void scale(double propval) @property nothrowSet `scale` property. Params: propval = Font size as a scale factor relative to the default font size.bool sentence() @property nothrowGet `sentence` property. Returns: Whether this tag represents a single sentence.void sentence(bool propval) @property nothrowSet `sentence` property. Params: propval = Whether this tag represents a single sentence.pango.types.ShowFlags showSpaces() @property nothrowGet `showSpaces` property. Returns: How to render invisible characters.void showSpaces(pango.types.ShowFlags propval) @property nothrowSet `showSpaces` property. Params: propval = How to render invisible characters.void size(int propval) @property nothrowSet `size` property. Params: propval = Font size in Pango units.void sizePoints(double propval) @property nothrowSet `sizePoints` property. Params: propval = Font size in points.pango.types.Stretch stretch() @property nothrowGet `stretch` property. Returns: Font stretch as a [pango.types.Stretch], e.g. [pango.types.Stretch.Condensed].void stretch(pango.types.Stretch propval) @property nothrowSet `stretch` property. Params: propval = Font stretch as a [pango.types.Stretch], e.g. [pango.types.Stretch.Condensed].bool strikethrough() @property nothrowGet `strikethrough` property. Returns: Whether to strike through the text.void strikethrough(bool propval) @property nothrowSet `strikethrough` property. Params: propval = Whether to strike through the text.gdk.rgba.RGBA strikethroughRgba() @property nothrowGet `strikethroughRgba` property. Returns: This property modifies the color of strikeouts.void strikethroughRgba(gdk.rgba.RGBA propval) @property nothrowSet `strikethroughRgba` property. Params: propval = This property modifies the color of strikeouts.bool strikethroughRgbaSet() @property nothrowGet `strikethroughRgbaSet` property. Returns: If the `strikethrough-rgba` property has been set.void strikethroughRgbaSet(bool propval) @property nothrowSet `strikethroughRgbaSet` property. Params: propval = If the `strikethrough-rgba` property has been set.pango.types.Style style() @property nothrowGet `style` property. Returns: Font style as a [pango.types.Style], e.g. [pango.types.Style.Italic].void style(pango.types.Style propval) @property nothrowSet `style` property. Params: propval = Font style as a [pango.types.Style], e.g. [pango.types.Style.Italic].pango.tab_array.TabArray tabs() @property nothrowGet `tabs` property. Returns: Custom tabs for this text.void tabs(pango.tab_array.TabArray propval) @property nothrowSet `tabs` property. Params: propval = Custom tabs for this text.pango.types.TextTransform textTransform() @property nothrowGet `textTransform` property. Returns: How to transform the text for display.void textTransform(pango.types.TextTransform propval) @property nothrowSet `textTransform` property. Params: propval = How to transform the text for display.pango.types.Underline underline() @property nothrowGet `underline` property. Returns: Style of underline for this text.void underline(pango.types.Underline propval) @property nothrowSet `underline` property. Params: propval = Style of underline for this text.gdk.rgba.RGBA underlineRgba() @property nothrowGet `underlineRgba` property. Returns: This property modifies the color of underlines.void underlineRgba(gdk.rgba.RGBA propval) @property nothrowSet `underlineRgba` property. Params: propval = This property modifies the color of underlines.bool underlineRgbaSet() @property nothrowGet `underlineRgbaSet` property. Returns: If the `underline-rgba` property has been set.void underlineRgbaSet(bool propval) @property nothrowSet `underlineRgbaSet` property. Params: propval = If the `underline-rgba` property has been set.pango.types.Variant variant() @property nothrowGet `variant` property. Returns: Font variant as a [pango.types.Variant], e.g. [pango.types.Variant.SmallCaps].void variant(pango.types.Variant propval) @property nothrowSet `variant` property. Params: propval = Font variant as a [pango.types.Variant], e.g. [pango.types.Variant.SmallCaps].void weight(int propval) @property nothrowSet `weight` property. Params: propval = Font weight as an integer.bool word() @property nothrowGet `word` property. Returns: Whether this tag represents a single word.void word(bool propval) @property nothrowSet `word` property. Params: propval = Whether this tag represents a single word.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.void changed(bool sizeChanged) nothrowEmits the [gtk.text_tag_table.TextTagTable.tagChanged] signal on the [gtk.text_tag_table.TextTagTable] where the tag is included.Fluent builder implementation template for gtk.text_tag.TextTag
T accumulativeMargin(bool propval) nothrowSet `accumulativeMargin` property. Params: propval = Whether the margins accumulate or override each other.T allowBreaks(bool propval) nothrowSet `allowBreaks` property. Params: propval = Whether breaks are allowed. Returns: Builder instance for fluent chainingT allowBreaksSet(bool propval) nothrowT background(string propval) nothrowSet `background` property. Params: propval = Background color as a string. Returns: Builder instance for fluent chainingT backgroundFullHeight(bool propval) nothrowSet `backgroundFullHeight` property. Params: propval = Whether the background color fills the entire line height or only the height of the tagged characters. Returns: Builder instance for fluent ch...T backgroundFullHeightSet(bool propval) nothrowT backgroundRgba(gdk.rgba.RGBA propval) nothrowSet `backgroundRgba` property. Params: propval = Background color as a [gdk.rgba.RGBA]. Returns: Builder instance for fluent chainingT backgroundSet(bool propval) nothrowT direction(gtk.types.TextDirection propval) nothrowSet `direction` property. Params: propval = Text direction, e.g. right-to-left or left-to-right. Returns: Builder instance for fluent chainingT editable(bool propval) nothrowSet `editable` property. Params: propval = Whether the text can be modified by the user. Returns: Builder instance for fluent chainingT editableSet(bool propval) nothrowT fallback(bool propval) nothrowSet `fallback` property. Params: propval = Whether font fallback is enabled.T fallbackSet(bool propval) nothrowT family(string propval) nothrowSet `family` property. Params: propval = Name of the font family, e.g. Sans, Helvetica, Times, Monospace. Returns: Builder instance for fluent chainingT familySet(bool propval) nothrowT font(string propval) nothrowSet `font` property. Params: propval = Font description as string, e.g. \"Sans Italic 12\".T fontDesc(pango.font_description.FontDescription propval) nothrowSet `fontDesc` property. Params: propval = Font description as a [pango.font_description.FontDescription]. Returns: Builder instance for fluent chainingT fontFeatures(string propval) nothrowSet `fontFeatures` property. Params: propval = OpenType font features, as a string. Returns: Builder instance for fluent chainingT fontFeaturesSet(bool propval) nothrowT foreground(string propval) nothrowSet `foreground` property. Params: propval = Foreground color as a string. Returns: Builder instance for fluent chainingT foregroundRgba(gdk.rgba.RGBA propval) nothrowSet `foregroundRgba` property. Params: propval = Foreground color as a [gdk.rgba.RGBA]. Returns: Builder instance for fluent chainingT foregroundSet(bool propval) nothrowT indent(int propval) nothrowSet `indent` property. Params: propval = Amount to indent the paragraph, in pixels.T indentSet(bool propval) nothrowT insertHyphens(bool propval) nothrowSet `insertHyphens` property. Params: propval = Whether to insert hyphens at breaks. Returns: Builder instance for fluent chainingT insertHyphensSet(bool propval) nothrowT invisible(bool propval) nothrowSet `invisible` property. Params: propval = Whether this text is hidden.T invisibleSet(bool propval) nothrowT justification(gtk.types.Justification propval) nothrowSet `justification` property. Params: propval = Left, right, or center justification. Returns: Builder instance for fluent chainingT justificationSet(bool propval) nothrowT language(string propval) nothrowSet `language` property. Params: propval = The language this text is in, as an ISO code.T languageSet(bool propval) nothrowT leftMargin(int propval) nothrowSet `leftMargin` property. Params: propval = Width of the left margin in pixels. Returns: Builder instance for fluent chainingT leftMarginSet(bool propval) nothrowT letterSpacing(int propval) nothrowSet `letterSpacing` property. Params: propval = Extra spacing between graphemes, in Pango units. Returns: Builder instance for fluent chainingT letterSpacingSet(bool propval) nothrowT lineHeight(float propval) nothrowSet `lineHeight` property. Params: propval = Factor to scale line height by. Returns: Builder instance for fluent chainingT lineHeightSet(bool propval) nothrowT name(string propval) nothrowSet `name` property. Params: propval = The name used to refer to the tag.T overline(pango.types.Overline propval) nothrowSet `overline` property. Params: propval = Style of overline for this text. Returns: Builder instance for fluent chainingT overlineRgba(gdk.rgba.RGBA propval) nothrowSet `overlineRgba` property. Params: propval = This property modifies the color of overlines.T overlineRgbaSet(bool propval) nothrowT overlineSet(bool propval) nothrowT paragraphBackground(string propval) nothrowSet `paragraphBackground` property. Params: propval = The paragraph background color as a string. Returns: Builder instance for fluent chainingT paragraphBackgroundRgba(gdk.rgba.RGBA propval) nothrowSet `paragraphBackgroundRgba` property. Params: propval = The paragraph background color as a [gdk.rgba.RGBA]. Returns: Builder instance for fluent chainingT paragraphBackgroundSet(bool propval) nothrowT pixelsAboveLines(int propval) nothrowSet `pixelsAboveLines` property. Params: propval = Pixels of blank space above paragraphs. Returns: Builder instance for fluent chainingT pixelsAboveLinesSet(bool propval) nothrowT pixelsBelowLines(int propval) nothrowSet `pixelsBelowLines` property. Params: propval = Pixels of blank space below paragraphs. Returns: Builder instance for fluent chainingT pixelsBelowLinesSet(bool propval) nothrowT pixelsInsideWrap(int propval) nothrowSet `pixelsInsideWrap` property. Params: propval = Pixels of blank space between wrapped lines in a paragraph. Returns: Builder instance for fluent chainingT pixelsInsideWrapSet(bool propval) nothrowT rightMargin(int propval) nothrowSet `rightMargin` property. Params: propval = Width of the right margin, in pixels. Returns: Builder instance for fluent chainingT rightMarginSet(bool propval) nothrowT rise(int propval) nothrowSet `rise` property. Params: propval = Offset of text above the baseline, in Pango units.T riseSet(bool propval) nothrowT scale(double propval) nothrowSet `scale` property. Params: propval = Font size as a scale factor relative to the default font size.T scaleSet(bool propval) nothrowT sentence(bool propval) nothrowSet `sentence` property. Params: propval = Whether this tag represents a single sentence.T sentenceSet(bool propval) nothrowT showSpaces(pango.types.ShowFlags propval) nothrowSet `showSpaces` property. Params: propval = How to render invisible characters. Returns: Builder instance for fluent chainingT showSpacesSet(bool propval) nothrowT size(int propval) nothrowSet `size` property. Params: propval = Font size in Pango units. Returns: Builder instance for fluent chainingT sizePoints(double propval) nothrowSet `sizePoints` property. Params: propval = Font size in points. Returns: Builder instance for fluent chainingT sizeSet(bool propval) nothrowT stretch(pango.types.Stretch propval) nothrowSet `stretch` property. Params: propval = Font stretch as a [pango.types.Stretch], e.g. [pango.types.Stretch.Condensed]. Returns: Builder instance for fluent chainingT stretchSet(bool propval) nothrowT strikethrough(bool propval) nothrowSet `strikethrough` property. Params: propval = Whether to strike through the text. Returns: Builder instance for fluent chainingT strikethroughRgba(gdk.rgba.RGBA propval) nothrowSet `strikethroughRgba` property. Params: propval = This property modifies the color of strikeouts.T strikethroughRgbaSet(bool propval) nothrowSet `strikethroughRgbaSet` property. Params: propval = If the `strikethrough-rgba` property has been set. Returns: Builder instance for fluent chainingT strikethroughSet(bool propval) nothrowT style(pango.types.Style propval) nothrowSet `style` property. Params: propval = Font style as a [pango.types.Style], e.g. [pango.types.Style.Italic]. Returns: Builder instance for fluent chainingT styleSet(bool propval) nothrowT tabs(pango.tab_array.TabArray propval) nothrowSet `tabs` property. Params: propval = Custom tabs for this text. Returns: Builder instance for fluent chainingT tabsSet(bool propval) nothrowT textTransform(pango.types.TextTransform propval) nothrowSet `textTransform` property. Params: propval = How to transform the text for display. Returns: Builder instance for fluent chainingT textTransformSet(bool propval) nothrowT underline(pango.types.Underline propval) nothrowSet `underline` property. Params: propval = Style of underline for this text. Returns: Builder instance for fluent chainingT underlineRgba(gdk.rgba.RGBA propval) nothrowSet `underlineRgba` property. Params: propval = This property modifies the color of underlines.T underlineRgbaSet(bool propval) nothrowSet `underlineRgbaSet` property. Params: propval = If the `underline-rgba` property has been set. Returns: Builder instance for fluent chainingT underlineSet(bool propval) nothrowT variant(pango.types.Variant propval) nothrowSet `variant` property. Params: propval = Font variant as a [pango.types.Variant], e.g. [pango.types.Variant.SmallCaps]. Returns: Builder instance for fluent chainingT variantSet(bool propval) nothrowT weight(int propval) nothrowSet `weight` property. Params: propval = Font weight as an integer. Returns: Builder instance for fluent chainingT weightSet(bool propval) nothrowT word(bool propval) nothrowSet `word` property. Params: propval = Whether this tag represents a single word.T wordSet(bool propval) nothrowT wrapMode(gtk.types.WrapMode propval) nothrowSet `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries. Returns: Builder instance for fluent chainingT wrapModeSet(bool propval) nothrowFluent builder for gtk.text_tag.TextTag