Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean translations charsets #3384

Merged
merged 8 commits into from Oct 2, 2021
Merged

Clean translations charsets #3384

merged 8 commits into from Oct 2, 2021

Conversation

@criezy
Copy link
Member

@criezy criezy commented Sep 20, 2021

In the past we used to require 8-bit encodings for translations (typically iso-8859-#), with corresponding localised bds fonts in the themes to support those translations.

When we switched the translations encoding to Unicode, some leftovers were left behind, most notably all the localised bds fonts that were no longer used, but still bloated the themes.

This pull request:

  • Removes the TranslationManager::getCurrentCharset function (since it is now utf-32, and was used only to support loading the localised iso-8859-* bds fonts).
  • Removes the -iso-8859-.bdf and -iso-8859-.fcc files.
  • Cleans various code related to those.

The main benefit is that the theme files are noticeably smaller. But this is simplifies a bit the ThemeEngine font-related code.

I tried to do the changes step by step in a logical order so that each commit is easy to understand. This should also help to find the issue if this introduces regressions.

I am not completely confident with all the changes, so I would appreciate another pair of eyes looking at this before this gets merged.

criezy added 8 commits Oct 2, 2021
We used to have different charsets depending on the language and
a different set of fonts for each one. So themes could support
some language and not others depending on the fonts it contained.
Now all languages are using UTF-32, except English. So the only
case that can fail is when not using English and the Theme does
not have TTF fonts.
This was only used to be part of the name under which loaded TTF
fonts are stored in the FontMan font map. But since all the
languages now use the same charset (UTF-32), there is no longuer
a need to include the charset in the name. We still need to
differentiate between bdf fonts that can only be used for English
and TTF fonts, but this is is the case due to the font size being
included in the name. And otherwise we could just add a hardcoded
"-ttf" in the name.
This function supported loading alternative bdf fonts when we were
using 8 bits encodings for the translations. Now that we are using
unicode for all language, this is no longer needed.
@criezy
Copy link
Member Author

@criezy criezy commented Oct 2, 2021

I will merge this now before I get another conflict in the themes 😛

@criezy criezy merged commit ae46396 into scummvm:master Oct 2, 2021
7 of 8 checks passed
@criezy criezy deleted the clean-fonts branch Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants