*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
- return texture_string_width (sc->texfont, s, 0);
+ texture_string_metrics (sc->texfont, s, &e, 0, 0);
+ return e.width;
- ln->width = sc->font_scale * texture_string_width (sc->texfont, s, 0);
+ texture_string_metrics (sc->texfont, s, &e, 0, 0);
+ ln->width = sc->font_scale * e.width;
ln->height = sc->font_scale * sc->line_height;
memcpy (ln->color, sc->color, sizeof(ln->color));
ln->height = sc->font_scale * sc->line_height;
memcpy (ln->color, sc->color, sizeof(ln->color));
- w = texture_string_width (sc->texfont, c, &h);
+ texture_string_metrics (sc->texfont, c, &e, 0, 0);
+ w = e.width;
+ h = e.ascent + e.descent;
sc->texfont = load_texture_font (MI_DISPLAY(mi), "font");
check_gl_error ("loading font");
sc->texfont = load_texture_font (MI_DISPLAY(mi), "font");
check_gl_error ("loading font");
- cw = texture_string_width (sc->texfont, "n", &lh);
+ texture_string_metrics (sc->texfont, "n", &e, &ascent, &descent);
+ cw = e.width;
+ lh = ascent + descent;