Struct stb_truetype::FontInfo [] [src]

pub struct FontInfo<Data: Deref<Target = [u8]>> { /* fields omitted */ }

Methods

impl<Data: Deref<Target = [u8]>> FontInfo<Data>
[src]

[src]

Given an offset into the file that defines a font, this function builds the necessary cached info for the rest of the system.

[src]

[src]

If you're going to perform multiple operations on the same character and you want a speed-up, call this function with the character you're going to process, then use glyph-based functions instead of the codepoint-based functions.

[src]

Returns the series of vertices encoding the shape of the glyph for this codepoint.

The shape is a series of countours. Each one starts with a moveto, then consists of a series of mixed lineto and curveto segments. A lineto draws a line from previous endpoint to its x,y; a curveto draws a quadratic bezier from previous endpoint to its x,y, using cx,cy as the bezier control point.

[src]

Like get_codepoint_box, but takes a glyph index. Use this if you have cached the glyph index for a codepoint.

[src]

Gets the bounding box of the visible part of the glyph, in unscaled coordinates

[src]

returns true if nothing is drawn for this glyph

[src]

Like get_codepoint_shape, but takes a glyph index instead. Use this if you have cached the glyph index for a codepoint.

[src]

like get_codepoint_h_metrics, but takes a glyph index instead. Use this if you have cached the glyph index for a codepoint.

[src]

like get_codepoint_kern_advance, but takes glyph indices instead. Use this if you have cached the glyph indices for the codepoints.

[src]

an additional amount to add to the 'advance' value between cp1 and cp2

[src]

left_side_bearing is the offset from the current horizontal position to the left edge of the character advance_width is the offset from the current horizontal position to the next horizontal position these are expressed in unscaled coordinates

[src]

ascent is the coordinate above the baseline the font extends; descent is the coordinate below the baseline the font extends (i.e. it is typically negative) line_gap is the spacing between one row's descent and the next row's ascent... so you should advance the vertical position by ascent - descent + line_gap these are expressed in unscaled coordinates, so you must multiply by the scale factor for a given size

[src]

the bounding box around all possible characters

[src]

computes a scale factor to produce a font whose "height" is 'pixels' tall. Height is measured as the distance from the highest ascender to the lowest descender; in other words, it's equivalent to calling GetFontVMetrics and computing: scale = pixels / (ascent - descent) so if you prefer to measure height by the ascent only, use a similar calculation.

[src]

Returns the units per EM square of this font.

[src]

computes a scale factor to produce a font whose EM size is mapped to pixels tall. This is probably what traditional APIs compute, but I'm not positive.

[src]

like get_codepoint_bitmap_box_subpixel, but takes a glyph index instead of a codepoint.

[src]

like get_codepoint_bitmap_box, but takes a glyph index instead of a codepoint.

[src]

same as get_codepoint_bitmap_box, but you can specify a subpixel shift for the character

[src]

get the bounding box of the bitmap centered around the glyph origin; so the bitmap width is x1-x0, height is y1-y0, and location to place the bitmap top left is (left_side_bearing*scale, y0). (Note that the bitmap uses y-increases-down, but the shape uses y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.)

[src]

Trait Implementations

impl<Data: Clone + Deref<Target = [u8]>> Clone for FontInfo<Data>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Data: Debug + Deref<Target = [u8]>> Debug for FontInfo<Data>
[src]

[src]

Formats the value using the given formatter.