text in label displays differently on different systems

Started by HandsFree, Sun 26/02/2017 10:40:26

Previous topic - Next topic

HandsFree

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

Crimson Wizard

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?

HandsFree

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:

linux:

Crimson Wizard

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

HandsFree

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

Crimson Wizard

#5
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.


HandsFree

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:

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...

Crimson Wizard

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.

HandsFree

Ok, I think I'll leave it for this game, but next time I may have a look at automatic text splitting.
thanks

SMF spam blocked by CleanTalk