fonts/text_metrics
library
Functions
-
capHeightCentringShift({required double ascent, required double lineHeight, required double baseline, required double capHeight})
→ double
-
Distance to move a line down so its capitals are centred in the line.
-
capHeightShiftForTextStyle(TextStyle style, {required TextScaler textScaler, required double devicePixelRatio, bool mixedCase = false})
→ double
-
Distance to move one line of
style down so its capitals are centred in
its line box, rounded to a device pixel. Negative moves it up.
-
lineHeightForTextScaler(TextScaler textScaler, TextStyle style)
→ double
-
Height of one line of
style as laid out: the font size, the text
scale, and the line height the theme sets per font.
-
snapFontSize(double size)
→ double
-
Helpers that size and place text from the font tables.
-
withFontLineHeight(TextStyle style, {required bool fit, required double clearance})
→ TextStyle
-
style with the line height of its own font family, as createTextTheme
sets it for its text styles (docs/design/ADR_font_line_height.md in
telosnex).