From 812fc04430cfd3863f5bce2319deef26e5d3c316 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 6 Feb 2012 21:26:24 +0100 Subject: 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 --- src/gui/truetypefont.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/truetypefont.cpp') 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); +} -- cgit v1.2.3-60-g2f50