1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-09-30 09:08:33 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Nebuleon Fumika
a468b33d1e When computing the width of multi-line text, split lines and return the longest
Along with the newline support in Font::write(), Font::getTextWidth() now
splits text along '\n' and returns the width of the longest split.
2014-07-24 08:59:48 +02:00
Maarten ter Huurne
d4344c7960 Revert "Removed support for multi-line text drawing"
This reverts commit 0908aa7bb7.

It turns out there are multi-line text messages in use: Nebuleon found
one in the confirmation message when deleting a section.
2014-07-23 02:22:27 +02:00
Maarten ter Huurne
0908aa7bb7 Removed support for multi-line text drawing
When trying to test the previous commit, I couldn't find any place in
the application where strings containing newlines are drawn. So I'm
assuming this is an unnecessary feature, until someone comes up with
a test case proving otherwise.

Yeah, I'm too lazy to review all the code that draws text...
2014-07-19 00:43:05 +02:00
Maarten ter Huurne
5c7ca19f4b Don't issue warnings when rendering empty string 2014-07-19 00:43:05 +02:00
Nebuleon Fumika
099bd24556 Use the font's suggested line height instead of its ascent and descent.
In well-described fonts, this enables multi-line text (e.g. in manuals) to be
more readable.

The term "height" is also replaced with "line spacing" in Font's code.
2014-07-17 02:03:02 +02:00
Paul Cercueil
af258530db Allow the skin to change the font and font size 2014-01-15 20:32:17 +01:00
Maarten ter Huurne
f8dc4c7bb8 Don't construct non-functional Font objects
Replaced Font constructor with factory method, so that if the TTF
cannot be loaded, the Font object is not constructed. The normal C++
way of handling this is with exceptions, but we're compiling with
-fno-exceptions.
2013-08-04 00:58:32 +02:00
Maarten ter Huurne
724aefe482 Renamed ASFont class to just Font
Originally the font implementation was based on SFont, but it was
recently replaced by an SDL_ttf based implementation, so the name
no longer made sense.
2013-08-03 22:30:12 +02:00