Struct rin::gl::Ttf[][src]

pub struct Ttf { /* fields omitted */ }

Implementations

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]

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 gamma(&self) -> f32[src]

level of antialiasing, this value should be read by renderers and applied on rendering, doesn’t affect the loaded glyphs, default is 1.0

pub fn antialiasing_type(&self) -> Antialiasing[src]

returns the type of antialiasing of this font

pub fn mesh(
    &self,
    string: &str,
    pos: &Point<f32, U2>,
    coordinate_origin: CoordinateOrigin
) -> Mesh<Vertex2DTex>
[src]

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 bounding_box(
    &self,
    string: &str,
    pos: &Point<f32, U2>,
    coordinate_origin: CoordinateOrigin
) -> Rect<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: &Point<f32, U2>,
    w: BoxCoordinatesX,
    h: H,
    coordinate_origin: CoordinateOrigin,
    flags: BoxFlags
) -> BoxMesh<Vertex2DTex> where
    H: Into<Option<BoxCoordinatesY>>, 
[src]

returns the mesh of a text so it fits in a box of the size and position passed as parameters, if h is some height, it will stop drawing the text before the next line overflows the specified height. Otherwise it won’t adjust for height

pub fn box_size(
    &self,
    string: &str,
    w: BoxCoordinatesX
) -> Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
[src]

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

pub fn next_pos(
    &self,
    string: &str,
    pos: &Point<f32, U2>,
    coordinate_origin: CoordinateOrigin
) -> Point<f32, U2>
[src]

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

pub fn shape_iter(
    &'a self,
    string: &'a str,
    pos: &'a Point<f32, U2>,
    coordinate_origin: CoordinateOrigin
) -> impl Iterator<Item = Shape> + 'a
[src]

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

pub fn box_shape_iter<'a, H>(
    &'a self,
    string: &'a str,
    pos: &Point<f32, U2>,
    w: BoxCoordinatesX,
    h: H,
    coordinate_origin: CoordinateOrigin,
    flags: BoxFlags
) -> impl Iterator<Item = Shape> + 'a where
    H: Into<Option<BoxCoordinatesY>> + 'a, 
[src]

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

pub fn texture(&self) -> Ref<'_, Texture>[src]

pub fn material<C>(&self, color: &C) -> Material where
    C: ToRgba
[src]

pub fn material_no_color(&self) -> Material[src]

pub fn texture_for(context: &CreationProxy, ttf: &Ttf) -> Result<Texture, Error>[src]

Auto Trait Implementations

impl !RefUnwindSafe for Ttf

impl !Send for Ttf

impl !Sync for Ttf

impl Unpin for Ttf

impl !UnwindSafe for Ttf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]