[Scummvm-devel] Proposed modification to OSystem::displayMessageOnOSD()
Max Horn
max at quendi.de
Tue May 24 10:02:29 CEST 2011
Am 23.05.2011 um 15:35 schrieb Johannes Schickel:
> On Mon, May 23, 2011 at 2:15 AM, Thierry Crozat <criezy at scummvm.org> wrote:
>> 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.
>
> Why should it be called from the FontManager though? In fact
> FontManager should only keep track of loaded fonts. Also exposing
> ThemeEngine::loadFont to the public looks strange to me, it was only
> intended to load fonts for GUI internal use.
>
>> 2) Add a public fonction to access the _themeArchive in ThemeEngine and move
>> loadFont(), loadFontFromArchive(), loadCachedFontFromArchive() and
>> getCacheFilename() to FontManager.
>
> Same as 1 actually.
>
>> 3) Tell OSD to use the localized kBigGUIFont if it cannot get the localized
>> kGUIFont.
>
> Would this mean we need to duplicate this behavior in all backends
> having an OSD?
>
>> 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.
>
> Personally I would like one of those two solutions best:
>
> 1) Have a way to query a font name/id for use with localized strings
> in the translation manager. The backends could query this to obtain a
> font which can be used for localized strings from the font manager.
>
>
> 2) Have a fixed font ID in font manager which is for localized
> strings, which could then be easily queried from the backend code if
> needed.
+1 to everything Johannes wrote :)
Cheers,
Max
More information about the Scummvm-devel
mailing list