summaryrefslogtreecommitdiff
path: root/src/gui/truetypefont.h
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.h
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.h')
-rw-r--r--src/gui/truetypefont.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/truetypefont.h b/src/gui/truetypefont.h
index 7974a953..97fd7f08 100644
--- a/src/gui/truetypefont.h
+++ b/src/gui/truetypefont.h
@@ -63,6 +63,13 @@ class TrueTypeFont : public gcn::Font
virtual int getHeight() const;
/**
+ * Returns the height of a line of text. This is not the visual height
+ * as returned by getHeight() but the recommended spacing between lines
+ * of text.
+ */
+ int getLineHeight() const;
+
+ /**
* @see Font::drawString
*/
void drawString(gcn::Graphics *graphics,