I'll explain this from Android Developer perspective.
Line height usually means text size + "padding" top/bottom.
So, if your designer write line height 19sp and text size 15sp, it means you need to have extra padding 4sp.
19sp - 15sp = 4sp.
To implement it in your layout, use lineSpacingExtra
attribute.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:lineSpacingExtra="4sp"
android:fontFamily="sans-serif"
tools:text="StackOverflow is awesome"
/>
Another way to achieve line height is using scale. For example, 1.2
. It means, the spacing is 120% of the text size.
In example above, the line height is 19sp and the text size is 15sp. If we translate it into scale, it become.
19/15 = 1.26
To implement it in your layout, use the lineSpacingMultiplier
attribute.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:lineSpacingMultiplier="1.26"
android:fontFamily="sans-serif"
tools:text="StackOverflow is awesome"
/>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…