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): use ab_glyph for rastering
  • mode == 1: use ab_glyph and align glyphs to side bearings
  • mode == 2: use fontdue 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

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast from Self to T

Try converting from Self to T

Cast to integer, truncating Read more

Cast to the nearest integer Read more

Cast the floor to an integer Read more

Cast the ceiling 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

Convert from T to Self

Try converting from T to Self

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.