summaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-19 15:16:51 -0400
committerpommicket <pommicket@gmail.com>2023-07-19 19:03:43 -0400
commit0d84543e4a88b74aed0dec6a9ceab80b8e44c131 (patch)
tree1ec15ab02978b08755c8e1e7555931ff4f4cb0c8 /text.h
parent4143734747b7b544daecdf1b8676838362c6cb59 (diff)
kerning
Diffstat (limited to 'text.h')
-rw-r--r--text.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/text.h b/text.h
index 8d317e8..ff07e79 100644
--- a/text.h
+++ b/text.h
@@ -41,6 +41,9 @@ typedef struct {
/// largest y achieved (for computing size)
double y_largest;
+ /// previous character rendered, or 0 if this is the first
+ char32_t prev_char;
+
/// used for forwards-compatibility
char _reserved[64];
} TextRenderState;
@@ -98,6 +101,11 @@ void text_utf8_anchored(Font *font, const char *text, double x, double y, u32 co
void text_char_with_state(Font *font, TextRenderState *state, char32_t c);
/// Draw some UTF-8 text with a \ref TextRenderState.
void text_utf8_with_state(Font *font, TextRenderState *state, const char *str);
+/// Used to indicate that the next character drawn should not
+/// kern with the previous character.
+///
+/// Use this when you go to the next line or something.
+void text_state_break_kerning(TextRenderState *state);
/// Free memory used by font.
///
/// Does NOT free the font's fallback.