pub struct TextTagBuilder { /* private fields */ }Expand description
A builder-pattern type to construct TextTag objects.
Implementations§
Source§impl TextTagBuilder
impl TextTagBuilder
Sourcepub fn accumulative_margin(self, accumulative_margin: bool) -> Self
pub fn accumulative_margin(self, accumulative_margin: bool) -> Self
Sourcepub fn allow_breaks(self, allow_breaks: bool) -> Self
pub fn allow_breaks(self, allow_breaks: bool) -> Self
Whether breaks are allowed.
Sourcepub fn allow_breaks_set(self, allow_breaks_set: bool) -> Self
pub fn allow_breaks_set(self, allow_breaks_set: bool) -> Self
Whether the allow-breaks property is set.
Sourcepub fn background(self, background: impl Into<GString>) -> Self
pub fn background(self, background: impl Into<GString>) -> Self
Background color as a string.
Sourcepub fn background_full_height(self, background_full_height: bool) -> Self
pub fn background_full_height(self, background_full_height: bool) -> Self
Whether the background color fills the entire line height or only the height of the tagged characters.
Sourcepub fn background_full_height_set(
self,
background_full_height_set: bool,
) -> Self
pub fn background_full_height_set( self, background_full_height_set: bool, ) -> Self
Whether the background-full-height property is set.
Sourcepub fn background_rgba(self, background_rgba: &RGBA) -> Self
pub fn background_rgba(self, background_rgba: &RGBA) -> Self
Background color as a gdk::RGBA.
Sourcepub fn background_set(self, background_set: bool) -> Self
pub fn background_set(self, background_set: bool) -> Self
Whether the background property is set.
Sourcepub fn direction(self, direction: TextDirection) -> Self
pub fn direction(self, direction: TextDirection) -> Self
Text direction, e.g. right-to-left or left-to-right.
Sourcepub fn editable_set(self, editable_set: bool) -> Self
pub fn editable_set(self, editable_set: bool) -> Self
Whether the editable property is set.
Sourcepub fn fallback(self, fallback: bool) -> Self
pub fn fallback(self, fallback: bool) -> Self
Whether font fallback is enabled.
When set to true, other fonts will be substituted
where the current font is missing glyphs.
Sourcepub fn fallback_set(self, fallback_set: bool) -> Self
pub fn fallback_set(self, fallback_set: bool) -> Self
Whether the fallback property is set.
Sourcepub fn family(self, family: impl Into<GString>) -> Self
pub fn family(self, family: impl Into<GString>) -> Self
Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
Sourcepub fn family_set(self, family_set: bool) -> Self
pub fn family_set(self, family_set: bool) -> Self
Whether the family property is set.
Sourcepub fn font(self, font: impl Into<GString>) -> Self
pub fn font(self, font: impl Into<GString>) -> Self
Font description as string, e.g. "Sans Italic 12".
Note that the initial value of this property depends on
the internals of pango::FontDescription.
Sourcepub fn font_desc(self, font_desc: &FontDescription) -> Self
pub fn font_desc(self, font_desc: &FontDescription) -> Self
Font description as a pango::FontDescription.
Sourcepub fn font_features(self, font_features: impl Into<GString>) -> Self
pub fn font_features(self, font_features: impl Into<GString>) -> Self
OpenType font features, as a string.
Sourcepub fn font_features_set(self, font_features_set: bool) -> Self
pub fn font_features_set(self, font_features_set: bool) -> Self
Whether the font-features property is set.
Sourcepub fn foreground(self, foreground: impl Into<GString>) -> Self
pub fn foreground(self, foreground: impl Into<GString>) -> Self
Foreground color as a string.
Sourcepub fn foreground_rgba(self, foreground_rgba: &RGBA) -> Self
pub fn foreground_rgba(self, foreground_rgba: &RGBA) -> Self
Foreground color as a gdk::RGBA.
Sourcepub fn foreground_set(self, foreground_set: bool) -> Self
pub fn foreground_set(self, foreground_set: bool) -> Self
Whether the foreground property is set.
Sourcepub fn indent(self, indent: i32) -> Self
pub fn indent(self, indent: i32) -> Self
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.
Sourcepub fn indent_set(self, indent_set: bool) -> Self
pub fn indent_set(self, indent_set: bool) -> Self
Whether the indent property is set.
Sourcepub fn insert_hyphens(self, insert_hyphens: bool) -> Self
pub fn insert_hyphens(self, insert_hyphens: bool) -> Self
Whether to insert hyphens at breaks.
Sourcepub fn insert_hyphens_set(self, insert_hyphens_set: bool) -> Self
pub fn insert_hyphens_set(self, insert_hyphens_set: bool) -> Self
Whether the insert-hyphens property is set.
Sourcepub fn invisible(self, invisible: bool) -> Self
pub fn invisible(self, invisible: bool) -> Self
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.
Sourcepub fn invisible_set(self, invisible_set: bool) -> Self
pub fn invisible_set(self, invisible_set: bool) -> Self
Whether the invisible property is set.
Sourcepub fn justification(self, justification: Justification) -> Self
pub fn justification(self, justification: Justification) -> Self
Left, right, or center justification.
Sourcepub fn justification_set(self, justification_set: bool) -> Self
pub fn justification_set(self, justification_set: bool) -> Self
Whether the justification property is set.
Sourcepub fn language(self, language: impl Into<GString>) -> Self
pub fn language(self, language: impl Into<GString>) -> Self
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 default_language().
Sourcepub fn language_set(self, language_set: bool) -> Self
pub fn language_set(self, language_set: bool) -> Self
Whether the language property is set.
Sourcepub fn left_margin(self, left_margin: i32) -> Self
pub fn left_margin(self, left_margin: i32) -> Self
Width of the left margin in pixels.
Sourcepub fn left_margin_set(self, left_margin_set: bool) -> Self
pub fn left_margin_set(self, left_margin_set: bool) -> Self
Whether the left-margin property is set.
Sourcepub fn letter_spacing(self, letter_spacing: i32) -> Self
pub fn letter_spacing(self, letter_spacing: i32) -> Self
Extra spacing between graphemes, in Pango units.
Sourcepub fn letter_spacing_set(self, letter_spacing_set: bool) -> Self
pub fn letter_spacing_set(self, letter_spacing_set: bool) -> Self
Whether the letter-spacing property is set.
Sourcepub fn line_height(self, line_height: f32) -> Self
Available on crate feature v4_6 only.
pub fn line_height(self, line_height: f32) -> Self
v4_6 only.Factor to scale line height by.
Sourcepub fn line_height_set(self, line_height_set: bool) -> Self
Available on crate feature v4_6 only.
pub fn line_height_set(self, line_height_set: bool) -> Self
v4_6 only.Whether the line-height property is set.
Sourcepub fn name(self, name: impl Into<GString>) -> Self
pub fn name(self, name: impl Into<GString>) -> Self
The name used to refer to the tag.
None for anonymous tags.
Sourcepub fn overline_rgba(self, overline_rgba: &RGBA) -> Self
pub fn overline_rgba(self, overline_rgba: &RGBA) -> Self
This property modifies the color of overlines.
If not set, overlines will use the foreground color.
Sourcepub fn overline_rgba_set(self, overline_rgba_set: bool) -> Self
pub fn overline_rgba_set(self, overline_rgba_set: bool) -> Self
Whether the overline-rgba property is set.
Sourcepub fn overline_set(self, overline_set: bool) -> Self
pub fn overline_set(self, overline_set: bool) -> Self
Whether the overline property is set.
Sourcepub fn paragraph_background(
self,
paragraph_background: impl Into<GString>,
) -> Self
pub fn paragraph_background( self, paragraph_background: impl Into<GString>, ) -> Self
The paragraph background color as a string.
Sourcepub fn paragraph_background_rgba(self, paragraph_background_rgba: &RGBA) -> Self
pub fn paragraph_background_rgba(self, paragraph_background_rgba: &RGBA) -> Self
The paragraph background color as a gdk::RGBA.
Sourcepub fn paragraph_background_set(self, paragraph_background_set: bool) -> Self
pub fn paragraph_background_set(self, paragraph_background_set: bool) -> Self
Whether the paragraph-background property is set.
Sourcepub fn pixels_above_lines(self, pixels_above_lines: i32) -> Self
pub fn pixels_above_lines(self, pixels_above_lines: i32) -> Self
Pixels of blank space above paragraphs.
Sourcepub fn pixels_above_lines_set(self, pixels_above_lines_set: bool) -> Self
pub fn pixels_above_lines_set(self, pixels_above_lines_set: bool) -> Self
Whether the pixels-above-lines property is set.
Sourcepub fn pixels_below_lines(self, pixels_below_lines: i32) -> Self
pub fn pixels_below_lines(self, pixels_below_lines: i32) -> Self
Pixels of blank space below paragraphs.
Sourcepub fn pixels_below_lines_set(self, pixels_below_lines_set: bool) -> Self
pub fn pixels_below_lines_set(self, pixels_below_lines_set: bool) -> Self
Whether the pixels-below-lines property is set.
Sourcepub fn pixels_inside_wrap(self, pixels_inside_wrap: i32) -> Self
pub fn pixels_inside_wrap(self, pixels_inside_wrap: i32) -> Self
Pixels of blank space between wrapped lines in a paragraph.
Sourcepub fn pixels_inside_wrap_set(self, pixels_inside_wrap_set: bool) -> Self
pub fn pixels_inside_wrap_set(self, pixels_inside_wrap_set: bool) -> Self
Whether the pixels-inside-wrap property is set.
Sourcepub fn right_margin(self, right_margin: i32) -> Self
pub fn right_margin(self, right_margin: i32) -> Self
Width of the right margin, in pixels.
Sourcepub fn right_margin_set(self, right_margin_set: bool) -> Self
pub fn right_margin_set(self, right_margin_set: bool) -> Self
Whether the right-margin property is set.
Sourcepub fn rise(self, rise: i32) -> Self
pub fn rise(self, rise: i32) -> Self
Offset of text above the baseline, in Pango units.
Negative values go below the baseline.
Sourcepub fn scale(self, scale: f64) -> Self
pub fn scale(self, scale: f64) -> Self
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.
Sourcepub fn sentence(self, sentence: bool) -> Self
Available on crate feature v4_6 only.
pub fn sentence(self, sentence: bool) -> Self
v4_6 only.Whether this tag represents a single sentence.
This affects cursor movement.
Sourcepub fn sentence_set(self, sentence_set: bool) -> Self
Available on crate feature v4_6 only.
pub fn sentence_set(self, sentence_set: bool) -> Self
v4_6 only.Whether the sentence property is set.
Sourcepub fn show_spaces(self, show_spaces: ShowFlags) -> Self
pub fn show_spaces(self, show_spaces: ShowFlags) -> Self
How to render invisible characters.
Sourcepub fn show_spaces_set(self, show_spaces_set: bool) -> Self
pub fn show_spaces_set(self, show_spaces_set: bool) -> Self
Whether the show-spaces property is set.
Sourcepub fn size_points(self, size_points: f64) -> Self
pub fn size_points(self, size_points: f64) -> Self
Font size in points.
Sourcepub fn stretch(self, stretch: Stretch) -> Self
pub fn stretch(self, stretch: Stretch) -> Self
Font stretch as a pango::Stretch, e.g. pango::Stretch::Condensed.
Sourcepub fn stretch_set(self, stretch_set: bool) -> Self
pub fn stretch_set(self, stretch_set: bool) -> Self
Whether the stretch property is set.
Sourcepub fn strikethrough(self, strikethrough: bool) -> Self
pub fn strikethrough(self, strikethrough: bool) -> Self
Whether to strike through the text.
Sourcepub fn strikethrough_rgba(self, strikethrough_rgba: &RGBA) -> Self
pub fn strikethrough_rgba(self, strikethrough_rgba: &RGBA) -> Self
This property modifies the color of strikeouts.
If not set, strikeouts will use the foreground color.
Sourcepub fn strikethrough_rgba_set(self, strikethrough_rgba_set: bool) -> Self
pub fn strikethrough_rgba_set(self, strikethrough_rgba_set: bool) -> Self
If the strikethrough-rgba property has been set.
Sourcepub fn strikethrough_set(self, strikethrough_set: bool) -> Self
pub fn strikethrough_set(self, strikethrough_set: bool) -> Self
Whether the strikethrough property is set.
Sourcepub fn style(self, style: Style) -> Self
pub fn style(self, style: Style) -> Self
Font style as a pango::Style, e.g. pango::Style::Italic.
Sourcepub fn text_transform(self, text_transform: TextTransform) -> Self
Available on crate feature v4_6 only.
pub fn text_transform(self, text_transform: TextTransform) -> Self
v4_6 only.How to transform the text for display.
Sourcepub fn text_transform_set(self, text_transform_set: bool) -> Self
Available on crate feature v4_6 only.
pub fn text_transform_set(self, text_transform_set: bool) -> Self
v4_6 only.Whether the text-transform property is set.
Sourcepub fn underline_rgba(self, underline_rgba: &RGBA) -> Self
pub fn underline_rgba(self, underline_rgba: &RGBA) -> Self
This property modifies the color of underlines.
If not set, underlines will use the foreground color.
If underline is set to pango::Underline::Error,
an alternate color may be applied instead of the foreground. Setting
this property will always override those defaults.
Sourcepub fn underline_rgba_set(self, underline_rgba_set: bool) -> Self
pub fn underline_rgba_set(self, underline_rgba_set: bool) -> Self
If the underline-rgba property has been set.
Sourcepub fn underline_set(self, underline_set: bool) -> Self
pub fn underline_set(self, underline_set: bool) -> Self
Whether the underline property is set.
Sourcepub fn variant(self, variant: Variant) -> Self
pub fn variant(self, variant: Variant) -> Self
Font variant as a pango::Variant, e.g. pango::Variant::SmallCaps.
Sourcepub fn variant_set(self, variant_set: bool) -> Self
pub fn variant_set(self, variant_set: bool) -> Self
Whether the variant property is set.
Sourcepub fn weight_set(self, weight_set: bool) -> Self
pub fn weight_set(self, weight_set: bool) -> Self
Whether the weight property is set.
Sourcepub fn word(self, word: bool) -> Self
Available on crate feature v4_6 only.
pub fn word(self, word: bool) -> Self
v4_6 only.Whether this tag represents a single word.
This affects line breaks and cursor movement.
Sourcepub fn word_set(self, word_set: bool) -> Self
Available on crate feature v4_6 only.
pub fn word_set(self, word_set: bool) -> Self
v4_6 only.Whether the word property is set.
Sourcepub fn wrap_mode(self, wrap_mode: WrapMode) -> Self
pub fn wrap_mode(self, wrap_mode: WrapMode) -> Self
Whether to wrap lines never, at word boundaries, or at character boundaries.
Sourcepub fn wrap_mode_set(self, wrap_mode_set: bool) -> Self
pub fn wrap_mode_set(self, wrap_mode_set: bool) -> Self
Whether the wrap-mode property is set.