[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] Porting to SDL2

From: Kai Sterker
Subject: Re: [Adonthell-devel] Porting to SDL2
Date: Thu, 9 Jun 2016 10:25:10 +0200

On Mon, Jun 6, 2016 at 9:52 PM, Kai Sterker <address@hidden> wrote:

There is one thing that I want to give a bit of an overhaul still, and that is the text rendering. Due to the scaling and the way I originally implemented the true type font stuff, spacing between the letters is somewhat sub-optimal. Since SDL2_ttf implements support for kerning, I'll check if applying this improves the readability of the text.

This is done. The main issue really was that while glyphs were rendered at full resolution, their actual size could only be expressed in multiples of the current scale, as internally all rendering and composition is done at a 320x240 resolution. So a letter that is actually 9px wide at full resolution would be reported as 12px at a scale of 4. That would leave a gap of 3px to the next letter. Those gaps would increase as the scale increased (they were present in v0.3.5 too, but at a scale of 2 they weren't as noticable). Now I've introduced an offset during rendering that counters that effect. This might also be useful for my smoother scrolling idea, but I don't think there is time to look into that.

In testing, I also fixed a 10 year old bug that actually prevented the use of a different true type font via configuration file. Trying to parse the configured font as an integer really didn't work ,-).

Also made sure the original bitmap font works.

Unfortunately, I did notice a performance degradation during the dialogues. Especially with true type fonts it takes ages to render the text. CPU load goes way up, and I no longer can quickly skip through dialogues. Will take a look into that today.

Once that is done, I really, really need to test the SDL2 stuff on OSX and also start looking for a way to produce Windows binaries. I don't think I'll do any other major changes or additions to the code :-).

Hope to get OSX binaries done on the coming weekend. Then there is one week remaining for the Windows version. Right on time.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]