AGS - 'Automatic outlining fonts' not working

Subforum for discussion and help with ScummVM's Android port

Moderator: ScummVM Team

Post Reply
User avatar
Bluemax
Posts: 3
Joined: Sat Sep 04, 2021 7:04 pm

AGS - 'Automatic outlining fonts' not working

Post by Bluemax »

Hallo,
some games don't use outlined fonts as intended and thus are hard to play. Just a guess but it could be possible that the built-in 'automatic outlining fonts' are not working properly. If i understand it correctly these fonts are outlined/rendered by the engine itself.
The game below is '7 days a skeptic'. The successor of '5 days a stranger' that worked properly though (with outlined fonts). Either they swapped the font engine (static font <> automatic outlining) or its something different. I played these games on Android (2.4.0git104-g7605439c5f 3.sep.2021). Another game with missing outlines is 'Billy Masters Was Right'.
https://www.adventuregamestudio.co.uk/s ... rial/ags/9
There are two ways to do outlines - AGS can do an automatic outline, or you can import a special outline font. They both have advantages:
- Automatic outlining is easy to use - just set the option, and it works with any font.
- Using an outline font is faster in the game, since it is just drawn once (whereas automatic outlining has to redraw the line of text 8 times).
Edit: I've tested the Windows debug version now (on Wine) and it works properly there so its indeed an Android-only issue.

Image

Image
User avatar
Praetorian
ScummVM Developer
Posts: 408
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: AGS - 'Automatic outlining fonts' not working

Post by Praetorian »

Bluemax wrote: Sun Sep 05, 2021 12:57 pm
Image

Image
Hi there! Yes, I am able to reproduce the issue, and I can see a possible cause for it, but not the root of the issue yet.
If I have a fix, I'll submit it ASAP.

Edit: Right. The issue occurs because, by default, Android treats a variable declared simply as "char", as unsigned. However, the AGS engine code there uses a "char" field, responsible for the outlining, as (implied) signed. I have fixed this on my local copy of the code and tested it; it works ok on Android now.

However, the question now is.. where else is there such assumption for "char" that would make Android builds behave differently?
User avatar
Bluemax
Posts: 3
Joined: Sat Sep 04, 2021 7:04 pm

Re: AGS - 'Automatic outlining fonts' not working

Post by Bluemax »

User avatar
Praetorian
ScummVM Developer
Posts: 408
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: AGS - 'Automatic outlining fonts' not working

Post by Praetorian »

Bluemax wrote: Mon Sep 06, 2021 5:28 am What about going '-fsigned-char'?
https://stackoverflow.com/questions/741 ... ndroid-ndk
Yes, I'm looking into that too. Forcing that however may break other stuff that currently work on Android (our third party cross compiled libraries, debug/log messages on Android Studio (as mentioned in that stackoverflow link), something else). I will probably try it and see.

As far as I can tell, this could also be an issue for other ports for ARM based architectures.

Also, it's a good practice to make the code clearer in this case and use signed char or, as was suggested to me, int8.

So, it looks like that this is going to be a larger PR fix, and it may take a bit -- this is going to be a rough week for work and other personal stuff.
User avatar
Praetorian
ScummVM Developer
Posts: 408
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: AGS - 'Automatic outlining fonts' not working

Post by Praetorian »

I've decided to go with the -fsigned-char, since from a bit of testing this seems to work ok.

I will also commit a PR for changes of (unspecified) char to int8 where appropriate for AGS engine at a later time (working on it currently). Doing this for every engine and common code would be an insane amount of pedantic work though.
User avatar
Bluemax
Posts: 3
Joined: Sat Sep 04, 2021 7:04 pm

Re: AGS - 'Automatic outlining fonts' not working

Post by Bluemax »

I will do some AGS games next having an eye on it. If there's anything suspicious i'll let you know.

Thanks for the fast fix!
Post Reply