pub struct FontAssetBuilder { /* private fields */ }Expand description
Knobs and dials for asset generation
Implementations§
Source§impl FontAssetBuilder
impl FontAssetBuilder
Sourcepub fn with_texture_size(width: u16, height: u16) -> Self
pub fn with_texture_size(width: u16, height: u16) -> Self
Define the size of the resulting asset by specifying the image dimensions. The size of glyphs will be adjusted to fit inside.
Sourcepub fn with_font_size(font_size: f32) -> Self
pub fn with_font_size(font_size: f32) -> Self
Define the size of the resulting asset by specifying the desired final font size. The dimensions of the image will be chosen to fit all glyphs at the provided size.
Sourcepub fn with_padding_ratio(self, padding: f32) -> Self
pub fn with_padding_ratio(self, padding: f32) -> Self
Define the ratio of the distance field to the size of the glyph. For example, a 16px glyph with a padding ratio of 0.25 render such that the signed distance field measures -4 to +4 pixels.
Sourcepub fn allow_rotating_glyphs(self) -> Self
pub fn allow_rotating_glyphs(self) -> Self
Use this to allow rotating glyphs, which may make the atlas packing more optimal but requires more attention when decoding the resulting texture coordinates.
Sourcepub fn build<'a, T, I>(self, glyphs: I) -> Result<SdfFontAsset<T>, Error>
pub fn build<'a, T, I>(self, glyphs: I) -> Result<SdfFontAsset<T>, Error>
Build a SDF font asset given a set of glyphs to include.
Trait Implementations§
Source§impl Clone for FontAssetBuilder
impl Clone for FontAssetBuilder
Source§fn clone(&self) -> FontAssetBuilder
fn clone(&self) -> FontAssetBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FontAssetBuilder
impl Debug for FontAssetBuilder
impl Copy for FontAssetBuilder
Auto Trait Implementations§
impl Freeze for FontAssetBuilder
impl RefUnwindSafe for FontAssetBuilder
impl Send for FontAssetBuilder
impl Sync for FontAssetBuilder
impl Unpin for FontAssetBuilder
impl UnwindSafe for FontAssetBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more