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

Thierry Crozat criezy at scummvm.org
Wed May 25 00:33:32 CEST 2011


Le 23 mai 2011 à 14:35, Johannes Schickel a écrit :

> 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):
>> [...]
> 
>> 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?
> 
> 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.

I like your 2) and I implemented that (it is basically like the idea I had for my third point except this is handled by the FontManager). Now everything is working well.

I pushed all this code to my scummvm fork on github so that it can be reviewed before I push anything to the main repo. I can create a pull request if that helps. The code is in the OSD-translation branch: https://github.com/criezy/scummvm/compare/OSD-translation

The easiest way to test that it works is to modify line 2248 of backens/graphics/sdl/sdl-graphics.cpp to translate "Fullscreen mode". That string is already translated for the GUI option dialog, so you just have to recompile, start ScummVM, and press alt-Enter to see how the OSD text behaves (I personally tried with the French and Russian translations).

Thierry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20110524/2f7926e3/attachment.html>


More information about the Scummvm-devel mailing list