pub struct FontConfig { /* private fields */ }Expand description
Font configuration for loading fonts with v1.92+ features
Implementations§
Source§impl FontConfig
impl FontConfig
Sourcepub fn size_pixels(self, size: f32) -> Self
pub fn size_pixels(self, size: f32) -> Self
Set the font size in pixels
Note: With v1.92+ dynamic fonts, size can be 0.0 to use default sizing
Sourcepub fn merge_mode(self, merge: bool) -> Self
pub fn merge_mode(self, merge: bool) -> Self
Set whether to merge this font with the previous one
Sourcepub fn font_loader_flags(self, flags: FontLoaderFlags) -> Self
pub fn font_loader_flags(self, flags: FontLoaderFlags) -> Self
Set font loader flags for this specific font
These flags override the global atlas flags for this font.
Sourcepub fn glyph_exclude_ranges(self, ranges: &[u32]) -> Self
pub fn glyph_exclude_ranges(self, ranges: &[u32]) -> Self
Set glyph ranges to exclude from this font
Useful when merging fonts to avoid overlapping glyphs.
Sourcepub fn font_loader(self, loader: &FontLoader) -> Self
pub fn font_loader(self, loader: &FontLoader) -> Self
Set a custom font loader for this font
Sourcepub fn glyph_offset(self, offset: [f32; 2]) -> Self
pub fn glyph_offset(self, offset: [f32; 2]) -> Self
Set glyph offset for this font
Sourcepub fn glyph_min_advance_x(self, advance: f32) -> Self
pub fn glyph_min_advance_x(self, advance: f32) -> Self
Set minimum advance X for glyphs
Sourcepub fn glyph_max_advance_x(self, advance: f32) -> Self
pub fn glyph_max_advance_x(self, advance: f32) -> Self
Set maximum advance X for glyphs
Sourcepub fn glyph_extra_advance_x(self, advance: f32) -> Self
pub fn glyph_extra_advance_x(self, advance: f32) -> Self
Set extra advance X for glyphs (spacing between characters)
Sourcepub fn rasterizer_multiply(self, multiply: f32) -> Self
pub fn rasterizer_multiply(self, multiply: f32) -> Self
Set rasterizer multiply factor
Sourcepub fn rasterizer_density(self, density: f32) -> Self
pub fn rasterizer_density(self, density: f32) -> Self
Set rasterizer density for DPI scaling
Sourcepub fn pixel_snap_h(self, snap: bool) -> Self
pub fn pixel_snap_h(self, snap: bool) -> Self
Set pixel snap horizontally
Sourcepub fn pixel_snap_v(self, snap: bool) -> Self
pub fn pixel_snap_v(self, snap: bool) -> Self
Set pixel snap vertically
Sourcepub fn oversample_h(self, oversample: i8) -> Self
pub fn oversample_h(self, oversample: i8) -> Self
Set horizontal oversampling
Sourcepub fn oversample_v(self, oversample: i8) -> Self
pub fn oversample_v(self, oversample: i8) -> Self
Set vertical oversampling
Trait Implementations§
Source§impl Clone for FontConfig
impl Clone for FontConfig
Source§fn clone(&self) -> FontConfig
fn clone(&self) -> FontConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more