GLK engine: Antialiased fonts?

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
vanfanel
Posts: 73
Joined: Sat Dec 15, 2012 11:14 am

GLK engine: Antialiased fonts?

Post by vanfanel »

Hi there!

It seems that the GLK engine allows some undocumented options, as seen here:

viewtopic.php?p=89643

However, looking at https://github.com/scummvm/scummvm/blob ... k/conf.cpp, I can't find an option for antialiased text, and as things are by default, text looks grainy an pretty much ugly.

So, are there low-les fonts I could use? (I take low-res fonts like Amiga's Topaz or similar would make Zork look good).
Or is there an option to apply antialiasing?
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: GLK engine: Antialiased fonts?

Post by criezy »

I suspect the issue is not so much the antialiasing (which I think is already used in glk) than the resolution at which the text is rendered, by default 640x400. It is first rendered at that scale by the engine, and then scaled by the backend. Ideally for those games we would want to do the text rendering directly at the current screen resolution and not do post-rendering scaling in the backend.

The conf file you point to is the one that defines the width and height to use in the engine, and it looks like you can control that by adding "width" and "height" settings in the scummvm.ini file for the glk games. You may also want to set the graphics and stretch mode to normal/centered to make sure it does not scale the display if your window size does not match exactly the size you set. I would be interested to know if playing with that size indeed improves the text display.
vanfanel
Posts: 73
Joined: Sat Dec 15, 2012 11:14 am

Re: GLK engine: Antialiased fonts?

Post by vanfanel »

criezy wrote: Tue May 24, 2022 1:32 pm I suspect the issue is not so much the antialiasing (which I think is already used in glk) than the resolution at which the text is rendered, by default 640x400. It is first rendered at that scale by the engine, and then scaled by the backend. Ideally for those games we would want to do the text rendering directly at the current screen resolution and not do post-rendering scaling in the backend.

The conf file you point to is the one that defines the width and height to use in the engine, and it looks like you can control that by adding "width" and "height" settings in the scummvm.ini file for the glk games. You may also want to set the graphics and stretch mode to normal/centered to make sure it does not scale the display if your window size does not match exactly the size you set. I would be interested to know if playing with that size indeed improves the text display.
You're right, sir. If I set stretch mode to center or pixel-perfect, font is not distorted/aliased.
Then I can add with and height values matching my physical video mode sizes (1280x720), and the games look fullscreen too.

The problem is that, as you will surely suspect, text is veeery tiny this way.
I don't see a font size parameter: is there one?
Also, are there background & text color parameters?

EDIT: I found the "monosize" and "propsize" parameters, and they seeem to work! Great!
Now, how can I specify a font, please? This should be very nice with an Atari or Amiga font.
It seems the tfont_* and gfont_* parameters are the way to go, but... what font names can I specify?
User avatar
Praetorian
ScummVM Developer
Posts: 882
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: GLK engine: Antialiased fonts?

Post by Praetorian »

vanfanel wrote: Wed May 25, 2022 3:14 pm EDIT: I found the "monosize" and "propsize" parameters, and they seeem to work! Great!
Now, how can I specify a font, please? This should be very nice with an Atari or Amiga font.
It seems the tfont_* and gfont_* parameters are the way to go, but... what font names can I specify?
Currently supported font names seem to be in "engines\glk\screen.cpp"

Code: Select all

"monor" for "GoMono-Regular.ttf"
"monob" for "GoMono-Bold.ttf"
"monoi" for "GoMono-Italic.ttf"
"monoz" for "GoMono-Bold-Italic.ttf"
"propr" for "NotoSerif-Regular.ttf"
"propb" for "NotoSerif-Bold.ttf"
"propi" for "NotoSerif-Italic.ttf"
"propz" for "NotoSerif-Bold-Italic.ttf"
Here's my scummvm.ini section for Scott Adam's Marvel Adventure #2 (some of the colors I've configured might be unused for this game):

Code: Select all

[marveladventure2]
engineid=glk
speak=false
bordercolor=F08888
monosize=22
gcolor_0=F44423,001212
speak_input=false
morecolor=F08888
propsize=18
guioptions=sndNoSubs sndNoMusic
linkcolor=FF0011
filename=quest2.dat
tcolor_8=F08888,013377
tcolor_0=FFFFFF,000000
description=Marvel Adventure #2 (English)
path=D:\Games\GLK\ZCODE\AdamsGames\
windowcolor=000000
caretcolor=F08888
gameid=marveladventure2
tfont_0=propz
language=en
This (along with a patch code that I've issued as a PR) results to this:
scummvm-marveladventure2-00000.png
scummvm-marveladventure2-00000.png (56.94 KiB) Viewed 3325 times
User avatar
Raziel
ScummVM Porter
Posts: 1539
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: GLK engine: Antialiased fonts?

Post by Raziel »

I'm following this closely, but tend to lose focus when I get back home from work.

Could someone please write up the steps to achieve this after it was implemented?
Docs maybe...or even better, please add a launcher dialogue option for fonts/background color/size for glk games?!

Thanks s bunch
zeropolis79
Posts: 18
Joined: Mon Apr 28, 2008 8:41 am
Location: Gosport, Hampshire
Contact:

Re: GLK engine: Antialiased fonts?

Post by zeropolis79 »

I can't make head nor tails of those instruction either. Any help would be thankfully recived thanks
Post Reply