In the old system it just loaded the font a second time, but with the folder based setup there is no file named CONFONT anymore so it needs to be dealt with explicitly.
This was already far too generous and caused space problems, but with localization these became a lot worse, so now it will try to allocate at least 640 virtual pixels for the menu width and only go below that for small resolution ranges where the smaller value would result in too small text.
This function was written for already validated UTF-8 but not for text that can be mixed with ISO-8859-1.
To handle that properly it needs to do a bit more validation to avoid mangling its output and instead reject invalid input.
Now a localization mod can disable the graphics patches containing text entirely so that it can properly localize the text based menu variant.
If this flag gets set in MAPINFO, it will override all user settings.
These were pixel format conversion routines used in the D3D backend. Nothing in here is needed anymore - the FBitmap class offers much of the functionality covered here in a far more concise and approachable manner.
The usedcolors array which counts the number of pixels in a given color in a font used bytes as storage, so any color that just happened to have a count that is a multiple of 256 the color was considered not present.
In this menu, all languages supported by GZDoom are selectable with one simple click! Credits to @PROPHESSOR for making it!
(This only edits the English and French languages because they are the only languages currently up to date with GZDoom’s development. A Russian translation will follow suit at a later date.)
• Ä: fix shading at the top
• Å: reduce height
• Æ: improve blending between the two glyphs
• Ç: shorten cedilla
• Ê: fix outline color
• Ð: thicken lines and conjoin them with the letter
• Ø: recolor the center of the slash in the lowercase glyph
• Þ: improve shading, condense lowercase glyph
• Ђ: round edges slightly
• Љ: improve blending between the two glyphs
• Њ: improve blending between the two glyphs
• Ћ: improve shading
• Ќ: heighten accent position
• Џ: widen tail
Also overhauls the punctuation, which now completely fits both the Bigfont and the BigUpper font! Big thanks to Jimmy for a huge amount of support!
* added a CVAR that sets how localizable graphics need to be dealt with.
* pass the substitution string to OkForLocalization so that proper checks can be performed.
* increased item spacing on Doom's list menus to 18 from 16 pixels, because otherwise the diacritic letters would not fit. 20 would have been more ideal but 18 was the limit without compromising its visual style
* added a second text-only main menu because here the spacing cannot be changed. Doing so would render any single-patch main menu non-functional. So here the rules are that if substitution takes place, it will swap out the entire menu class.
* fixed some issues with the summary screen's "entering" and "finished" graphics.
Passing something non-constant at compile time here is extremely dangerous, especially when users can replace those strings if they like.
It now uses FString::Substitute in all cases where something needs to be inserted into a template string.
This is one of those things where the work needed to make it robust stands in no relation to the gain.
This simply isn't worth the hassle of going through the entire code and fixing every single use of the 2D texture drawing functions.
Unfortunately this means that the graphics items for the menu cannot be replaced this way because their size will most likely differ, but considering that the only candidates for this are the contents of Doom's main menu, the episode menu, the skill menu and the single player summary screen, it's simply not worth it.
In all these cases the IWAD contents can just as easily be replaced with text and user mods which want to offer localized menus will have to work within the confines of the system, e.g. making sure that all menu items are designed to have proper size for substitution to work or by requesting text based menus, which will be added as a modding feature later.