[][src]Struct conrod_core::render::Text

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

A type used for producing a PositionedGlyph iterator.

We produce this type rather than the &[PositionedGlyph]s directly so that we can properly handle "HiDPI" scales when caching glyphs.

Methods

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

pub fn positioned_glyphs(self, dpi_factor: f32) -> &'a [PositionedGlyph][src]

Produces a list of PositionedGlyphs which may be used to cache and render the text.

dpi_factor, aka "dots per inch factor" is a multiplier representing the density of the display's pixels. The Scale of the font will be multiplied by this factor in order to ensure that each PositionedGlyph's pixel_bounding_box is accurate and that the GPU cache receives glyphs of a size that will display correctly on displays regardless of DPI.

Note that conrod does not require this factor when instantiating Text widgets and laying out text. This is because conrod positioning uses a "pixel-agnostic" Scalar value representing perceived distances for its positioning and layout, rather than pixel values. During rendering however, the pixel density must be known

Auto Trait Implementations

impl<'a> Unpin for Text<'a>

impl<'a> Send for Text<'a>

impl<'a> Sync for Text<'a>

impl<'a> RefUnwindSafe for Text<'a>

impl<'a> !UnwindSafe for Text<'a>

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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