[Scummvm-devel] Proposed modification to OSystem::displayMessageOnOSD()

Thierry Crozat criezy at scummvm.org
Mon May 23 02:15:51 CEST 2011


Hi,

Le 16 mai 2011 à 14:48, Johannes Schickel a écrit :
> 
>> c) Loading localized font is still handled by the ThemeEngine. I am fine
>> with that since the fonts have to be loaded from the theme zip files
>> anyway. But can this be a problem to use these fonts in classes not
>> related to the GUI? I can't see one but maybe I missed something.
>> 
> 
> In case code uses the font classes for custom purposes it will probably know 
> itself what encoding it uses. It will furthermore probably either want an 
> ISO-8859-1 font, which is what our default console/gui/etc. fonts use IIRC, or 
> use a custom font.

I implemented all the other points in my email, but I actually have an issue with the localized font for OSD. It seems the ThemeEngine either loads the kGUIFont or the kBigGUIFont depending on the resolution. So if using the kGUIFont for OSD, it will only find the localized font when the ScummVM window is in normal gfx mode (320x200 or 320x240), but not if using a 2X or 3X gfx mode. I see several ways out of this (and their might be others):

1) make ThemeEngine::loadFont(const Common::String& fileName) public so that it can be called from the FontManager.

2) Add a public fonction to access the _themeArchive in ThemeEngine and move loadFont(), loadFontFromArchive(), loadCachedFontFromArchive() and getCacheFilename() to FontManager.

3) Tell OSD to use the localized kBigGUIFont if it cannot get the localized kGUIFont.

I tried 1) since it was the easiest to test and now I have a code that is working well to display translated messages using OSystem::displayMessageOnOSD(). But before committing I would like your opinion on what is the best solution.

Thierry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20110523/307928fc/attachment.html>


More information about the Scummvm-devel mailing list