Struct conrod::render::Text
[−]
[src]
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