Tom De Decker
11/16/2023, 3:08 PMZach Klippenstein (he/him) [MOD]
11/16/2023, 8:49 PMHalil Ozercan
11/16/2023, 11:13 PMbaselineShift
on TextPaint
to change how much you want to shift from the default baseline. This is actually also used by baselineShift
attribute of SpanStyle in Compose.
It's actually a multiplier in Compose that uses ascent
as its coefficient. Ascent is a font metric that denotes the ascender line where most capital letters end. It's not usually enough to find the center of the line. However, you can find a multiplier that works for your case by trial and error.
withStyle(
style = SpanStyle(
fontSize = smallFontSize,
baselineShift = BaselineShift(0.3f)
)
) {
append(text)
}
Tom De Decker
11/17/2023, 9:32 AMefemoney
11/17/2023, 11:18 AM