draconisPW / PWMAngband

A free, multi-player roguelike dungeon exploration game based on Angband
35 stars 12 forks source link

don't use custom font prf for vector fonts #578

Closed igroglaz closed 1 year ago

igroglaz commented 1 year ago

SDL/SDL2 client glitches - not showing some monsters in ASCII

eg Baba Yaga image

gcu works alright...

Serega found out that it's .prf problem:

_[19:18]Serega88: different files in fonts folder (3x5TG.fon ...) https://github.com/igroglaz/Tangaria_release/tree/master/lib/fonts sdlinit.txt in UbuntuMono-Regular.ttf there is no 'Baba Yaga' icon font-sdl.prf you need to use Tangaria-tg.ttf or tg.fon files_

_[19:30]Serega88: font-sdl2.prf doesn't support icons (0x01 to 0x1f) g_ascii_codepoints_forcache[] https://github.com/draconisPW/PWMAngband/blob/master/src/client/main-sdl2.c#L238

I suppose ezpz fix will be to disable hooking of custom prfs for vector fonts when playing in ASCII

s88100 commented 1 year ago

is it possible to add a list of fonts (.fon/.ttf) to https://github.com/draconisPW/PWMAngband/blob/master/lib/customize/font.prf#L24

?:[IOR [EQU $FONTNAME 21x31tg.fon] [EQU $FONTNAME 24x36tg.fon]]
%:font-tng.prf

?:[EQU $FONTNAME Tangaria-tg.ttf]
%:font-tng.prf

then leave the default font-sdl.prf for customization it works, but need to restart the client

https://github.com/draconisPW/PWMAngband/blob/master/src/client/main-sdl.c#L6179

init_windows()
/* Hack -- set ANGBAND_FONTNAME for main window */
if (i == 0) ANGBAND_FONTNAME = win->req_font.name;
s88100 commented 1 year ago

or you can just make a file (font-ascii.prf, font-ttf.prf)

?:[IOR [EQU $FONTNAME UbuntuMono-Bold.ttf] [EQU $FONTNAME UbuntuMono-Regular.ttf]]
%:font-ascii.prf

and write npc, monsters with letters from font-sdl.prf (65-122)

draconisPW commented 1 year ago

No idea what this is all about. Isn't that a problem with the fonts you use? Same problem happens with V? If so, try to open an issue in the V repository and I'll port the fix.

igroglaz commented 1 year ago

in font-sdl.prf there are:

feat:Halbarad, the old ranger:*:13:188
feat:Sonya the cat:*:15:173
feat:Morinehtar the Wizard:*:12:186
feat:Old guard Barry:*:3:188
#feat:Bob the villager:*:2:177
#feat:Marta the villager:*:7:164
feat:Shtukensia the tavernkeeper:*:10:164
feat:Danny the dog:*:15:167
#feat:Arthur the Archer:*:5:187

this values based at old .FON fonts which got additional glyphs... in new vector fonts (eg UbuntuMono-Bold.ttf) there is no such values (they are empty)

Anyway, nvm.. Serega is working on fixing it

igroglaz commented 1 year ago

fixed by Serega https://github.com/igroglaz/Tangaria/pull/141