Struct rokol::fons::FontStash[][src]

pub struct FontStash { /* fields omitted */ }
Expand description

Shared ownership of font stash

Hack for creation

Renderer needs fixed memory position so that fontstash::sys can call callback methods of it.

  1. Create Renderer in a Box with FontStash being uninitialized
  2. Call FontStash::init_mut to initialize FontStash

Implementations

Hack for creation

Font storage. Each font is keyed with name string.

Atlas

Creates fontstash atlas size copying the previous data

Creates new fontstash atlas with size without copying the previous data

States

NOTE: DPI scaling?

Horizontal space between characters?

Sets alignment of quadliterals returned with FontStash::text_iter

Texture

NOTE: Pixel is in one byte (8 bits alpha channel only)

State stack

Draw

Iterator of quadliterals aligned with Align

Measure

Returns [left_x, top_y, right_x, bottom_y]. Note that it doesn’t handle multiple lines of text. You need custom layer for multi-line text!

Returns [width, height]. Note that it doesn’t handle multiple lines of text. You need custom layer for multi-line text!

Trait Implementations

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