summaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-16 15:07:41 -0400
committerpommicket <pommicket@gmail.com>2023-07-16 15:42:00 -0400
commit3f734cf1eb86fef82c7390df003124565b8a84c6 (patch)
tree193e24ffab1c2a2397fb73292d60653f5ef1c97f /text.h
parentd27853b51f09c080b1c78201a947fcb6b6cc6b72 (diff)
initial draft of variable-width font handling
Diffstat (limited to 'text.h')
-rw-r--r--text.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/text.h b/text.h
index 31997d7..c0cb260 100644
--- a/text.h
+++ b/text.h
@@ -70,10 +70,9 @@ void text_clear_err(void);
Font *text_font_load(const char *ttf_filename, float font_size);
/// Height of a character of this font in pixels.
float text_font_char_height(Font *font);
-/// Width of the character 'a' of this font in pixels.
-/// This is meant to be only used for monospace fonts.
-float text_font_char_width(Font *font);
-/// Force text to advance by text_font_char_width(font) pixels per character (actually, per code point).
+/// Width of the given character in pixels.
+float text_font_char_width(Font *font, char32_t c);
+/// Force text to advance by text_font_char_width(font, ' ') pixels per character (actually, per code point).
void text_font_set_force_monospace(Font *font, bool force);
/// Get the dimensions of some text.
void text_get_size(Font *font, const char *text, float *width, float *height);