load space metrics only instead of all metrics of the 1st 256 characters

This commit is contained in:
takase1121 2022-06-12 08:22:01 +08:00
parent 99d328cfd7
commit 73cd768a19
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 11 additions and 8 deletions

View File

@ -206,7 +206,10 @@ RenFont* ren_font_load(const char* path, float size, ERenFontAntialiasing antial
font->antialiasing = antialiasing;
font->hinting = hinting;
font->style = style;
font->space_advance = font_get_glyphset(font, ' ', 0)->metrics[' '].xadvance;
if (FT_Load_Char(face, ' ', font_set_load_options(font)))
goto failure;
font->space_advance = face->glyph->advance.x / 64.0f;
font->tab_advance = font->space_advance * 2;
return font;
failure: