From 0cccd0ddd1d53b7d16e47a5b2d8ca62c87d992f4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 3 Aug 2016 23:39:10 +0200 Subject: GRAPHICS/WAGE: Made MacWindowManager font maping requiring font size --- graphics/macgui/macwindowmanager.cpp | 8 ++++++-- graphics/macgui/macwindowmanager.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'graphics') diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 516eb84bf8..d19e40781f 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -452,11 +452,15 @@ static const char *const fontNames[] = { "New Century Schoolbook" }; -const char *MacWindowManager::getFontName(int id) { +const char *MacWindowManager::getFontName(int id, int size) { + static char name[128]; + if (id > ARRAYSIZE(fontNames)) return NULL; - return fontNames[id]; + snprintf(name, 128, "%s-%d", fontNames[id], size); + + return name; } ///////////////// diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index 3c1d89ddde..cb432d9699 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -118,9 +118,10 @@ public: /** * Return font name from standard ID * @param id ID of the font + * @param size size of the font * @return the font name or NULL if ID goes beyond the mapping */ - const char *getFontName(int id); + const char *getFontName(int id, int size); /** * Create a window with the given parameters. -- cgit v1.2.3