Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
478 stars 77 forks source link

How to edit fonts #600

Closed Spikeone closed 8 years ago

Spikeone commented 8 years ago

I just started editing the fonts and wanted to try out the new feature first.

Sadly it's not working.

I did the following steps: 1) I unpacked the OUTLINE_FONTS.LST 2) I created a subfolder named 2.dx14.dy16.fon 3) I copied an existing letter to that folder and renamed it to 212.player.nx0.ny0.bmp 4) I repacked the font 5) I started RttR and no change

1) I unpacked the OUTLINE_FONTS.LST 2) I created a subfolder named 2.dx14.dy16.fon 3) I copied an existing letter to that folder and renamed it to 212.player.bmp 4) I repacked the font 5) I started RttR and no change

1) I unpacked the OUTLINE_FONTS.LST 2) I created a subfolder named 2.dx14.dy16.fonX 3) I copied an existing letter to that folder and renamed it to 212.player.bmp 4) I repacked the font 5) I started RttR and no change

1) I unpacked the OUTLINE_FONTS.LST 2) I renamed the folder 2.dx14.dy16.fon to 2.dx14.dy16.fonX 3) I copied an existing letter to that folder and renamed it to 212.player.bmp 4) I repacked the font 5) I started RttR and no change

1) I unpacked the OUTLINE_FONTS.LST 2) I renamed the folder 2.dx14.dy16.fon to 2.dx14.dy16.fonX 3) I copied an existing letter to that folder and renamed it to 212.player.bmp 4) I repacked the font 5) I unpacked the font, this was not possible as an error occured

I have no idea what I should do or what I'm doing wrong but I assume that I need some help.

Flamefire commented 8 years ago

There is a wiki: https://github.com/Return-To-The-Roots/s25client/wiki/How-to-edit-fonts

What do you mean with "no change"? 212 is some foreign glyph, so did you test that this glyph should be shown there? There should not be any error if you use the new lstpacker (link in wiki). So if you used the new lstpacker your last example (at least) is not possible. There should be no .fon folder. only .fonX.

Did you rename the repacked lst? Repacking produces a *.new.lst.

Spikeone commented 8 years ago

Yeah, I followed that link - altough it's not 100% clear (as for folders, should existing folders be renamed or should one create a new folder and if I could still use nx and ny or not (as the lstpacker unpacks them that way).

that was my setup: Verzeichnis von C:\Users\Spike\Desktop\OUTLINE_FONTS_2 30.09.2016 21:07

0.dx9.dy10.fon (dafuck is wrong with you here github???) 30.09.2016 21:07 1.dx12.dy13.fon 30.09.2016 21:08 2.dx14.dy16.fonX

Verzeichnis von C:\Users\Spike\Desktop\OUTLINE_FONTS_2\2.dx14.dy16.fonX 30.09.2016 20:30 476 100.player.nx0.ny0.bmp 30.09.2016 20:30 536 101.player.nx0.ny0.bmp [...] 30.09.2016 21:02 814 212.player.bmp [...] 30.09.2016 20:36 734 313.player.bmp [...]

Those tow new files are the following letters: 00D4 Ô 212 0139 Ĺ 313 Taken from here: http://www.geocities.ws/click2speak/unicode/chars_sk.html

I downloaded the latest lstpacker version from the wikilink.

When just drag and drop the folder on the exe (as the article suggests) a cmd window opens and closes immediatly. So I created a shortcut (as I did before) and it packed the file: OUTLINE_FONTS_2.NEW.LST Now I just tried to unpack this OUTLINE_FONTS_2.NEW.LST the same way I unpacked OUTLINE_FONTS.LST. This results in a shortly visible cmd window which also closes immediatly.

Thats why I guess this lstpacker version provided is broken.

I also tried unpacking the original file and repacking it and unpacking it again. The new lstpacker just failed as it is not possible to unpack the packed .LST file anymore. The old lstpacker could still do that.

Hope that helps

PS: Yes I renamed the file. Yes I just copy and pasted those letters into RttR - the "L" was shown as a normal "L" and the "O" wasn't shown at all.

Flamefire commented 8 years ago

You are doing something seriously wrong. First try again with the recent outline_fonts.lst. If you unpack that, there is NO *.fon folder. There should be (as mentioned in the wiki) exactly 3 folders named 0...fonX, 1...fonX, 2...fonX, one for each size . The wiki also says that the folders must be named "fonX" for unicode fonts. ("Make sure..." so no need to rename anything as they are already fonX, made that also a bit more clear) The nx0ny0 part can be omitted as also mentioned in the wiki, other offsets should not be used as they don't make any sense for fonts (not sure if it is even supported correctly)

As for the lstpacker: Have you tried running this command line application from the command line? It would tell you, that it can't find the GFX files (added that to the wiki now). Currently it must be executed from/in the folder of the lstpacker, but that should be fixed by someone soon...

I just tried (again) the new lstpacker: unpack, pack, unpack -> No problems

Non-existing glyphs should be shown as a "?" in RTTR. Probably some have replacements (copies of similar letters) in the fonX folder.

Spikeone commented 8 years ago

I see, I guess I only had .fon folders as I used the old lstpacker for unpacking, then missinterpreting the fonx part as I only renamed one folder. I guess thats what caused the problem at all.

Still, I can't get it working. When using IRC to write those letters, only "?" are visible. When using mapnames with those chars, the game can't load them and runs into an error When using a script, the game fails when trying to use chr() with a lua error When using [ALT] + 0313 I get a strange letter and with [ALT] + 0212 i get nothing

guess I'm still doing something wrong...

http://www.rfmonline.de/rttr/spike/outlines.rar

EDIT: I see, I used the wrong size - although I still can't understand the outcome perfectly it's enough for testing.

asdasd

As you see some letters aren't shown or even other letters are shown but... at least its a bit working (although I'm wondering why no message was shown that dwemer left the lobby, the bot noticed).

Which font sizes do we use? All?

Flamefire commented 8 years ago

I don't understand your current problem. The chars are shown, but you used the wrong size (font height is 16 px, see the folder name, but you used 19px) However the ingame chat output looks like some chars are missing. Probably the lobby has problems with UTF-8? Map names are encoded in a specific encoding, not UTF-8. So you can't use those chars there. At least not directly. For the rest exact error messages and a screenshot for the "strange letters" part would help. For Lua: Is your file saved as utf-8?

Yes ALL font sizes are used. That chat control uses size 1.

Edit: Can you use ALT + CODE in RTTR? Doesn't work for me. Regarding the missing letters: The lobby bot does not get UTF-8. So even writing "ÄÖÜ123" will only print "ÄÖÜ" w/o the "123". Happens in both directions (RTTR<->IRC) Probable reason: Special chars take 2 bytes. If the bot sends the real string length as the size and then the bytes it will send 6 as the size which is only the size (in bytes) of "ÄÖÜ" in UTF-8. Can't find the source of the bot, so this is something for @Flow86

Spikeone commented 8 years ago

As said in the IRC channel, thanks for your help, that at least solves all problems that remained for me.

So I'm closing this bug for now :)