Opened 9 years ago

Closed 9 years ago

Last modified 12 months ago

#5388 closed defect (fixed)

GUI: Fonts not found with buit-in theme

Reported by: criezy Owned by: criezy
Priority: normal Component: GUI
Keywords: Cc:
Game:

Description

To support translations in non latin1 encoding (e.g. Russian and Ukrainian translations), fonts for these encoding need to be available. They are currently part of the Themes. However there is a problem with the built-in classic theme for which only latin1 (ISO-8859-1) translations currently work. The other translations show garbage because the fonts are not found.

I am not sure how to fix this problem. I can see several solutions:

1) The ISO-8859-5 fonts could be added to the built-in fonts. However if I understood correctly the code, these fonts are included as static variables in the code and this would have an overhead in the size of the executable and memory used. Would that work with small devices or would that overhead be too big? Also translations using different encoding might be added in the future, which would add even more fonts.

2) Only list and accept translations that use latin1 encoding when using the built-in classic theme. But the theme can be changed by the user without rebooting while the change of translation currently require rebooting. So I don't know how we could handle the switch from external theme + Russian (or Ukrainian) translation to built-in theme.

3) Currently the ThemeEngine throw a warning an fall back on the ISO-8859-1 fonts when it cannot find the ISO-8859-5 fonts (thus the garbage). Maybe it should instead tell the TranslationManager to fallback to english.

I am marking it as a blocking bug for the release because of the potential following issue: on devices where only the built-in classic theme is available (I understood it is the case for Symbian) and the system locale is Russian or Ukrainian, ScummVM starts with the corresponding translation by defaults but cannot find the fonts. As a result the GUI show garbage text and it is very difficult to find the option to explicitly select another language.

Ticket imported from: #3075649. Ticket imported from: bugs/5388.

Change History (7)

comment:1 by lordhoto, 9 years ago

If we go with the builtin font route we should definitely only enable these when translation support is enabled, I guess otherwise we might have big binary size problems (and thus memory problems) on the NDS for example.

I am rather puzzled why only the built-in theme is available on Symbian since it seems it ships the translations.dat file (I mean otherwise no translations would be available, right?). I mean it shouldn't be that hard to also ship the modern theme then...

I think the best option is to fallback to the builtin language in case no fonts are found.

comment:2 by sev-, 9 years ago

It is definitely a release critical bug.

I think that if fonts are not available for any reason, we need to fallback to English.

comment:3 by criezy, 9 years ago

I just committed a partial fix for this issue. Now when fonts are not available it falls back to English.

I am not closing this bug because there is still an issue when the user switches from a theme that supports cyrillic fonts (e.g. Modern Theme) to a theme that doesn't (e.g. builtin theme). The theme is switched right away while the change of GUI language currently requires to restart ScummVM. Therefore when doing that the language is changed in the TranslationManager but the GUI is not updated and displays garbage text until the user quits and restarts ScummVM (or starts a game and returns to the launcher).

I don't think this remaining issue is release critical through. So I am decreasing the priority.

comment:4 by criezy, 9 years ago

Priority: blockernormal

comment:5 by criezy, 9 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

comment:6 by criezy, 9 years ago

I fixed the remaining problem (switching to a theme that does not have the fonts needed to properly display the current language).

This should now be OK in rev 52970.

comment:7 by digitall, 12 months ago

Component: GUI
Note: See TracTickets for help on using tickets.