### Class

# Gtk TextTag

since: 4.0

#### Description [src]

    class Gtk.TextTag : GObject.Object
    {
      priv: GtkTextTagPrivate*
    }

A tag that can be applied to text contained in a `GtkTextBuffer`.

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 `GtkTextTagTable` for a given `GtkTextBuffer` before using them with that buffer.

`gtk_text_buffer_create_tag()` is the best way to create tags. See “gtk4-demo” for numerous examples.

For each property of `GtkTextTag`, 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.

Available since: 4.0

#### Ancestors

- GObject

#### Constructors

###### gtk_text_tag_new

Creates a `GtkTextTag`.

since: 4.0

#### Instance methods

###### gtk_text_tag_changed

Emits the `GtkTextTagTable::tag-changed` signal on the `GtkTextTagTable` where the tag is included.

since: 4.0

###### gtk_text_tag_get_priority

Get the tag priority.

since: 4.0

###### gtk_text_tag_set_priority

Sets the priority of a `GtkTextTag`.

since: 4.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gtk.TextTag:accumulative-margin

Whether the margins accumulate or override each other.

since: 4.0

###### Gtk.TextTag:allow-breaks

Whether breaks are allowed.

since: 4.0

###### Gtk.TextTag:allow-breaks-set

No description available.

since: 4.0

###### Gtk.TextTag:background

Background color as a string.

since: 4.0

###### Gtk.TextTag:background-full-height

Whether the background color fills the entire line height or only the height of the tagged characters.

since: 4.0

###### Gtk.TextTag:background-full-height-set

No description available.

since: 4.0

###### Gtk.TextTag:background-rgba

Background color as a `GdkRGBA`.

since: 4.0

###### Gtk.TextTag:background-set

No description available.

since: 4.0

###### Gtk.TextTag:direction

Text direction, e.g. right-to-left or left-to-right.

since: 4.0

###### Gtk.TextTag:editable

Whether the text can be modified by the user.

since: 4.0

###### Gtk.TextTag:editable-set

No description available.

since: 4.0

###### Gtk.TextTag:fallback

Whether font fallback is enabled.

since: 4.0

###### Gtk.TextTag:fallback-set

No description available.

since: 4.0

###### Gtk.TextTag:family

Name of the font family, e.g. Sans, Helvetica, Times, Monospace.

since: 4.0

###### Gtk.TextTag:family-set

No description available.

since: 4.0

###### Gtk.TextTag:font

Font description as string, e.g. "Sans Italic 12".

since: 4.0

###### Gtk.TextTag:font-desc

Font description as a `PangoFontDescription`.

since: 4.0

###### Gtk.TextTag:font-features

OpenType font features, as a string.

since: 4.0

###### Gtk.TextTag:font-features-set

No description available.

since: 4.0

###### Gtk.TextTag:foreground

Foreground color as a string.

since: 4.0

###### Gtk.TextTag:foreground-rgba

Foreground color as a `GdkRGBA`.

since: 4.0

###### Gtk.TextTag:foreground-set

No description available.

since: 4.0

###### Gtk.TextTag:indent

Amount to indent the paragraph, in pixels.

since: 4.0

###### Gtk.TextTag:indent-set

No description available.

since: 4.0

###### Gtk.TextTag:insert-hyphens

Whether to insert hyphens at breaks.

since: 4.0

###### Gtk.TextTag:insert-hyphens-set

No description available.

since: 4.0

###### Gtk.TextTag:invisible

Whether this text is hidden.

since: 4.0

###### Gtk.TextTag:invisible-set

No description available.

since: 4.0

###### Gtk.TextTag:justification

Left, right, or center justification.

since: 4.0

###### Gtk.TextTag:justification-set

No description available.

since: 4.0

###### Gtk.TextTag:language

The language this text is in, as an ISO code.

since: 4.0

###### Gtk.TextTag:language-set

No description available.

since: 4.0

###### Gtk.TextTag:left-margin

Width of the left margin in pixels.

since: 4.0

###### Gtk.TextTag:left-margin-set

No description available.

since: 4.0

###### Gtk.TextTag:letter-spacing

Extra spacing between graphemes, in Pango units.

since: 4.0

###### Gtk.TextTag:letter-spacing-set

No description available.

since: 4.0

###### Gtk.TextTag:line-height

Factor to scale line height by.

since: 4.6

###### Gtk.TextTag:line-height-set

No description available.

since: 4.0

###### Gtk.TextTag:name

The name used to refer to the tag.

since: 4.0

###### Gtk.TextTag:overline

Style of overline for this text.

since: 4.0

