Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: HandsFree on Sun 26/02/2017 10:40:26

Title: text in label displays differently on different systems
Post by: HandsFree on Sun 26/02/2017 10:40:26
I have a label that displays all text in the game. I carefully checked all the the texts that they fit within the label.
Now morganw, who is testing, reports that he can't see the last words of some of the texts. When I play the game, those same texts are displayed correctly and I can see all words.

How is this possible?
The game is 16-bit (don't ask why, cause I dont remember).
AGS 3.3.4.2.

Is there anything I can do to make sure the text in the label is always completely visible?

thanks
Title: Re: text in label displays differently on different systems
Post by: Crimson Wizard on Sun 26/02/2017 12:28:01
Can you both post some screenshots (or parts of screenshots, with just a label, if you do not want to reveal your game much)?
Also, what do you mean by different systems, are these completely different like Windows and Linux? Are you using same game setup? Same translation?
Is the font WFN or TTF?
Title: Re: text in label displays differently on different systems
Post by: HandsFree on Sun 26/02/2017 21:14:35
I wasn't aware the test was done in linux. So it looks like a win vs linux thing.
Started the game 5 years ago so I'm not sure what the font was, but I think TTF.

windows:
(http://i292.photobucket.com/albums/mm18/HandsFree1/textwin.png~original)
linux:
(http://i292.photobucket.com/albums/mm18/HandsFree1/textlinux.png~original)
Title: Re: text in label displays differently on different systems
Post by: Crimson Wizard on Sun 26/02/2017 21:43:29
We've seen issues with TTF fonts before. On Linux they use another version of fonts-drawing library, that displays some fonts differently, and probably calculates their sizes differently too.
You may notice from these screenshots that it still displays all text, but splits it into more lines.

How do you set the background and label up, does it have fixed size or calculated? In theory you should be able to use values returned by GetTextWidth and GetTextHeight on Linux too.

By the way, check this thread out, I described known problems with GetTextWidth and GetTextHeight there that may also be related to observed effect:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=54501.0
Title: Re: text in label displays differently on different systems
Post by: HandsFree on Sun 26/02/2017 22:55:06
It is fixed size. I don't use GetTextWidth and GetTextHeight.
Looks like I have to accept that this will not be always working correctly on linux. I'm not a linux user so I don't know anything about that anyway.

thanks
Title: Re: text in label displays differently on different systems
Post by: Crimson Wizard on Mon 27/02/2017 19:21:57
Quote from: HandsFree on Sun 26/02/2017 22:55:06
It is fixed size. I don't use GetTextWidth and GetTextHeight.
Looks like I have to accept that this will not be always working correctly on linux. I'm not a linux user so I don't know anything about that anyway.

But this has little to do with Linux; this is because the label is always of fixed size while the text can be printed slightly differently. You will get similar problem if, for example, you will try to add translations to your game.
You could make this work for any case relatively easy by resizing label depending on values GetTextWidth and GetTextHeight return to you. Or coding text scrolling, using slider control, or something like that.

Title: Re: text in label displays differently on different systems
Post by: HandsFree on Wed 01/03/2017 00:10:01
Quote from: Crimson Wizard on Mon 27/02/2017 19:21:57
this is because the label is always of fixed size while the text can be printed slightly differently.
Do you mean that the text might be printed differently in windows as well?
Resizing the label is no option cause the game looks like this:
(http://i292.photobucket.com/albums/mm18/HandsFree1/yourquarters.png~original)
Indeed that could be a problem with translations, but since all text displays properly on my laptop I assumed it would look like that for everyone...
Title: Re: text in label displays differently on different systems
Post by: Crimson Wizard on Wed 01/03/2017 00:23:25
Quote from: HandsFree on Wed 01/03/2017 00:10:01
Do you mean that the text might be printed differently in windows as well?

No, I had only translations in mind when saying that. I just mean that relying on fixed text size may be source of problems if you ever decide to update the game.

I see what you mean by impossible resizing. In your case it seems like scripting automatic text splitting into parts, or scrollable text are only options.
Title: Re: text in label displays differently on different systems
Post by: HandsFree on Wed 01/03/2017 21:49:26
Ok, I think I'll leave it for this game, but next time I may have a look at automatic text splitting.
thanks