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 [classGtk.TextTagTable] for a given GtkTextBuffer before using them with that buffer.
[methodGtk.TextBuffer.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.
Accumulative_Margin_Property : constant Glib.Properties.Property_Boolean;
Whether the margins accumulate or override each other.
When set to True the margins of this tag are added to the margins of any other non-accumulative margins present. When set to False the margins override one another (the default).
Allow_Breaks_Property : constant Glib.Properties.Property_Boolean;
Whether breaks are allowed.
Allow_Breaks_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the allow-breaks property is set.
Background_Full_Height_Property : constant Glib.Properties.Property_Boolean;
Whether the background color fills the entire line height or only the height of the tagged characters.
Background_Full_Height_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the background-full-height property is set.
Background_Property : constant Glib.Properties.Property_String;
Flags: write Background color as a string.
Background_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA Background color as a GdkRGBA.
Background_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the background property is set.
procedure Changed
(Tag : not null access Gtk_Text_Tag_Record;
Size_Changed : Boolean)
Emits the [signalGtk.TextTagTable::tag-changed] signal on the GtkTextTagTable where the tag is included. The signal is already emitted when setting a GtkTextTag property. This function is useful for a GtkTextTag subclass.
whether the change affects the GtkTextView layout
function Convert (R : Gtk.Text_Tag.Gtk_Text_Tag) return System.Address
function Convert (R : System.Address) return Gtk.Text_Tag.Gtk_Text_Tag
Direction_Property : constant Gtk.Enums.Property_Gtk_Text_Direction;
Text direction, e.g. right-to-left or left-to-right.
Editable_Property : constant Glib.Properties.Property_Boolean;
Whether the text can be modified by the user.
Editable_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the editable property is set.
Fallback_Property : constant Glib.Properties.Property_Boolean;
Whether font fallback is enabled.
When set to True, other fonts will be substituted where the current font is missing glyphs.
Fallback_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the fallback property is set.
Family_Property : constant Glib.Properties.Property_String;
Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
Family_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the family property is set.
Font_Desc_Property : constant Pango.Font.Property_Font_Description;
Type: Pango.Font.Pango_Font_Description Font description as a PangoFontDescription.
Font_Features_Property : constant Glib.Properties.Property_String;
OpenType font features, as a string.
Font_Features_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the font-features property is set.
Font_Property : constant Glib.Properties.Property_String;
Font description as string, e.g. \"Sans Italic 12\".
Note that the initial value of this property depends on the internals of PangoFontDescription.
Foreground_Property : constant Glib.Properties.Property_String;
Flags: write Foreground color as a string.
Foreground_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA Foreground color as a GdkRGBA.
Foreground_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the foreground property is set.
function Get_Priority
(Tag : not null access Gtk_Text_Tag_Record) return Glib.Gint
Get the tag priority.
The tag's priority.
function Get_Type return Glib.GType
procedure Gtk_New (Tag : out Gtk_Text_Tag; Name : UTF8_String := "")
Creates a GtkTextTag. Newly created tags must be added to the tags table for the buffer you intend to use them in, as in: "Gtk.Text_Tag_Table.Add (Get_Tag_Table (Buffer), Tag)". See also Gtk.Text_Buffer.Create_Tag which is a more convenient way of creating a tag. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
tag name
type Gtk_Text_Tag is access all Gtk_Text_Tag_Record'Class;
function Gtk_Text_Tag_New (Name : UTF8_String := "") return Gtk_Text_Tag
Creates a GtkTextTag. Newly created tags must be added to the tags table for the buffer you intend to use them in, as in: "Gtk.Text_Tag_Table.Add (Get_Tag_Table (Buffer), Tag)". See also Gtk.Text_Buffer.Create_Tag which is a more convenient way of creating a tag.
tag name
type Gtk_Text_Tag_Record is new GObject_Record with null record;
Indent_Property : constant Glib.Properties.Property_Int;
Amount to indent the paragraph, in pixels.
A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.
Indent_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the indent property is set.
procedure Initialize
(Tag : not null access Gtk_Text_Tag_Record'Class;
Name : UTF8_String := "")
Creates a GtkTextTag. Newly created tags must be added to the tags table for the buffer you intend to use them in, as in: "Gtk.Text_Tag_Table.Add (Get_Tag_Table (Buffer), Tag)". See also Gtk.Text_Buffer.Create_Tag which is a more convenient way of creating a tag. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
tag name
Insert_Hyphens_Property : constant Glib.Properties.Property_Boolean;
Whether to insert hyphens at breaks.
Insert_Hyphens_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the insert-hyphens property is set.
Invisible_Property : constant Glib.Properties.Property_Boolean;
Whether this text is hidden.
Note that there may still be problems with the support for invisible text, in particular when navigating programmatically inside a buffer containing invisible segments.
Invisible_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the invisible property is set.
Justification_Property : constant Gtk.Enums.Property_Gtk_Justification;
Left, right, or center justification.
Justification_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the justification property is set.
Language_Property : constant Glib.Properties.Property_String;
The language this text is in, as an ISO code.
Pango can use this as a hint when rendering the text. If not set, an appropriate default will be used.
Note that the initial value of this property depends on the current locale, see also [funcGtk.get_default_language].
Language_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the language property is set.
Left_Margin_Property : constant Glib.Properties.Property_Int;
Width of the left margin in pixels.
Left_Margin_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the left-margin property is set.
Letter_Spacing_Property : constant Glib.Properties.Property_Int;
Extra spacing between graphemes, in Pango units.
Letter_Spacing_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the letter-spacing property is set.
Line_Height_Property : constant Glib.Properties.Property_Float;
Factor to scale line height by.
Line_Height_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the line-height property is set.
Name_Property : constant Glib.Properties.Property_String;
The name used to refer to the tag.
null for anonymous tags.
Overline_Property : constant Glib.Properties.Property_Boxed;
Type: Pango.Overline Style of overline for this text.
Overline_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA This property modifies the color of overlines.
If not set, overlines will use the foreground color.
Overline_Rgba_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the overline-rgba property is set.
Overline_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the overline property is set.
Paragraph_Background_Property : constant Glib.Properties.Property_String;
Flags: write The paragraph background color as a string.
Paragraph_Background_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA The paragraph background color as a GdkRGBA.
Paragraph_Background_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the paragraph-background property is set.
Pixels_Above_Lines_Property : constant Glib.Properties.Property_Int;
Pixels of blank space above paragraphs.
Pixels_Above_Lines_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the pixels-above-lines property is set.
Pixels_Below_Lines_Property : constant Glib.Properties.Property_Int;
Pixels of blank space below paragraphs.
Pixels_Below_Lines_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the pixels-below-lines property is set.
Pixels_Inside_Wrap_Property : constant Glib.Properties.Property_Int;
Pixels of blank space between wrapped lines in a paragraph.
Pixels_Inside_Wrap_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the pixels-inside-wrap property is set.
Right_Margin_Property : constant Glib.Properties.Property_Int;
Width of the right margin, in pixels.
Right_Margin_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the right-margin property is set.
Rise_Property : constant Glib.Properties.Property_Int;
Offset of text above the baseline, in Pango units.
Negative values go below the baseline.
Rise_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the rise property is set.
Scale_Property : constant Glib.Properties.Property_Double;
Type: Gdouble Font size as a scale factor relative to the default font size.
This properly adapts to theme changes, etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE.
Scale_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the scale property is set.
Sentence_Property : constant Glib.Properties.Property_Boolean;
Whether this tag represents a single sentence.
This affects cursor movement.
Sentence_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the sentence property is set.
procedure Set_Priority
(Tag : not null access Gtk_Text_Tag_Record;
Priority : Glib.Gint)
Sets the priority of a GtkTextTag. Valid priorities start at 0 and go to one less than [methodGtk.TextTagTable.get_size]. Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag. Higher priority tags "win" if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with [methodGtk.TextBuffer.create_tag], which adds the tag to the buffer's table automatically.
the new priority
Show_Spaces_Property : constant Glib.Properties.Property_Boxed;
Type: Pango.Show_Flags How to render invisible characters.
Show_Spaces_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the show-spaces property is set.
Size_Points_Property : constant Glib.Properties.Property_Double;
Type: Gdouble Font size in points.
Size_Property : constant Glib.Properties.Property_Int;
Font size in Pango units.
Size_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the size property is set.
Stretch_Property : constant Pango.Enums.Property_Stretch;
Type: Pango.Enums.Stretch Font stretch as a PangoStretch, e.g. Pango.Enums.Pango_Stretch_Condensed.
Stretch_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the stretch property is set.
Strikethrough_Property : constant Glib.Properties.Property_Boolean;
Whether to strike through the text.
Strikethrough_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA This property modifies the color of strikeouts.
If not set, strikeouts will use the foreground color.
Strikethrough_Rgba_Set_Property : constant Glib.Properties.Property_Boolean;
If the strikethrough-rgba property has been set.
Strikethrough_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the strikethrough property is set.
Style_Property : constant Pango.Enums.Property_Style;
Type: Pango.Enums.Style Font style as a PangoStyle, e.g. Pango.Enums.Pango_Style_Italic.
Style_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the style property is set.
Tabs_Property : constant Glib.Properties.Property_Boxed;
Type: Pango.Tab_Array Custom tabs for this text.
Tabs_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the tabs property is set.
package Text_Tag_List is new Generic_SList (Gtk.Text_Tag.Gtk_Text_Tag);
Text_Transform_Property : constant Glib.Properties.Property_Boxed;
Type: Pango.Text_Transform How to transform the text for display.
Text_Transform_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the text-transform property is set.
Underline_Property : constant Pango.Enums.Property_Underline;
Type: Pango.Enums.Underline Style of underline for this text.
Underline_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA This property modifies the color of underlines.
If not set, underlines will use the foreground color.
If [propertyGtk.TextTag:underline] is set to Pango.Enums.Pango_Underline_Error, an alternate color may be applied instead of the foreground. Setting this property will always override those defaults.
Underline_Rgba_Set_Property : constant Glib.Properties.Property_Boolean;
If the underline-rgba property has been set.
Underline_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the underline property is set.
Variant_Property : constant Pango.Enums.Property_Variant;
Type: Pango.Enums.Variant Font variant as a PangoVariant, e.g. Pango.Enums.Pango_Variant_Small_Caps.
Variant_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the variant property is set.
Weight_Property : constant Glib.Properties.Property_Int;
Font weight as an integer.
Weight_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the weight property is set.
Word_Property : constant Glib.Properties.Property_Boolean;
Whether this tag represents a single word.
This affects line breaks and cursor movement.
Word_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the word property is set.
Wrap_Mode_Property : constant Gtk.Enums.Property_Gtk_Wrap_Mode;
Whether to wrap lines never, at word boundaries, or at character boundaries.
Wrap_Mode_Set_Property : constant Glib.Properties.Property_Boolean;
Whether the wrap-mode property is set.