summaryrefslogtreecommitdiff
path: root/src/gui/truetypefont.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-06 21:26:24 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-07 21:11:34 +0100
commit812fc04430cfd3863f5bce2319deef26e5d3c316 (patch)
treeef44383ce06cf3b47ced36f9c6238e892659be07 /src/gui/truetypefont.cpp
parent04a3cdd669726389b3b10c5d2da5440262e3765d (diff)
downloadmana-client-812fc04430cfd3863f5bce2319deef26e5d3c316.tar.gz
mana-client-812fc04430cfd3863f5bce2319deef26e5d3c316.tar.bz2
mana-client-812fc04430cfd3863f5bce2319deef26e5d3c316.tar.xz
mana-client-812fc04430cfd3863f5bce2319deef26e5d3c316.zip
Made BrowserBox use the recommended line skip for its font
SDL_ttf provides a separate function for getting the recommended line skip, or the spacing between two lines of text. When rendering multiple lines of text this should be used rather than the visual height of the font. Since the information is only available for TrueTypeFont, a dynamic_cast was used with a fallback on gcn::Font::getHeight. Also made some small tweaks but nothing that really affects performance. Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/gui/truetypefont.cpp')
-rw-r--r--src/gui/truetypefont.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp
index ee1db8b3..5f85ea68 100644
--- a/src/gui/truetypefont.cpp
+++ b/src/gui/truetypefont.cpp
@@ -189,3 +189,8 @@ int TrueTypeFont::getHeight() const
{
return TTF_FontHeight(mFont);
}
+
+int TrueTypeFont::getLineHeight() const
+{
+ return TTF_FontLineSkip(mFont);
+}