The text
The reference line of the text
- Baseline – Recommended additional space for adding between lines of text, the red line in the graph
- Top – The maximum distance above the baseline of the highest glyph in a font of given text size, i.e. the distance from the purple line in the figure to the baseline.
- Bottom – The maximum distance below the baseline of the lowest glyph in a font given text size, i.e. the distance from the orange line in the figure to the baseline.
- Ascent – Recommended single line spacing text above the baseline, the distance from the green line in the figure to the baseline.
- Descent – The recommended distance is lower than the baseline of the individually spaced text, that is, the blue line with the baseline in the figure.
- Leading-the distance between two lines, the distance between descent in the first line of the figure and ascent in the second line.
Note that:
- In the case of single-line text, the value of leading is 0.
- The height of the text should be equal to ascent+ Descent +leading.
- In the actual rendering process, the baseline is used for rendering.
- When these parameters are actually evaluated, top and ascent are negative, and BOTTOM and Descent are positive, just like the coordinate axes.
Font and style of text
Text font
- Default-the DEFAULT font, the normal font type
- Default_bold-bold font type
- SANS_SERIF – Sans Serif font type
- Serif-serif font type
- MONOSPACE – Equal width font type
Tips:
- Serif typeface means that there is extra decoration at the beginning and end of the strokes of the word, and the strokes are of different thickness.
- A sans serif font is a sans serif font without these extra trappings and with strokes of similar thickness.
Writing style
- NORMAL – NORMAL style
- Bold-bold style
- ITALIC – ITALIC style
- BOLD_ITALIC – Bold italic style
other
Android fonts also provide font decoration with underscores and strikeouts.
conclusion
The basic knowledge of text focuses on a few reference lines for text description. If you want to know more about the parameters of text, you can go to understand the knowledge of typesetting. For Android development, the basic knowledge above is almost enough.