diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2018-04-17 10:17:38 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2018-04-17 10:17:38 +0800 |
commit | c15430560aeb82a27358cc320af4a29e1296e6c1 (patch) | |
tree | 53e5439eef4204bb4d9c7dc57de9bdf53bf4d2d6 | |
parent | 9545cbf31c6c327a574ac77d77a8c4547a99be13 (diff) | |
download | fbterm-c15430560aeb82a27358cc320af4a29e1296e6c1.tar.gz fbterm-c15430560aeb82a27358cc320af4a29e1296e6c1.zip |
font: fix font corruption where metrics do not match glyphs
I'm seeing poor font rendering due to the ft2 metrics not matching the
the glpyh rows and width values. This change uses the glyph values
instead of the metrics, which match the pixbuf that we copy from.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | src/font.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/font.cpp b/src/font.cpp index 14b922f..13338a8 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -309,8 +309,8 @@ Font::Glyph *Font::getGlyph(u32 unicode) Glyph *glyph = (Glyph *)new u8[OFFSET(Glyph, pixmap) + nw * nh]; glyph->left = face->glyph->metrics.horiBearingX >> 6; glyph->top = mHeight - 1 + (face->size->metrics.descender >> 6) - (face->glyph->metrics.horiBearingY >> 6); - glyph->width = face->glyph->metrics.width >> 6; - glyph->height = face->glyph->metrics.height >> 6; + glyph->width = w; + glyph->height = h; glyph->pitch = nw; u8 *buf = bitmap.buffer; |