[aseprite] 78/196: Use bearingX adjustment to render FreeType glyphs correctly
Tobias Hansen
thansen at moszumanska.debian.org
Wed Apr 20 18:50:04 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 6d3c09d088f0c605016dfcb2281a86499bf99642
Author: David Capello <davidcapello at gmail.com>
Date: Thu Mar 17 11:11:08 2016 -0300
Use bearingX adjustment to render FreeType glyphs correctly
---
src/ft/face.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/ft/face.h b/src/ft/face.h
index d5b10a3..9612c8b 100644
--- a/src/ft/face.h
+++ b/src/ft/face.h
@@ -21,6 +21,7 @@ namespace ft {
FT_UInt glyph_index;
FT_Glyph ft_glyph;
FT_Bitmap* bitmap;
+ double bearingX;
double bearingY;
double x;
double y;
@@ -121,7 +122,7 @@ namespace ft {
this->m_face, glyph_index, this->m_antialias);
if (glyph) {
glyph->bitmap = &FT_BitmapGlyph(glyph->ft_glyph)->bitmap;
- glyph->x = x;
+ glyph->x = x + glyph->bearingX;
glyph->y = y
+ this->height()
+ this->descender() // descender is negative
@@ -188,6 +189,7 @@ namespace ft {
}
m_glyph.ft_glyph = ft_glyph;
+ m_glyph.bearingX = face->glyph->metrics.horiBearingX / 64.0;
m_glyph.bearingY = face->glyph->metrics.horiBearingY / 64.0;
return &m_glyph;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list