Struct rin_graphics::ttf::Ttf [−][src]
pub struct Ttf { /* fields omitted */ }
Implementations
impl Ttf
[src]
impl Ttf
[src]pub fn line_height(&self) -> f32
[src]
distance between baselines
pub fn ascender(&self) -> f32
[src]
distance between baseline and top of highest character in the font
pub fn descender(&self) -> f32
[src]
a negative number indicating the distance between the baseline and bottom of the lowest character in the font
pub fn line_gap(&self) -> f32
[src]
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
pub fn antialiasing_type(&self) -> Antialiasing
[src]
returns the type of antialiasing of this font
pub fn mesh(
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin
) -> Mesh<Vertex2DTex>
[src]
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin
) -> Mesh<Vertex2DTex>
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
pub fn mesh_color<C: ToRgba>(
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin,
color: &C
) -> Mesh<Vertex2DTexColor>
[src]
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin,
color: &C
) -> Mesh<Vertex2DTexColor>
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
pub fn append_mesh(
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin,
mesh: &mut Mesh<Vertex2DTex>
)
[src]
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin,
mesh: &mut Mesh<Vertex2DTex>
)
pub fn append_mesh_color<C: ToRgba>(
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin,
color: &C,
mesh: &mut Mesh<Vertex2DTexColor>
)
[src]
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin,
color: &C,
mesh: &mut Mesh<Vertex2DTexColor>
)
pub fn bounding_box(
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin
) -> Rect<f32>
[src]
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin
) -> Rect<f32>
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
pub fn width(&self, string: &str) -> f32
[src]
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
pub fn box_mesh<H>(
&self,
string: &str,
pos: &Pnt2,
w: BoxCoordinatesX,
h: H,
coordinate_origin: CoordinateOrigin,
flags: BoxFlags
) -> BoxMesh<Vertex2DTex> where
H: Into<Option<BoxCoordinatesY>>,
[src]
&self,
string: &str,
pos: &Pnt2,
w: BoxCoordinatesX,
h: H,
coordinate_origin: CoordinateOrigin,
flags: BoxFlags
) -> BoxMesh<Vertex2DTex> where
H: Into<Option<BoxCoordinatesY>>,
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
pub fn box_mesh_color<H, C>(
&self,
string: &str,
pos: &Pnt2,
w: BoxCoordinatesX,
h: H,
coordinate_origin: CoordinateOrigin,
flags: BoxFlags,
color: &C
) -> BoxMesh<Vertex2DTexColor> where
H: Into<Option<BoxCoordinatesY>>,
C: ToRgba,
[src]
&self,
string: &str,
pos: &Pnt2,
w: BoxCoordinatesX,
h: H,
coordinate_origin: CoordinateOrigin,
flags: BoxFlags,
color: &C
) -> BoxMesh<Vertex2DTexColor> where
H: Into<Option<BoxCoordinatesY>>,
C: ToRgba,
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
pub fn box_size(&self, string: &str, w: BoxCoordinatesX) -> Vec2
[src]
returns the bounding box size of text rendered to a box with width w
pub fn next_pos(
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin
) -> Pnt2
[src]
&self,
string: &str,
pos: &Pnt2,
coordinate_origin: CoordinateOrigin
) -> Pnt2
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 not added since we don’t know which will be that next character yet, and should be added when rendering the next string
pub fn shape_iter<'a>(
&'a self,
string: &'a str,
pos: &'a Pnt2,
coordinate_origin: CoordinateOrigin
) -> impl Iterator<Item = Shape> + 'a
[src]
&'a self,
string: &'a str,
pos: &'a Pnt2,
coordinate_origin: CoordinateOrigin
) -> impl Iterator<Item = Shape> + 'a
useful for advanced layout, iterrates through 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
pub fn box_shape_iter<'a, H>(
&'a self,
string: &'a str,
pos: &Pnt2,
w: BoxCoordinatesX,
h: H,
coordinate_origin: CoordinateOrigin,
flags: BoxFlags
) -> impl Iterator<Item = Shape> + 'a where
H: Into<Option<BoxCoordinatesY>>,
[src]
&'a self,
string: &'a str,
pos: &Pnt2,
w: BoxCoordinatesX,
h: H,
coordinate_origin: CoordinateOrigin,
flags: BoxFlags
) -> impl Iterator<Item = Shape> + 'a where
H: Into<Option<BoxCoordinatesY>>,
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
by default the position y coordinate is the top or bottom of the box
(depending on the CoordinateOrigin). This can be changed to the baseline
of the first line of text using the BoxFlags::Y_START_AT_BASELINE
flag.
The cut unit is by default the word, if a word doesn’t fit the box it’ll be sent to the next line if possible. When using the BoxFlags::CUT_LETTERS the cut uint will be the letter instead and words will be cut at any point.
pub fn freetypegl(&self) -> &TextureFont
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]