pub struct FontImage {
    pub size: [usize; 2],
    pub pixels: Vec<f32>,
}
Expand description

A single-channel image designed for the font texture.

Each value represents “coverage”, i.e. how much a texel is covered by a character.

This is roughly interpreted as the opacity of a white image.

Fields

size: [usize; 2]

width, height

pixels: Vec<f32>

The coverage value.

Often you want to use Self::srgba_pixels instead.

Implementations

Returns the textures as sRGBA premultiplied pixels, row by row, top to bottom.

gamma should normally be set to 1.0. If you are having problems with text looking skinny and pixelated, try setting a lower gamma, e.g. 0.5.

Clone a sub-region as a new image.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Serialize this value into the given Serde serializer. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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.