Struct ringraphics::ttf::Ttf[][src]

pub struct Ttf { /* fields omitted */ }

Methods

impl Ttf
[src]

distance between baselines

distance between baseline and top of highest character in the font

distance between the baseline and bottom of the lowest character in the font

distance between the bottom of the lowest character in the font and the top of the highest character if they were put in consecutive lines. separation between 2 lines

returns the type of antialiasing of this font

returns the mesh for the string passed, put this mesh in a vao when drawing the same text for a long time or use a renderer draw_string function if it changes very often

returns the bounding box of a text drawn from a mesh returned by like the mesh function like gl::draw_string or other renderers do

returns the mesh of a text so it fits in a box of the size and position passed as parameters, if h<0 it won't adjust for height, if not it'll stop drawing the text before the next line overflows the specified height

returns the total height of a box of text with width w

returns the position where a text should be drawn to correctly appear next to the one passed as parameter. the kerning with the next character is of course not added since we don't know which will be that next character yet, and should be added when rendering the next string

useful for advanced layout, calls back the f closure for each glyph passing the bottom left and top right corners where it should be drawn after applying kerning and the glyph itself which contains information like it's ascendent, descendent, offset, width... http://www.freetype.org/freetype2/docs/tutorial/step2.html#section-1

Important traits for ShapeIter<'a>

useful for advanced layout, calls back the f closure for each glyph passing the bottom left and top right corners where it should be drawn after applying kerning and the glyph itself which contains information like it's ascendent, descendent, offset, width... http://www.freetype.org/freetype2/docs/tutorial/step2.html#section-1

useful for advanced box layout, calculates the layout of text fitted in a box of w x h and calls back the f closure for each word passing the x and y coordinates where it should be drawn, combined with shape it can be used to calculate the layout for each glyph on the text. returns the final height of the bounding box for the resulting text

Auto Trait Implementations

impl !Send for Ttf

impl !Sync for Ttf