diff options
author | pommicket <pommicket@gmail.com> | 2023-07-16 15:07:41 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-07-19 19:02:27 -0400 |
commit | 50692503702b9d419de99c97cff59a970627de01 (patch) | |
tree | dac844d3ac73f0f70542ec14de137b168b27dbd0 /text.h | |
parent | 817797e124419e564b1084c332540a222907f5a5 (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); |