From ccdd4c227c03c0bbdb847d38065cb2ffcf12c541 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 15 Sep 2024 18:44:44 +0200 Subject: [PATCH] provide new line-distance property for built-in fonts --- include/gint/display.h | 10 +++++++--- src/fxconv-metadata.txt | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/gint/display.h b/include/gint/display.h index 1e3fa74..f947a75 100644 --- a/include/gint/display.h +++ b/include/gint/display.h @@ -289,10 +289,14 @@ typedef struct /* Number of total glyphs */ uint32_t glyph_count; - /* Character spacing (usually 1) */ - uint8_t char_spacing; + /* Character spacing (usually 1) */ + uint8_t char_spacing; + /* Distance between the y positions for two consecutive lines. This is + an informative metric for text wrapping tools, not used by dtext() + and other standard functions that always write a single line. */ + uint8_t line_distance; - uint :24; + uint :16; struct { /* Unicode point of first character in block */ diff --git a/src/fxconv-metadata.txt b/src/fxconv-metadata.txt index e9e122e..72c0019 100644 --- a/src/fxconv-metadata.txt +++ b/src/fxconv-metadata.txt @@ -5,6 +5,7 @@ font5x7.png: grid.size: 5x7 grid.padding: 1 grid.border: 0 + line-distance: 8 font8x9.png: name: gint_font8x9 @@ -15,3 +16,4 @@ font8x9.png: grid.border: 0 proportional: true height: 9 + line-distance: 14