Struct kas_text::raster::Config [−][src]
pub struct Config { /* fields omitted */ }
Expand description
Raster configuration
Implementations
Construct configuration
For large glyphs the effects of configuration will be mostly unnoticable but for small glyphs effects are more significant. The defaults will usually be a good choice. Results may depend on the font used.
The mode
parameter selects rendering mode (though depending on crate
features, not all renderers will be available):
mode == 0
(default): useab_glyph
for rasteringmode == 1
: useab_glyph
and align glyphs to side bearingsmode == 2
: usefontdue
for rastering
Fonts sizes, in pixels per Em, are rounded to a multiple of 1 / scale_steps
.
The default is scale_steps == 4
.
For font sizes (in pixels per Em) less than subpixel_threshold
, subpixel positioning is
enabled with subpixel_steps
(supporting between 1 and 16 steps). Subpixel positioning
allows better glyph spacing for small fonts potentially at the cost of minor blurring
(though blurring may be present in any case), and makes words drawn with very small font
sizes more faithfully represent scaled versions drawn with larger fonts.
Subjectively, readability and apparent quality is better up to around dpem=18
(~13.5pt),
thus we recommend subpixel_threshold == 18
and subpixel_steps == 5
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more
Cast to integer, truncating Read more
Cast to the nearest integer Read more
Cast the floor to an integer Read more
Try converting to integer with truncation Read more
Try converting to the nearest integer Read more
Try converting the floor to an integer Read more
Try convert the ceiling to an integer Read more