diff options
author | pommicket <pommicket@gmail.com> | 2023-07-16 15:07:41 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-07-16 15:42:00 -0400 |
commit | 3f734cf1eb86fef82c7390df003124565b8a84c6 (patch) | |
tree | 193e24ffab1c2a2397fb73292d60653f5ef1c97f /text.h | |
parent | d27853b51f09c080b1c78201a947fcb6b6cc6b72 (diff) |
initial draft of variable-width font handling
Diffstat (limited to 'text.h')
-rw-r--r-- | text.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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); |