Font

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
jkhristian

Font

Post by jkhristian »

How simple is it to change the fonts in exult these days?
I was just think it would be nive to have a high resolution version of the current font. Optional of course. Just to make reading a little easier.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by drcode »

It's a bit of work, since each glyph is a bitmap. Also, I don't know if you can improve the resolution, unless you make the font bigger.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by Colourless »

It can be done, but whether it would be easy to do it with Exult is a different matter. Of course it would still require a 'bigger font'

In Pentagram when I wrote the renderer for it I added in specific support for allowing us to draw 'High Resoultion' shapes and bitmaps ontop of the upscaled game world. This allows us to render text using 'high resoultion' true type fonts instead of the tiny font the original game used.

In theory it would be possible to do the same with Exult, and I 'was' planning on changing the graphics engine of Exult to be more like Pentagrams, but I no longer have the time to spend on Exult and Pentagram that I once had. The biggest problem with Exult is the scaling engine was added in as a post procesessing after thought. The engine still thinks it's running at the lower resolution and makes many assumptions about that.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by drcode »

I should take a look at Pentagram's rendering. Does it prescale everything? I thought that we had to scale after rendering in order for the scaler algorithms to work correctly.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by Colourless »

In Pentagram we render everything using Gumps, even the game world. We have a special 'scaling gump' that applies a scaler to the rendered results of all it's child gumps. We can then render more gumps on top of that. Of course there is some trickery involved in order to get the draw order correct with text. For simplicities sake Pentagram also renders in 32/16bit all the time.

Only downside to it at the moment is the mouse cursor is always drawn unscaled, which will get fixed eventually. :-)
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by marzo »

In Pentagram we render everything using Gumps, even the game world. We have a special 'scaling gump' that applies a scaler to the rendered results of all it's child gumps. We can then render more gumps on top of that.
Putting it in more usual graphic editing lingo, you have multiple layers in the screen, some of which are lower-resolution but scaled up to match the higher resolution of the unscaled layers, which are rendered on top. Correct?
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by Colourless »

Conceptually you could consider it to be layers, and in many ways pentagram treats it as layers too, but in practice we've not strictly implemented like that. Gumps in Pentagram are a fairly complete UI system and it's implemented as a tree. We just do one call to the DesktopGump to paint and it calls render for all it's children, that call render for all their children and so on. One of the children of the DesktopGump is a ScalerGump object. The ScalerGump does all the required Coord translation for input, traces, rendering, etc as well as setting up the low resolution buffer for it's children to render it and doing the actual up scaling.

There are 3 main layers:
DesktopGump
ScalerGump (which is the bottom most child of DesktopGump)
InverterGump (which is the bottom most child of ScalerGump)

The InverterGump is a special gump that does the annoying screen inversion that U8 did when you press the 'wrong' buttons in the catacombs, and obviously has no relevance to Exult.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Font

Post by drcode »

That sounds really good. Maybe that's something we should consider for Exult. I really need to study Pentagram's code.
Locked