FontVariation.opticalSize constructor

const FontVariation.opticalSize(
  1. double value
)

Optical size optimization. (opzs)

Changes the rendering of the font to be optimized for the given text size. Normally, the optical size of the font will be derived from the font size.

This feature could be used when the text represents a particular physical font size, for example text in the representation of a hardcopy magazine, which does not correspond to the actual font size being used to render the text. By setting the optical size explicitly, font variations that might be applied as the text is zoomed will be fixed at the size being represented by the text.

This feature could also be used to smooth animations. If a font varies its rendering as the font size is adjusted, it may appear to "quiver" (or, one might even say, "flutter") if the font size is animated. By setting a fixed optical size, the rendering can be fixed to one particular style as the text size animates.

Values must be greater than zero, and are interpreted as points. A point is 1/72 of an inch, or 1.333 logical pixels (96/72).

See also:

Implementation

const FontVariation.opticalSize(this.value) : assert(value > 0.0), axis = 'opsz';