Made width return a floating point.
This commit is contained in:
parent
c5fda5237f
commit
d07d0e6d22
|
@ -206,8 +206,8 @@ int ren_font_get_tab_size(RenFont *font) {
|
|||
return font_get_glyphset(font, '\t')->metrics['\t'].xadvance / font->space_advance;
|
||||
}
|
||||
|
||||
int ren_font_get_width(RenFont *font, const char *text) {
|
||||
int width = 0;
|
||||
float ren_font_get_width(RenFont *font, const char *text) {
|
||||
float width = 0;
|
||||
const char* end = text + strlen(text);
|
||||
while (text < end) {
|
||||
unsigned int codepoint;
|
||||
|
|
|
@ -16,7 +16,7 @@ RenFont* ren_font_copy(RenFont* font, float size);
|
|||
void ren_font_free(RenFont *font);
|
||||
void ren_font_set_tab_size(RenFont *font, int n);
|
||||
int ren_font_get_tab_size(RenFont *font);
|
||||
int ren_font_get_width(RenFont *font, const char *text);
|
||||
float ren_font_get_width(RenFont *font, const char *text);
|
||||
int ren_font_get_height(RenFont *font);
|
||||
float ren_font_get_size(RenFont *font);
|
||||
int ren_draw_text(RenFont *font, const char *text, float x, int y, RenColor color);
|
||||
|
|
Loading…
Reference in New Issue