Struct nanovg::Frame [] [src]

pub struct Frame<'a> { /* fields omitted */ }

A frame which can draw paths. All NanoVG path drawing operations are done on a frame.

Methods

impl<'a> Frame<'a>
[src]

[src]

Get the underlying context this frame was created on.

[src]

Get current transform which the frame is transformed by.

[src]

Transform current Frame by 'transform' and call 'handler' with transformed Frame as its only parameter. You can get the passed transform by calling get_transform on Frame instance.

transform frame gets transformed by this Transform (it takes previous frame transform into account) handler the callback where you use the new transformed Frame

[src]

Draw a new path.

handler is the callback in which you operate the path. options control how the path is rendered.

[src]

Draw a single line on the screen. Newline characters are ignored. font the font face to use. (x, y) the origin / position to draw the text at. The origin is relative to the alignment of options. text the string to draw. options optional (Default::default) options that control the visual appearance of the text.

[src]

Draw multiline text on the screen. font the font face to use. (x, y) the origin / position to draw the text at. The origin is relative to the alignment of options. text the string to draw. options optional (Default::default) options that control the visual appearance of the text.

[src]

Measures specified text string. Returns tuple (f32, TextBounds) where the first element specifies horizontal advance of measured text and the second element specifies the bounding box of measured text. font the font face to use. (x, y) the origin / position to measure the text from. text the string to measure. options optional (Default::default) options that controls how the text is measured.

[src]

Measures specified multi-text string. Returns bounding box of measured multi-text. font the font face to use. (x, y) the origin / position to measure the text from. text the string to measure. options optional (Default::default) options that controls how the text is measured.

Important traits for TextGlyphPositions<'a>
[src]

Calculates and breaks text into series of glyph positions. Returns iterator over all glyph positions in text. (x, y) the coordinate space from which to offset coordinates in GlyphPosition text the text to break into glyph positions

[src]

Returns vertical text metrics based on given font and text options Measured values are stored in TextMetrics struct in local coordinate space. options the options specify how metrics should be calculated. font the font for which to calculate metrics.

Important traits for TextBreakLines<'a>
[src]

Breaks text into lines. Text is split at word boundaries, new-line character or when row width exceeds break_row_width. Returns iterator over text lines. text the text to break into lines break_row_width maximum width of row

Trait Implementations

impl<'a> Debug for Frame<'a>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> !Send for Frame<'a>

impl<'a> !Sync for Frame<'a>