Vivek Rajendran
07/16/2024, 7:25 AMTextUnitType.Em
and how it differs from Sp
?
@kotlin.jvm.JvmInline
value class TextUnitType(internal val type: Long) {
override fun toString(): String {
return when (this) {
Unspecified -> "Unspecified"
Sp -> "Sp"
Em -> "Em"
else -> "Invalid"
}
}
companion object {
val Unspecified = TextUnitType(UNIT_TYPE_UNSPECIFIED)
val Sp = TextUnitType(UNIT_TYPE_SP)
val Em = TextUnitType(UNIT_TYPE_EM)
}
}
Stylianos Gakis
07/16/2024, 7:59 AMlineHeight
using the text unit “em” (relative font size) instead of “sp” (scaled pixels) for improved precision. For more information about selecting an appropriate text unit, see `TextUnit`"
So it looks like it's a scale relative to a baseline. I don't know how 1em is defined though 👀 I know we use them for letterSpacing
, and there I guess there is a "baseline" letter spacing and we can increase/decrease that relative to what that baseline is.Vivek Rajendran
07/16/2024, 8:53 AMZach Klippenstein (he/him) [MOD]
07/16/2024, 1:41 PM