What is android:includeFontPadding for?

11,323

This is need for text size measure in height. If you turn it off, text will be forced to be some height, otherwise it will calculate height of each line with ascenders and descenders.

enter image description here

Share:
11,323

Related videos on Youtube

Vas
Author by

Vas

The bigger the problem, the more fun it is to solve.

Updated on September 16, 2022

Comments

  • Vas
    Vas over 1 year

    You can use android:includeFontPadding="false" to get rid of the default padding in a TextView. Android docs say this about the attribute:

    Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly.

    Questions:

    • What does the above mean? What is this padding used for?
    • Is it bad to turn it off and why?
  • chefish
    chefish over 7 years
    If includeFontPadding is true,the ascender height and descender height will be 0
  • vman
    vman over 5 years
    @chefish I believe you mean 'If includeFontPadding is false'