pub struct TextTagBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct TextTag objects.

Implementations§

source§

impl TextTagBuilder

source

pub fn new() -> Self

Create a new TextTagBuilder.

source

pub fn build(self) -> TextTag

Build the TextTag.

source

pub fn accumulative_margin(self, accumulative_margin: bool) -> Self

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).

source

pub fn allow_breaks(self, allow_breaks: bool) -> Self

Whether breaks are allowed.

source

pub fn allow_breaks_set(self, allow_breaks_set: bool) -> Self

source

pub fn background(self, background: &str) -> Self

Background color as a string.

source

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.

source

pub fn background_full_height_set( self, background_full_height_set: bool ) -> Self

source

pub fn background_rgba(self, background_rgba: &RGBA) -> Self

Background color as a gdk::RGBA.

source

pub fn background_set(self, background_set: bool) -> Self

source

pub fn direction(self, direction: TextDirection) -> Self

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

source

pub fn editable(self, editable: bool) -> Self

Whether the text can be modified by the user.

source

pub fn editable_set(self, editable_set: bool) -> Self

source

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.

source

pub fn fallback_set(self, fallback_set: bool) -> Self

source

pub fn family(self, family: &str) -> Self

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

source

pub fn family_set(self, family_set: bool) -> Self

source

pub fn font(self, font: &str) -> 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.

source

pub fn font_desc(self, font_desc: &FontDescription) -> Self

Font description as a pango::FontDescription.

source

pub fn font_features(self, font_features: &str) -> Self

OpenType font features, as a string.

source

pub fn font_features_set(self, font_features_set: bool) -> Self

source

pub fn foreground(self, foreground: &str) -> Self

Foreground color as a string.

source

pub fn foreground_rgba(self, foreground_rgba: &RGBA) -> Self

Foreground color as a gdk::RGBA.

source

pub fn foreground_set(self, foreground_set: bool) -> Self

source

pub fn indent(self, indent: i32) -> Self

Amount to indent the paragraph, in pixels.

source

pub fn indent_set(self, indent_set: bool) -> Self

source

pub fn insert_hyphens(self, insert_hyphens: bool) -> Self

Whether to insert hyphens at breaks.

source

pub fn insert_hyphens_set(self, insert_hyphens_set: bool) -> Self

source

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.

source

pub fn invisible_set(self, invisible_set: bool) -> Self

source

pub fn justification(self, justification: Justification) -> Self

Left, right, or center justification.

source

pub fn justification_set(self, justification_set: bool) -> Self

source

pub fn language(self, language: &str) -> 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().

source

pub fn language_set(self, language_set: bool) -> Self

source

pub fn left_margin(self, left_margin: i32) -> Self

Width of the left margin in pixels.

source

pub fn left_margin_set(self, left_margin_set: bool) -> Self

source

pub fn letter_spacing(self, letter_spacing: i32) -> Self

Extra spacing between graphemes, in Pango units.

source

pub fn letter_spacing_set(self, letter_spacing_set: bool) -> Self

source

pub fn line_height(self, line_height: f32) -> Self

Available on crate feature v4_6 only.

Factor to scale line height by.

source

pub fn line_height_set(self, line_height_set: bool) -> Self

Available on crate feature v4_6 only.
source

pub fn name(self, name: &str) -> Self

The name used to refer to the tag.

None for anonymous tags.

source

pub fn overline(self, overline: Overline) -> Self

Style of overline for this text.

source

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.

source

pub fn overline_rgba_set(self, overline_rgba_set: bool) -> Self

source

pub fn overline_set(self, overline_set: bool) -> Self

source

pub fn paragraph_background(self, paragraph_background: &str) -> Self

The paragraph background color as a string.

source

pub fn paragraph_background_rgba(self, paragraph_background_rgba: &RGBA) -> Self

The paragraph background color as a gdk::RGBA.

source

pub fn paragraph_background_set(self, paragraph_background_set: bool) -> Self

source

pub fn pixels_above_lines(self, pixels_above_lines: i32) -> Self

Pixels of blank space above paragraphs.

source

