Format renderer font scale code to be actually readable

This commit is contained in:
Jan200101 2024-10-27 12:42:11 +01:00 committed by Takase
parent a32d6fdb89
commit 1345e9f345
1 changed files with 2 additions and 4 deletions

View File

@ -401,10 +401,8 @@ static int font_set_face_metrics(RenFont *font, FT_Face face) {
font->face = face; font->face = face;
if(FT_IS_SCALABLE(face)) { if(FT_IS_SCALABLE(face)) {
font->height = (short)((face->height / (float)face->units_per_EM) * font->size); font->height = (short)((face->height / (float)face->units_per_EM) * font->size);
font->baseline = (short)((face->ascender / (float)face->units_per_EM) * font->size); font->baseline = (short)((face->ascender / (float)face->units_per_EM) * font->size);
if(FT_IS_SCALABLE(face))
font->underline_thickness = (unsigned short)((face->underline_thickness / (float)face->units_per_EM) * font->size); font->underline_thickness = (unsigned short)((face->underline_thickness / (float)face->units_per_EM) * font->size);
} else { } else {
font->height = (short) font->face->size->metrics.height / 64.0f; font->height = (short) font->face->size->metrics.height / 64.0f;