[aseprite] 65/196: Replace FreeTypeFont::height() impl
Tobias Hansen
thansen at moszumanska.debian.org
Wed Apr 20 18:50:02 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 eec2d64f57a97d9405f52ce1918e5ff46e107bb0
Author: David Capello <davidcapello at gmail.com>
Date: Mon Mar 14 12:40:28 2016 -0300
Replace FreeTypeFont::height() impl
---
src/she/common/freetype_font.cpp | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/src/she/common/freetype_font.cpp b/src/she/common/freetype_font.cpp
index 4b83a06..ca9d3c5 100644
--- a/src/she/common/freetype_font.cpp
+++ b/src/she/common/freetype_font.cpp
@@ -44,19 +44,8 @@ FontType FreeTypeFont::type()
int FreeTypeFont::height() const
{
- FT_UInt glyph_index = FT_Get_Char_Index(m_face, 'A');
-
- FT_Error err = FT_Load_Glyph(
- m_face, glyph_index,
- FT_LOAD_RENDER |
- FT_LOAD_NO_BITMAP |
- (m_face.antialias() ? FT_LOAD_TARGET_NORMAL:
- FT_LOAD_TARGET_MONO));
-
- if (!err)
- return (int)m_face->glyph->bitmap.rows;
- else
- return m_face->height >> 6;
+ static std::string str = "Tgjp";
+ return m_face.calcTextBounds(str.begin(), str.end()).h;
}
int FreeTypeFont::charWidth(int chr) const
--
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