pub fn pixels_above_lines_set(self, pixels_above_lines_set: bool) -> Self

source

pub fn pixels_below_lines(self, pixels_below_lines: i32) -> Self

Pixels of blank space below paragraphs.

source

pub fn pixels_below_lines_set(self, pixels_below_lines_set: bool) -> Self

source

pub fn pixels_inside_wrap(self, pixels_inside_wrap: i32) -> Self

Pixels of blank space between wrapped lines in a paragraph.

source

pub fn pixels_inside_wrap_set(self, pixels_inside_wrap_set: bool) -> Self

source

pub fn right_margin(self, right_margin: i32) -> Self

Width of the right margin, in pixels.

source

pub fn right_margin_set(self, right_margin_set: bool) -> Self

source

pub fn rise(self, rise: i32) -> Self

Offset of text above the baseline, in Pango units.

Negative values go below the baseline.

source

pub fn rise_set(self, rise_set: bool) -> Self

source

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.

source

pub fn scale_set(self, scale_set: bool) -> Self

source

pub fn sentence(self, sentence: bool) -> Self

Available on crate feature v4_6 only.

Whether this tag represents a single sentence.

This affects cursor movement.

source

pub fn sentence_set(self, sentence_set: bool) -> Self

Available on crate feature v4_6 only.
source

pub fn show_spaces(self, show_spaces: ShowFlags) -> Self

How to render invisible characters.

source

pub fn show_spaces_set(self, show_spaces_set: bool) -> Self

source

pub fn size(self, size: i32) -> Self

Font size in Pango units.

source

pub fn size_points(self, size_points: f64) -> Self

Font size in points.

source

pub fn size_set(self, size_set: bool) -> Self

source

pub fn stretch(self, stretch: Stretch) -> Self

Font stretch as a pango::Stretch, e.g. pango::Stretch::Condensed.

source

pub fn stretch_set(self, stretch_set: bool) -> Self

source

pub fn strikethrough(self, strikethrough: bool) -> Self

Whether to strike through the text.

source

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.

source

pub fn strikethrough_rgba_set(self, strikethrough_rgba_set: bool) -> Self

If the strikethrough-rgba property has been set.

source

pub fn strikethrough_set(self, strikethrough_set: bool) -> Self

source

pub fn style(self, style: Style) -> Self

Font style as a pango::Style, e.g. pango::Style::Italic.

source

pub fn style_set(self, style_set: bool) -> Self

source

pub fn tabs(self, tabs: &TabArray) -> Self

Custom tabs for this text.

source

pub fn tabs_set(self, tabs_set: bool) -> Self

source

pub fn text_transform(self, text_transform: TextTransform) -> Self

Available on crate feature v4_6 only.

How to transform the text for display.

source

pub fn text_transform_set(self, text_transform_set: bool) -> Self

Available on crate feature v4_6 only.
source

pub fn underline(self, underline: Underline) -> Self

Style of underline for this text.

source

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 property::TextTag::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.

source

pub fn underline_rgba_set(self, underline_rgba_set: bool) -> Self

If the underline-rgba property has been set.

source

pub fn underline_set(self, underline_set: bool) -> Self

source

pub fn variant(self, variant: Variant) -> Self

Font variant as a pango::Variant, e.g. pango::Variant::SmallCaps.

source

pub fn variant_set(self, variant_set: bool) -> Self

source

pub fn weight(self, weight: i32) -> Self

Font weight as an integer.

source

pub fn weight_set(self, weight_set: bool) -> Self

source

pub fn word(self, word: bool) -> Self

Available on crate feature v4_6 only.

Whether this tag represents a single word.

This affects line breaks and cursor movement.

source

pub fn word_set(self, word_set: bool) -> Self

Available on crate feature v4_6 only.
source

pub fn wrap_mode(self, wrap_mode: WrapMode) -> Self

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

source

pub fn wrap_mode_set(self, wrap_mode_set: bool) -> Self

Trait Implementations§

source§

impl Clone for TextTagBuilder

source§

fn clone(&self) -> TextTagBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for TextTagBuilder

source§

fn default() -> TextTagBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.