[Feature] Unicode support (utf8-format) - #226
Open
C-ColinTH wants to merge 37 commits into
Open
Conversation
Merge main-"Skins switches CVARs for EE"-e05a14c4f5159f9651c4671e5c8c146b82c0cd8a into font
In menu script file, using "textlinespacing" to specifiy the spacing of text lines
Should display Arabic like characters text better
In fact, the strings in buffs do not end in '\n', they are actually replaced with a space. The line break spacing should be normal now with utf8 text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It has been tested since March with 9 players and there have been no serious bug issues.
Except for console text and a few hud texts that have not yet been deployed, the vast majority of text display in games can now display Unicode characters. That is to say, the game can now support displaying almost all official languages.
Changes and Usage:
Renderer part:
fontsdirectory:fontImage_utf8_<num>.dat, num from 0 to 3, correspond to the following:fontImage_utf8_0.datfile and corresponding font material images are requisite.z_zzzz_realrtcw_utf8fonts.zip
UI part:
menudef. h, add keywordFONT_UTF_DEFAULT,FONT_UTF_CUSTOM1,FONT_UTF_CUSTOM2, andFONT_UTF_CUSTOM3to allow game authors to choose the desired font template in the UI.textfontin the MENU script file as one of the four templates mentioned above, and then the text file needs to be stored in UTF8 format.for example:
if use
textin the MENU script file, please make sure "example.menu" stored in UTF8 format, such as:HUD part:
cl_enableUtf8Font,cl_hudUtf8FontScalein client. In order to display Unicode fonts in cinematic video subtitle,cl_enableUtf8Fontneeds to be set to 1 .cl_hudUtf8FontScaleis used to globally adjust the font scaling size.cg_enableUtf8Font,cg_hudUtf8FontScale,cg_subtitleUtf8FontScalein cgame. In order to display Unicode fonts in game hud (Including dialogue subtitles),cg_enableUtf8Fontneeds to be set to 1.cg_hudUtf8FontScaleandcg_subtitleUtf8FontScaleare used to globally adjust the font scaling size of non subtitle text and subtitle text in cgame, respectively.fontImage_utf8_0.dat.Translation part:
bonus_strings.txt,pickupnames.txt,strings.txt,strings.txtand the text files under EnglishUSA in the text directory ofz_rallrtcw_utalization.pk3, keywordtextfontparemeter in MENU script files, and some other related text files.Misc:
COM_ParseExt2function inq_shared.c, it support escape character parse.printsubtitlekeyword for AI, SCRIPT file. At present, onlyplaysoundcan attach to subtitles display, but there are still some audios that do not use or cant useplaysound, so the subtitles cannot be fully covered. Useprintsubtitlecould let it print subtitle. Its usage is basically the same as the original playsound:printsubtitle <keyname>in AI, SCRIPT file, and"<keyname>" "text"in subtitle file undertext\EnglishUSA\maps.textlinespacingkeyword for MENU script file. In MENU script file, usingtextlinespacingto specifiy the spacing of text lines.