[we need help!] Not possible to map certain characters for custom font

Bug reports and discussion about bugs.
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map 22 characters

Post by tangar »

Thank you very much for help! :D
PowerWyrm wrote: Fri Jan 26, 2018 12:25 pm If you want to use Fony and display text using Unicode charsets
Do you mean, that there is an option to do not use Unicode and do not use Fony (to use different font editor), then problem would be fixed?

==

I've tried some stuff, but didn't get any success :( My stream about it:
https://www.youtube.com/watch?v=zJldQQO2faw

1) I googled about your suggestion and found pretty cool article - What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)? https://www.codeproject.com/Articles/76 ... PCTSTR-etc But I'm 0 in coding @ C, so can't help with it :(

2) ASCII Table, ISO 1252 Latin-1 Chart & Character Set
http://www.idautomation.com/product-sup ... r-set.html

3) very good program to edit fonts FontForge (free):
https://fontforge.github.io/en-US/
There you could see which codes got certain glyphs.

4) http://www.alanwood.net/demos/ansi.html there I took codes for '(not used)' glyphs:

129 U+0081
141 U+008D
143 U+008F
144 U+0090
157 U+009D

So it seems it's not possible to remap 129, 141, 143, 144, 157.. But as 1-16 works for remapping (but actually they are 'system' commands), maybe it's possible to make 16-31 work too, hardcode them somehow.

Also Krice proposed "to write a custom "console" using something like SDL2" to fix this problem. But I suppose it would be even harder then rewrite ANSI to Unicode conversions :(
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
User avatar
PowerWyrm
Posts: 241
Joined: Sat Jan 09, 2010 4:28 pm

Re: [we need help!] Not possible to map 22 characters

Post by PowerWyrm »

How do you make the edited font actually display the new symbols? I have copied a little "roof" symbol at position 128, added the F:193:6/128 line in my font-custom-8x13x.prf, but when I launch the game, I still have the € symbol displayed. If I look at position 170, the symbol is a little "a" and the glyph is a little lightning bolt, but when I do F:193:6/170 and launch the game, the "a" symbol is displayed, not the lightning bolt. So it seems the game uses the symbols and not the glyphs. When I do the same with the 10x20 font that is packaged with TomeNET, I can display the glyphs just fine. Do you need a special type of font for TomeNET?
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map 22 characters

Post by tangar »

Youtube trolled my video again... WTF, it had proper name/tags... I made an appeal, waiting for it to restore (1-2 days).
PowerWyrm wrote: Sat Jan 27, 2018 12:09 pm How do you make the edited font actually display the new symbols
The most simple way - just to to the same thing which I did in this video - https://youtu.be/mv7bxDMKYLo - make a copy of .prf file (for example, font-custom-24X36TG.prf) and rename it to your 'size, for example, font-custom-8X13X.PRF (please note, that name of file has to be in caps, font-custom-8x13x.prf won't work).
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map 22 characters

Post by tangar »

Ok, my video back :D

https://www.youtube.com/watch?v=zJldQQO2faw

Guys, got any news? PowerWyrm, how it went with remapping?
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map 22 characters

Post by tangar »

Guys, lets continue brainstorm!

For now we need to understand how to fix 0, 16-31 glyphs! As 1-16 works for remapping (but actually they are 'system' commands), it has to be possible to make 16-31 work too!

Currently they got this values:

0 linked to 35 (#)

16 ┼ 253C 197
17 ◄ 25C4 17
18 ↕ 2195 18
19 ‼ 203C 19
20 ¶ 00B6 20
21 ┴ 2534 193
22 ┬ 252C 194
23 ┤ 2524 180
24 ↑ 2191 24
25 ├ 251C 195
26 → 2192 26
27 ← 2190 27
28 NULL
29 NULL
30 NULL
31 linked to 35 (#)

Symbols took from https://en.wikipedia.org/wiki/Code_page_437 (but they are in wrong places)

GOGOGO! We can do it!

==
Update:
1) Found interesting topic, someone managed to extend font file: http://fony.proboards.com/thread/3/unicode-fnt-files
2) I've wrote about our problem at Fony forum - http://fony.proboards.com/thread/71/hel ... characters ; hope that someone would be able to help!
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map 22 characters

Post by tangar »

We got an important update:

'Fony' (http://hukka.ncn.fi/?fony) developer Hukka noted that:
Anyway, this seems to be a bug in the game and not Fony. I've seen at least two people say that it's because "Fony relies on Unicode", but that makes no sense when it comes to bitmap fonts, and Fony only really uses Unicode to display various language translations in the user interface. Previous versions of Fony didn't even support Unicode in any way at all! Bitmap fonts have no concept of Unicode, nor does Fony when it's handling them. It's just 256 glyphs, one after another, bitmaps in a file.
Does it looks like it's not the problem of the font, but actually the problem in the TomeNET code? TomeNET source could be found: https://www.tomenet.eu/downloads.php

p.s.
Also Hukka said that soon he would create crossplatform opensource version of Fony! Great news :D
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map 22 characters

Post by tangar »

We got hot discussion of this matter at oook forum:
http://angband.oook.cz/forum/showthread ... post128252
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
User avatar
tangar
Posts: 1652
Joined: Tue Mar 03, 2015 3:49 pm
Contact:

Re: [we need help!] Not possible to map certain characters for custom font

Post by tangar »

Back to this problem. This is super actual thing to solve.

What if.... we would take this characters in Windows OS system:
16 ┼ 253C 197
17 ◄ 25C4 17
18 ↕ 2195 18
19 ‼ 203C 19
20 ¶ 00B6 20
21 ┴ 2534 193
22 ┬ 252C 194
23 ┤ 2524 180
24 ↑ 2191 24
25 ├ 251C 195
26 → 2192 26
27 ← 2190 27
..and hardcode-replace them with our symbols? Anyone knows where this symbols hardcoded (EX: at Windows 7) and how to replace them?
Tangar's tileset, addon, guides & maps: English TomeNET page ||||||| Russian TomeNet page
http://youtube.com/GameGlaz — streams in English // http://youtube.com/StreamGuild — streams in Russian
My chars @ angband.oook.cz
Post Reply