I've just expanded the description significantly to share all I know with regard to making font-related changes in TW1. There's also a new optional file in the Downloads section, the Custom DIY Kit for anyone who wants to experiment with different font sizes and variants.
Note that if you start playing with the settings, extra steps are required to generate the matching rasterized font files each time: it won't work otherwise, so please read and follow the instructions in the How to Customize It section of the description.
Make sure you're using UI-Font-TW3 (under Main Files), and not the version under Optional Files.
If text isn't showing up, it means the font settings are changed but the font files are missing.
So, it seems you installed the fonts.2da file correctly somewhere under Data but not the tw3pfdin*.fontcache files, which should go into System\__cache (not Data\System\...).
To make the mod work, put the tw3pfdin*.fontcache files under System\__cache where they should be. If you want to go back to the original fonts, delete or rename the file fonts.2da.
If you need help with this, please run the command I mentioned in the reply to a post right below yours, and paste the output it shows in your comment.
This would shed more light as to what's going on but I'm guessing the issue is similar to that previous one. Most mod files only need to go into Data but this one has files that have to go both into Data and System, which might be confusing.
With the information you're giving me, I can only guess why for you it does not. My guess is that the .fontcache files are not where they should be.
There's more than one way to make it work. Maybe the easiest at this point would be if you download UI-Font-TW3-Custom-DIY-Kit (under Optional Files), and put the the two .ttf files anywhere under Data. Then, run djinni!.exe (from %ProgramFiles%\The Witcher\System) and it will generate the missing .fontcache files on the fly. You can then close it and run the game.
Alternatively, as I said before, run the following in your Command Prompt (Win-X, then C on English Windows), and tell me what the output is (copy and paste it into your reply):
dir /b /s "%ProgramFiles%\The Witcher\tw3pfdin*.fontcache"
Or, if your Command Prompt is replaced by PowerShell, the equivalent command is:
Replace %ProgramFiles%\The Witcher (or $Env:ProgramFiles\The Witcher for PowerShell) with the path where you installed the game (e.g. %ProgramFiles(x86)%\Steam\SteamApps\common\The Witcher Enhanced Edition for the Steam version, etc.).
There's more than one way to make it work. Maybe the easiest at this point would be if you download UI-Font-TW3-Custom-DIY-Kit (under Optional Files), and put the the two .ttf files anywhere under Data. Then, run djinni!.exe (from %ProgramFiles%\The Witcher\System) and it will generate the missing .fontcache files on the fly. You can then close it and run the game.
Thanks man! I was really sad that the mod didn't work for me then I found this thread and fixed it. Thanks for your mod and your support ❤️ Endorsed and Kudos given
This mod is super helpful. I'm trying to translate Traditional Chinese to Simplified Chinese, and I can change the font now. Another question, if I want to create a new language named SC (for example) for the game, what should I do before I create a new 2da file named fonts_SC.2da to make sure that the system can read the true font? I have already known that I need to edit the value fonts which is in the file languages.2da. Please help me. Thank you. But if this question can't be solved, I can always continue this work by replacing the Traditional Chinese font. Please forgive my terrible English, my English is really bad, and unfortunately, Google Translate is not good to work with a lot of file's names.
It's an interesting question. I'm not sure I have the full answer.
As you noticed, there already is an entry for ChineseSimp in Data\languages.2da (alongside ChineseTrad), and if you set the Font column to something else rather than **** (for example to fonts_sc) then it should just read the font mapping from that file (fonts_sc.2da). The remaining problem then is, if I understand it right, that ChineseSimp is not enabled as a language choice. In my Options - Game Options - Subtitles there's only one "Chinese." That's ChineseTrad. So, ChineseSimp would have to be enabled elsewhere to work.
You'd then have to look for references to ChineseTrad in other game files (particularly inside 2da00.bif once unpacked) and add references to ChineseSimp as well where necessary. This could be easy enough but note there's one additional difficulty: languages are assigned numerical IDs too: ChineseTrad is id == 21 and ChineseSimp is id == 22. So in some places the languages might just be referred to by a number, which looks meaningless without context and/or is difficult to search for. In the end, there might be hard-coded references in binary files to something like 0x15, not easy to find and interpret. Although let's hope for the best.
Meanwhile also note that in languages.2da for ChineseTrad the character set (Charset) is set to zh. So for ChineseSimp you'd want to do that as well. But who knows what they mean by that... This is pre-Unicode. Alphabetic languages here are using Windows codepages like 1250 (Central & Eastern European Latin), 1251 (Cyryllic), 1252 (Western European Latin). So you might similarly run into additional conversion issues between Big5 and GB2312. Or maybe you won't. But it's good to be aware this might surface.
The Charset setting is somehow reflected in Data\Scripts\djinni_utils\mbin_{release,stable,unstable}.lua, a part of the build script. For Latin fonts it's: loadfonts("fonts") console "rebuildfontcache" But for Chinese, it's: loadfonts("fonts_zh", "zh") console "rebuildfontcache" So this zh here seems to refer to a range of glyphs to extract from the TTF file. If it includes the entirety of "CJK Unified Ideographs" (Wikipedia) then so far so good. But if not (i.e. only traditional, not simplified), you'd have to workaround that as well.
For the record, there's another way to go about it, bypassing the above complications, but I don't think you'd be interested. You could just modify a TTF file to show simplified characters in traditional positions. But this way you can't translate individual strings, and it's not a 1:1 mapping between traditional and simplified anyway. So this approach would be too simplistic.
So, the way I'd go about it would be like that:
Test 1: change one of the fonts in fonts_zh.2da to another traditional font to make sure djinni!.exe can generate it properly. The instructions are on the description page in the section "How to Customize It." If this doesn't work, you have to look into a way for generating Chinese fonts first of all.
Test 2: change some of the characters to simplified in one of the strings. See if they properly show. If not, you have to look into this Charset == zh setting and maybe tweak the range of glyphs extracted from the TTF file.
Assuming test 1 & 2 pass, clone ChineseSimp from ChineseTrad and find a way to enable it through the menu (the big part).
I'm aware this is far from a complete solution but hopefully it helps to get started.
One more thing I've noticed: there is more than one way the game references languages numerically. For example in:
Data\Scripts\imp_{a,b,c}_mod.lua
Data\Scripts\import_{a,b}_local.lua
There is: WhatToImport = bit.bor(WhatToImport, ConversationEditor.Language_16 )And then there're files like:
Data\lang_{3,5,10-16}.key
But in each case it's a different "16." Specifically:
Data\lang_3.key is the language with id == 3 (FinalEnglish_Short)
Data\lang_5.key is the language with id == 5 (Polish)
Data\lang_10.key is the language with id == 10 (German)
While:
ConversationEditor.Language_3 is the language at row #3 (FinalEnglish_Short)
ConversationEditor.Language_4 is the language at row #4 (Polish)
ConversationEditor.Language_5 is the language at row #5 (German)
So this is yet one more thing to be aware of. Funnily, FinalEnglish_Short happens to be assigned the same number in both cases but that's just a coincidence.
And in these places where ChineseTrad is Language_16, ChineseSimp would be Language_17 (not 22).
As for the translation itself, I'd start by extracting data from all the .bif files (with UnBIF), and taking a closer look what's there. Sorry I'm not really familar with the way data is organized in this game beyond what I had to research to make this mod and to set up others. Ideally you'd want to talk to someone who translated the game into another language (or modified an existing translation).
Thank you sooooo much for writing such a long reply!! I hope this didn't bother you. I have this replied last night (Beijing time, UTC+8), but I accidently close this passage and the reply I have written was gone.
Interestingly, the first question of the translate work I solved is the menu. I do not remember how I solved it, but it should not be very difficult. Maybe I just edit the file Data\languages.2da and create a new file Data\dialog22.tlk (the game use TLK file to save the subtitle of GUI and introductions of the items). Then, by edit the language's name in each TLK file, simplified Chinese can be shown normally in the menu.
After that, I tried to create a new file Data\2da\fonts_sc.2da and edit Data\languages.2da, but then I found it didn't work. There were no subtitles anymore, and this also caused a problem that djinni couldn't be opened. I guess there is somewhere else used this file too, so I need to find it.
But after some searching, I find another way to solve it. There are a few Chinese fonts that can both show simplified characters and traditional characters (do not use GB2312). Then I downloaded one and used your method to add it to the game, then I found it work, at least work on the traditional characters. I translate some strings in the TLK file I created, and I surprisedly find that simplified characters can also be shown normally (djinni.exe can generate it properly). Seems that Charset-zh isn't a big problem. To be frank, I am not sure how it works, but it does works.
Now, I am able to translate the conversations which are in DLG files and GUI/introductions in the TLK files. I am searching for the tutorial text now, for it is not in TLK file and probably not in the DLG file (if it does, .qst file will show it, but I cannot find it in the QST file). So, it falls back to FinalEnglish_short now. I'm learning more about the organization of game data, and I believe finding these words should not be a big problem.
The BIF file associated with Data\lang_ {3,5,10-16}.key is the voice over file of those languages (If my memory is not very confused, and it often is), so I don't think it is necessary to add simplified Chinese -- the game doesn't even have voice over of traditional Chinese.
Great to hear you've been making so much progress!
I think you could reach out to @MerseyRockoff. He's likely the person that knows the most about how things work in The Witcher, and how and where to change them. His mod Project Mersey - The Witcher Fix Pack has hundreds of fixes to all parts of the game, including lots of dialogues. He could give you some suggestions.
There's also this mod: The Rise of the White Wolf. It has (in particular) extensive changes to the user interface. I'm not sure if the authors are still hanging around here but their work can be studied to see how they did what they did.
Also check this out if you haven't already: Ukrainian Translation for The Witcher. Should be similar to what you're trying to do. And another translation-related mod has just appeared last month: Lost English Translation Restored. Maybe looking at some of this stuff makes things easier.
Data\lang_{3,5,10-16}.key is the voice over file
As far as I know, you're right. They can be ignored if you're not changing the voiceover. I just used them as example for the 2 different ways of enumerating languages. Not sure if the row number-style references are actually used elsewhere: if not, then it's one less thing to worry about.
With your help, except for some optimization measures, there are no technical problems in the translation work. If I finished this work (it's a big project and it's very difficult, but I believe I can finish it), I will add CloudGiant to the credits for your great help. Thanks a million.
Thanks for this. I had to increase everything by 4-6 points to get it appropriately sized for 2k, but thanks to your instructions I got it figured out. Looks great!
After making those changes, I just had to place the 2 .ttf font files in the override directory and then run Djinni to get it to generate the new fonts.
Thank you for the detailed information on how to DIY. Something for me to print up and fiddle around with later. Sorry for not endorsing it back in Jan. when I first downloaded it, it's endorsed now.
Amazing mod! I'm trying to make some of the text bigger modifying the points column in the fonts.2da file but when i do that for an specific row then it becomes invisible. How can i make it bigger? Thanks
What's not compatible with 8K? I guess you just have to adjust the font sizes. Which can be done already by downloading the "Custom DIY Kit" version of the mod, and following the instructions in the How to Customize It section of the description page (basically, just edit the sizes in fonts.2da and make sure to run Djinni!.exe once every time you change the values there before running the game).
I don't have an 8K screen myself so I'd have to be guessing what the sizes should be. Once you know the numbers that work for you, please share them here. I'll pin the post.
Just for the record: yes it does work with the Enhanced Edition. In fact, it's the only version I tested it with. Considering the EE has been around since 2008, I'm not even sure it's possible to get a hold of any of the earlier releases.
45 comments
Note that if you start playing with the settings, extra steps are required to generate the matching rasterized font files each time: it won't work otherwise, so please read and follow the instructions in the How to Customize It section of the description.
i follow the instruction and im pretty sure im doing it right
pls help.
If text isn't showing up, it means the font settings are changed but the font files are missing.
So, it seems you installed the fonts.2da file correctly somewhere under Data but not the tw3pfdin*.fontcache files, which should go into System\__cache (not Data\System\...).
To make the mod work, put the tw3pfdin*.fontcache files under System\__cache where they should be. If you want to go back to the original fonts, delete or rename the file fonts.2da.
If you need help with this, please run the command I mentioned in the reply to a post right below yours, and paste the output it shows in your comment.
This would shed more light as to what's going on but I'm guessing the issue is similar to that previous one. Most mod files only need to go into Data but this one has files that have to go both into Data and System, which might be confusing.
but like i said i follow the instruction and all but text still doesnt show up, idk tho perhaps the problem is at my system.
With the information you're giving me, I can only guess why for you it does not. My guess is that the .fontcache files are not where they should be.
There's more than one way to make it work. Maybe the easiest at this point would be if you download UI-Font-TW3-Custom-DIY-Kit (under Optional Files), and put the the two .ttf files anywhere under Data. Then, run djinni!.exe (from %ProgramFiles%\The Witcher\System) and it will generate the missing .fontcache files on the fly. You can then close it and run the game.
Alternatively, as I said before, run the following in your Command Prompt (Win-X, then C on English Windows), and tell me what the output is (copy and paste it into your reply):
dir /b /s "%ProgramFiles%\The Witcher\tw3pfdin*.fontcache"
Or, if your Command Prompt is replaced by PowerShell, the equivalent command is:
Get-ChildItem -Filter 'tw3pfdin*.fontcache' -Name -Path "$Env:ProgramFiles\The Witcher" -Recurse
Replace %ProgramFiles%\The Witcher (or $Env:ProgramFiles\The Witcher for PowerShell) with the path where you installed the game (e.g. %ProgramFiles(x86)%\Steam\SteamApps\common\The Witcher Enhanced Edition for the Steam version, etc.).
It's definitely solvable but help me help you.
looks so good :D
Thanks for your mod and your support ❤️ Endorsed and Kudos given
Another question, if I want to create a new language named SC (for example) for the game, what should I do before I create a new 2da file named fonts_SC.2da to make sure that the system can read the true font? I have already known that I need to edit the value fonts which is in the file languages.2da.
Please help me. Thank you. But if this question can't be solved, I can always continue this work by replacing the Traditional Chinese font.
Please forgive my terrible English, my English is really bad, and unfortunately, Google Translate is not good to work with a lot of file's names.
It's an interesting question. I'm not sure I have the full answer.
As you noticed, there already is an entry for ChineseSimp in Data\languages.2da (alongside ChineseTrad), and if you set the Font column to something else rather than **** (for example to fonts_sc) then it should just read the font mapping from that file (fonts_sc.2da). The remaining problem then is, if I understand it right, that ChineseSimp is not enabled as a language choice. In my Options - Game Options - Subtitles there's only one "Chinese." That's ChineseTrad. So, ChineseSimp would have to be enabled elsewhere to work.
You'd then have to look for references to ChineseTrad in other game files (particularly inside 2da00.bif once unpacked) and add references to ChineseSimp as well where necessary. This could be easy enough but note there's one additional difficulty: languages are assigned numerical IDs too: ChineseTrad is id == 21 and ChineseSimp is id == 22. So in some places the languages might just be referred to by a number, which looks meaningless without context and/or is difficult to search for. In the end, there might be hard-coded references in binary files to something like 0x15, not easy to find and interpret. Although let's hope for the best.
Meanwhile also note that in languages.2da for ChineseTrad the character set (Charset) is set to zh. So for ChineseSimp you'd want to do that as well. But who knows what they mean by that... This is pre-Unicode. Alphabetic languages here are using Windows codepages like 1250 (Central & Eastern European Latin), 1251 (Cyryllic), 1252 (Western European Latin). So you might similarly run into additional conversion issues between Big5 and GB2312. Or maybe you won't. But it's good to be aware this might surface.
The Charset setting is somehow reflected in Data\Scripts\djinni_utils\mbin_{release,stable,unstable}.lua, a part of the build script. For Latin fonts it's:
loadfonts("fonts")
But for Chinese, it's:console "rebuildfontcache"
loadfonts("fonts_zh", "zh")
So this zh here seems to refer to a range of glyphs to extract from the TTF file. If it includes the entirety of "CJK Unified Ideographs" (Wikipedia) then so far so good. But if not (i.e. only traditional, not simplified), you'd have to workaround that as well.console "rebuildfontcache"
For the record, there's another way to go about it, bypassing the above complications, but I don't think you'd be interested. You could just modify a TTF file to show simplified characters in traditional positions. But this way you can't translate individual strings, and it's not a 1:1 mapping between traditional and simplified anyway. So this approach would be too simplistic.
So, the way I'd go about it would be like that:
- Test 1: change one of the fonts in fonts_zh.2da to another traditional font to make sure djinni!.exe can generate it properly. The instructions are on the description page in the section "How to Customize It." If this doesn't work, you have to look into a way for generating Chinese fonts first of all.
- Test 2: change some of the characters to simplified in one of the strings. See if they properly show. If not, you have to look into this Charset == zh setting and maybe tweak the range of glyphs extracted from the TTF file.
- Assuming test 1 & 2 pass, clone ChineseSimp from ChineseTrad and find a way to enable it through the menu (the big part).
I'm aware this is far from a complete solution but hopefully it helps to get started.- Data\Scripts\imp_{a,b,c}_mod.lua
- Data\Scripts\import_{a,b}_local.lua
There is:WhatToImport = bit.bor(WhatToImport, ConversationEditor.Language_16 )
And then there're files like:- Data\lang_{3,5,10-16}.key
But in each case it's a different "16." Specifically:- Data\lang_3.key is the language with id == 3 (FinalEnglish_Short)
- Data\lang_5.key is the language with id == 5 (Polish)
- Data\lang_10.key is the language with id == 10 (German)
While:- ConversationEditor.Language_3 is the language at row #3 (FinalEnglish_Short)
- ConversationEditor.Language_4 is the language at row #4 (Polish)
- ConversationEditor.Language_5 is the language at row #5 (German)
So this is yet one more thing to be aware of. Funnily, FinalEnglish_Short happens to be assigned the same number in both cases but that's just a coincidence.And in these places where ChineseTrad is Language_16, ChineseSimp would be Language_17 (not 22).
As for the translation itself, I'd start by extracting data from all the .bif files (with UnBIF), and taking a closer look what's there. Sorry I'm not really familar with the way data is organized in this game beyond what I had to research to make this mod and to set up others. Ideally you'd want to talk to someone who translated the game into another language (or modified an existing translation).
I have this replied last night (Beijing time, UTC+8), but I accidently close this passage and the reply I have written was gone.
Interestingly, the first question of the translate work I solved is the menu. I do not remember how I solved it, but it should not be very difficult. Maybe I just edit the file Data\languages.2da and create a new file Data\dialog22.tlk (the game use TLK file to save the subtitle of GUI and introductions of the items). Then, by edit the language's name in each TLK file, simplified Chinese can be shown normally in the menu.
After that, I tried to create a new file Data\2da\fonts_sc.2da and edit Data\languages.2da, but then I found it didn't work. There were no subtitles anymore, and this also caused a problem that djinni couldn't be opened. I guess there is somewhere else used this file too, so I need to find it.
But after some searching, I find another way to solve it. There are a few Chinese fonts that can both show simplified characters and traditional characters (do not use GB2312). Then I downloaded one and used your method to add it to the game, then I found it work, at least work on the traditional characters. I translate some strings in the TLK file I created, and I surprisedly find that simplified characters can also be shown normally (djinni.exe can generate it properly). Seems that Charset-zh isn't a big problem.
To be frank, I am not sure how it works, but it does works.
Now, I am able to translate the conversations which are in DLG files and GUI/introductions in the TLK files. I am searching for the tutorial text now, for it is not in TLK file and probably not in the DLG file (if it does, .qst file will show it, but I cannot find it in the QST file). So, it falls back to FinalEnglish_short now. I'm learning more about the organization of game data, and I believe finding these words should not be a big problem.
The BIF file associated with Data\lang_ {3,5,10-16}.key is the voice over file of those languages (If my memory is not very confused, and it often is), so I don't think it is necessary to add simplified Chinese -- the game doesn't even have voice over of traditional Chinese.
Thank you again for your great help.
I think you could reach out to @MerseyRockoff. He's likely the person that knows the most about how things work in The Witcher, and how and where to change them. His mod Project Mersey - The Witcher Fix Pack has hundreds of fixes to all parts of the game, including lots of dialogues. He could give you some suggestions.
There's also this mod: The Rise of the White Wolf. It has (in particular) extensive changes to the user interface. I'm not sure if the authors are still hanging around here but their work can be studied to see how they did what they did.
Also check this out if you haven't already: Ukrainian Translation for The Witcher. Should be similar to what you're trying to do. And another translation-related mod has just appeared last month: Lost English Translation Restored. Maybe looking at some of this stuff makes things easier.
If I finished this work (it's a big project and it's very difficult, but I believe I can finish it), I will add CloudGiant to the credits for your great help. Thanks a million.
Thank you, and good luck! I'll link to your mod here when it's up.
Please feel free to post your settings here, it might help others.
2DA V2.0
Label TrueType Points Outline MinSize
0 default tw3pfdin 23 1 11
1 console tw3pfdin 20 1 10
2 smallinfo tw3pfdin 23 1 11
3 gui_infopanel tw3pfdinb 32 1 11
4 gui_default tw3pfdin 23 0 11
5 gui_label tw3pfdin 26 1 11
6 gui_bigger tw3pfdin 26 1 11
7 gui_huge tw3pfdin 32 1 11
8 gui_icon tw3pfdinb 23 0 11
9 gui_infopanel_big tw3pfdin 32 1 10
10 fnt_galahad14 tw3pfdin 16 1 11
11 subtitle tw3pfdin 26 1 11
12 choices tw3pfdin 26 1 11
13 tutorial tw3pfdin 20 0 11
14 credits tw3pfdin 30 1 11
After making those changes, I just had to place the 2 .ttf font files in the override directory and then run Djinni to get it to generate the new fonts.
Thanks
Details on the description page in the How to Customize It section, if you need them.
What's not compatible with 8K? I guess you just have to adjust the font sizes. Which can be done already by downloading the "Custom DIY Kit" version of the mod, and following the instructions in the How to Customize It section of the description page (basically, just edit the sizes in fonts.2da and make sure to run Djinni!.exe once every time you change the values there before running the game).
I don't have an 8K screen myself so I'd have to be guessing what the sizes should be. Once you know the numbers that work for you, please share them here. I'll pin the post.
copied both contents into the appropiate folders
Just for the record: yes it does work with the Enhanced Edition. In fact, it's the only version I tested it with. Considering the EE has been around since 2008, I'm not even sure it's possible to get a hold of any of the earlier releases.