Struct fontdue::layout::GlyphPosition[][src]

pub struct GlyphPosition<U: Copy + Clone = ()> {
    pub key: GlyphRasterConfig,
    pub font_index: usize,
    pub parent: char,
    pub x: f32,
    pub y: f32,
    pub width: usize,
    pub height: usize,
    pub char_data: CharacterData,
    pub user_data: U,
}
Expand description

A positioned scaled glyph.

Fields

key: GlyphRasterConfig

Hashable key that can be used to uniquely identify a rasterized glyph.

font_index: usize

The index of the font used to generate this glyph position.

parent: char

The associated character that generated this glyph. A character may generate multiple glyphs.

x: f32

The xmin of the glyph bounding box. This represents the left side of the glyph. Dimensions are in pixels, and are always whole numbers.

y: f32

The ymin of the glyph bounding box. If your coordinate system is PositiveYUp, this represents the bottom side of the glyph. If your coordinate system is PositiveYDown, this represents the top side of the glyph. This is like this so that (y + height) always produces the other bound for the glyph.

width: usize

The width of the glyph. Dimensions are in pixels.

height: usize

The height of the glyph. Dimensions are in pixels.

char_data: CharacterData

Additional metadata associated with the character used to generate this glyph.

user_data: U

Custom user data associated with the text styled used to generate this glyph.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.