From: Timo Korvola Date: Fri, 9 Mar 2018 21:43:49 +0000 (+0200) Subject: Fix some technical blunders. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=f7014db773c7ddc801398e638110509d8aec3840;p=liskon_frotz.git Fix some technical blunders. Font height is not ascent + descent. Ascent + descent = em size, but height may be more if there is extra line spacing (height is from baseline to baseline). Also, off by one in yof computation. --- diff --git a/src/sdl/sf_ftype.c b/src/sdl/sf_ftype.c index 8d4457d..e074bef 100644 --- a/src/sdl/sf_ftype.c +++ b/src/sdl/sf_ftype.c @@ -197,7 +197,7 @@ static void setglyph( MYFONT *f, FT_Face face, int ch) res->h = bitmap->rows; res->dx = slot->advance.x/64; res->xof = slot->bitmap_left; - res->yof = slot->bitmap_top - bitmap->rows; + res->yof = slot->bitmap_top - bitmap->rows + 1; f->glyphs[ch] = res; } @@ -228,7 +228,7 @@ static SFONT * loadftype( char *fname, int size, SFONT *like, int *err) res->ascent = face->size->metrics.ascender/64; res->descent = -face->size->metrics.descender/64; - res->height = res->ascent+res->descent; //face->size->metrics.height/64; + res->height = face->size->metrics.height/64; res->sfont.antialiased = m_aafonts; res->minchar = 32;