###### Gtk.TextTag:overline-rgba

This property modifies the color of overlines.

since: 4.0

###### Gtk.TextTag:overline-rgba-set

No description available.

since: 4.0

###### Gtk.TextTag:overline-set

No description available.

since: 4.0

###### Gtk.TextTag:paragraph-background

The paragraph background color as a string.

since: 4.0

###### Gtk.TextTag:paragraph-background-rgba

The paragraph background color as a `GdkRGBA`.

since: 4.0

###### Gtk.TextTag:paragraph-background-set

No description available.

since: 4.0

###### Gtk.TextTag:pixels-above-lines

Pixels of blank space above paragraphs.

since: 4.0

###### Gtk.TextTag:pixels-above-lines-set

No description available.

since: 4.0

###### Gtk.TextTag:pixels-below-lines

Pixels of blank space below paragraphs.

since: 4.0

###### Gtk.TextTag:pixels-below-lines-set

No description available.

since: 4.0

###### Gtk.TextTag:pixels-inside-wrap

Pixels of blank space between wrapped lines in a paragraph.

since: 4.0

###### Gtk.TextTag:pixels-inside-wrap-set

No description available.

since: 4.0

###### Gtk.TextTag:right-margin

Width of the right margin, in pixels.

since: 4.0

###### Gtk.TextTag:right-margin-set

No description available.

since: 4.0

###### Gtk.TextTag:rise

Offset of text above the baseline, in Pango units.

since: 4.0

###### Gtk.TextTag:rise-set

No description available.

since: 4.0

###### Gtk.TextTag:scale

Font size as a scale factor relative to the default font size.

since: 4.0

###### Gtk.TextTag:scale-set

No description available.

since: 4.0

###### Gtk.TextTag:sentence

Whether this tag represents a single sentence.

since: 4.6

###### Gtk.TextTag:sentence-set

No description available.

since: 4.0

###### Gtk.TextTag:show-spaces

How to render invisible characters.

since: 4.0

###### Gtk.TextTag:show-spaces-set

No description available.

since: 4.0

###### Gtk.TextTag:size

Font size in Pango units.

since: 4.0

###### Gtk.TextTag:size-points

Font size in points.

since: 4.0

###### Gtk.TextTag:size-set

No description available.

since: 4.0

###### Gtk.TextTag:stretch

Font stretch as a `PangoStretch`, e.g. `PANGO_STRETCH_CONDENSED`.

since: 4.0

###### Gtk.TextTag:stretch-set

No description available.

since: 4.0

###### Gtk.TextTag:strikethrough

Whether to strike through the text.

since: 4.0

###### Gtk.TextTag:strikethrough-rgba

This property modifies the color of strikeouts.

since: 4.0

###### Gtk.TextTag:strikethrough-rgba-set

If the `strikethrough-rgba` property has been set.

since: 4.0

###### Gtk.TextTag:strikethrough-set

No description available.

since: 4.0

###### Gtk.TextTag:style

Font style as a `PangoStyle`, e.g. `PANGO_STYLE_ITALIC`.

since: 4.0

###### Gtk.TextTag:style-set

No description available.

since: 4.0

###### Gtk.TextTag:tabs

Custom tabs for this text.

since: 4.0

###### Gtk.TextTag:tabs-set

No description available.

since: 4.0

###### Gtk.TextTag:text-transform

How to transform the text for display.

since: 4.6

###### Gtk.TextTag:text-transform-set

No description available.

since: 4.0

###### Gtk.TextTag:underline

Style of underline for this text.

since: 4.0

###### Gtk.TextTag:underline-rgba

This property modifies the color of underlines.

since: 4.0

###### Gtk.TextTag:underline-rgba-set

If the `underline-rgba` property has been set.

since: 4.0

###### Gtk.TextTag:underline-set

No description available.

since: 4.0

###### Gtk.TextTag:variant

Font variant as a `PangoVariant`, e.g. `PANGO_VARIANT_SMALL_CAPS`.

since: 4.0

###### Gtk.TextTag:variant-set

No description available.

since: 4.0

###### Gtk.TextTag:weight

Font weight as an integer.

since: 4.0

###### Gtk.TextTag:weight-set

No description available.

since: 4.0

###### Gtk.TextTag:word

Whether this tag represents a single word.

since: 4.6

###### Gtk.TextTag:word-set

No description available.

since: 4.0

###### Gtk.TextTag:wrap-mode

Whether to wrap lines never, at word boundaries, or at character boundaries.

since: 4.0

###### Gtk.TextTag:wrap-mode-set

No description available.

since: 4.0

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct GtkTextTagClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.