natiny_font_get_line_height

C
float natiny_font_get_line_height(NatinyFont font);

Returns the vertical distance between consecutive baselines.

Parameters

Name Type Description
font NatinyFont Font handle from natiny_font_create

Returns

Type Description
float Line height in drawing units, or 0.0f for an invalid handle

Example

C
float lh = natiny_font_get_line_height(font);

Notes

  • The value is the font's natural line height multiplied by the factor set by natiny_font_set_line_spacing.
  • Everything that stacks lines uses this one number, so the height from natiny_font_measure_text, the wrapping in natiny_font_measure_wrapped and the lines natiny_render_text_box draws all move together with it.
  • natiny_font_get_ascent and natiny_font_get_descent report distances around the baseline; their sum does not include the font's line gap.