Hard Light Productions Forums

Hosted Projects - FS2 Required => Blue Planet => Topic started by: jones34 on September 12, 2014, 03:27:19 pm

Title: Wrong font size in HUD / lines of text are to close to each other
Post by: jones34 on September 12, 2014, 03:27:19 pm
Hi

I got a problem with Blue Planet: War in heaven
The messages I get in my HUD are appearing to close to each other. Also the font size in the weapons part of the HUD is to big or just wrong.
Here is a screenshot of the problem: https://www.dropbox.com/s/56umh1zc8unoxts/screen0000.png?dl=0 (https://www.dropbox.com/s/56umh1zc8unoxts/screen0000.png?dl=0)
There are some other little problems everywhere other fonts than the original ones from FS2 are used, but text in all briefings appears to be normal.

I installed Blue Planet with the FSO Installer and i am using an original copy of FS2. I got all the files listet as necessary for Blue Planet: War in Heaven.
All other mods i tried are working properly including Blue Planet: Age of Aquarius.
I also visited the troubleshooting pages but i did not finde a solution.

I hope you can help me.

Regards
Johannes
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on September 12, 2014, 10:31:17 pm
Blue Planet has replaced the default retail Freespace2 font with Arial (I think). What you're seeing is pretty much as intended.  Any fixes would require either a new font (maybe a slightly smaller size?), or perhaps some code changes.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on September 13, 2014, 12:43:44 am
I know the messages gauge can be adjusted to provide more vertical space for each line. The same is also possible for the weapons gauge, but the graphics for that gauge would have to be made slightly taller (which isn't difficult to do).
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on September 13, 2014, 01:25:50 am
It turns out that the weapons gauge is actually supposed to use the standard FS2 font, which in Blue Planet 2 is at index 3 instead of 0. BP2's HUD table explicitly sets the weapons gauge to use font 3; however, an FSO bug is changing it to 0. I think I can fix that.

Unfortunately, fixing that bug would cause another problem: Special characters like the arrows and the monospace 1 would disappear because there's currently no way to display special characters from any fonts other than those at indices 0 and 2. (Indices 1, 3, and 4 are fixed at 0, and index 2 is fixed at 176, and there's no way to change these right now.) Niffiwan, I know you had a font.tbl patch that would remedy this; have you forgotten about it?

EDIT: I reported the first issue here (http://scp.indiegames.us/mantis/view.php?id=3106) and attached a patch.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: praseodym on September 13, 2014, 02:41:23 am
Monitor set to 16:9 resolution?
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: jones34 on September 13, 2014, 08:39:50 am
Yes, my monitor is set to 16:9 resolution.

How can I adjust the messages gauge and how can I use that patch?
As I said, the problem with texts appears everywhere except the briefings, but for me only the messages are really critical.


Regards
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: praseodym on September 13, 2014, 09:19:05 am
I meant the resolution in the starter (YAL or wxlauncher).
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: jones34 on September 13, 2014, 09:25:17 am
I selected the native resolution of my monitor (1920 x 1080) in the launcher.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on September 13, 2014, 02:35:51 pm
I fixed the messages and weapons gauges; the latter's graphics had to be enlarged slightly to fit the larger font. Download and extract the following to your blueplanet2 folder:

https://www.dropbox.com/s/sw2bmd4n815x0zz/abp2-hud-font-fix.zip?dl=1 (https://www.dropbox.com/s/sw2bmd4n815x0zz/abp2-hud-font-fix.zip?dl=1)

(If any Blue Planet developers are reading this post, please review and commit this to Blue Planet 2; it will be absolutely necessary once Mantis 3106 (http://scp.indiegames.us/mantis/view.php?id=3106) is fixed.)


How can I adjust the messages gauge and how can I use that patch?
To adjust the messages gauge (or any gauge, for that matter), you would need to extract the HUD table from the VP files and edit it (which I've already done for you in the link above). As for the patch that's attached here (http://scp.indiegames.us/mantis/view.php?id=3106), it can only be applied to the source code, which must then be recompiled; it's not something that can just be dropped somewhere and then take effect.

As I said, the problem with texts appears everywhere except the briefings, but for me only the messages are really critical.
Aside from the HUD, the only places where I've seen the problem occur are the ship and weapons selection screens, and the F1 overlays. The first two require a code change (and should be easy for me to fix); the last one requires tweaking the help.tbl file (which is in the FS2 VP files).
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: jones34 on September 13, 2014, 03:09:42 pm
Thanks for your help.
I did as you said an extracted the download to my blueplanet2 folder but it doesn't have any positive effect.
The only thing is that the weapons gauge now has some quite fancy stripes as seen here (https://www.dropbox.com/s/1l7h487hk30lln8/screen0002.png?dl=0) :confused:
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on September 13, 2014, 03:32:52 pm
Do you have any *-hdg.tbm files in blueplanet2\data\tables by any chance? If so, remove them.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Pacman110 on September 13, 2014, 04:01:53 pm
That's a handy little fix. Thanks for that.
But hopefully we will get the "real" 16:9 adaptable HUD for blue planet sometime in the future. Coming from regular FSO the stretched HUD of blue planet does not look very nice at all.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: jones34 on September 13, 2014, 04:10:57 pm
Removed the file I got there. Now it's working :)
Thanks again.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on September 14, 2014, 04:51:59 pm
Unfortunately, fixing that bug would cause another problem: Special characters like the arrows and the monospace 1 would disappear because there's currently no way to display special characters from any fonts other than those at indices 0 and 2. (Indices 1, 3, and 4 are fixed at 0, and index 2 is fixed at 176, and there's no way to change these right now.) Niffiwan, I know you had a font.tbl patch that would remedy this; have you forgotten about it?

I haven't forgotten about the patch, but I must admit that it had slid waaay down my list of priorities.  I've updated it to the latest trunk, now I just need to do re-test it to make sure it's all working as expected.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on September 30, 2014, 06:06:31 am
Finally, I've tested my updated patch with BP2 (half the struggle was getting fonttool working so that I could see what the special character offsets were in the BP supplied fonts). I specifically didn't use your supplied VP to fix the existing issues.  Instead I tested both with and without the following fonts.tbl.

Code: (fonts.tbl) [Select]
#Fonts

$Font: font01.vf
$Font: font02.vf
$Font: font03.vf
$Font: bg01.vf
+Language: English
+Special Character Index: 127

#End

Here's the specific areas of the HUD that the patch affects:
1) Weapon linking icons
2) Match speed icon
3) Radar Infinity range icon
4) Radar small/large contact blips

With the table these characters appear as you'd expect
Without the table there are other characters substituted in the special characters places (not a great look, but possibly better than nothing - I'm open to feedback on alternative defaults)

Lastly here's the code; if there are no comments I'll commit this in a week or so.
https://github.com/niffiwan/fs2open.github.com/compare/font-offsets
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on September 30, 2014, 01:41:08 pm
The patch looks good except for three things:

1. One of the comment blocks in parse_fonts_tbl() says this:
Code: [Select]
// is the index sane?
// realistically, it has to be less than UCHAR_MAX to fit all the special chars, but not sure how many there are for all fonts & langs
// e.g. English font03.vf has 72 special chars?
It sounds like you might be confusing accented letters for special characters. Every font that has special characters has exactly 7, and they're always contiguous and in the same order. (No, font03.vf most certainly does not have 72 special characters, nor does it have that many non-ASCII characters.)

2. For the check below that, the second half of the condition should be special_char_index > UCHAR_MAX - 6.

3. Shouldn't there be a way to specify a special character index for all languages?
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on September 30, 2014, 04:26:38 pm
Good pickups, thanks :) 

Re: 1) I'm not sure what I was on when I wrote that comment :nervous:, I'll fix 1 & 2 as you suggest. Per 3 I'll also add a way to set one special character index for all languages, probably as a "+Special Character Index:" entry after "$Font:" and before any "+Language:" entries.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on October 05, 2014, 11:13:47 pm
Finally done :)

Here's a new example table (which deliberately includes a warning), I decided to use "+Default Special Character Index:" for the font-wide setting to avoid duplicate tokens for the different info.

Code: (fonts.tbl) [Select]
#Fonts

$Font: font01.vf
$Font: font02.vf
$Font: font03.vf
$Font: bg01.vf
+Default Special Character Index: 127
+Language: English
+Language: Latin
+Special Character Index: 12

#End

Code is at the same link as before: https://github.com/niffiwan/fs2open.github.com/compare/font-offsets

Let me know what you think.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on October 06, 2014, 01:38:29 am
It looks like +Default Special Character Index applies only to languages that are listed below that don't have their own index (so in your example, it would apply to English and nothing else). You should also have it apply to languages that aren't listed.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on October 15, 2014, 10:35:58 pm
I've finally got around to fixing that issue with the Default Special Character Index.  Here's the table I used for testing; the commented out sections should show the sorts of settings I was testing:

Code: (fonts.tbl) [Select]
#Fonts

$Font: font01.vf
$Font: font02.vf
$Font: font03.vf
$Font: bg01.vf
;+Default Special Character Index: 127
;+Language: English
;+Special Character Index: 126
+Language: Latin
+Special Character Index: 12

#End

Code is still at the same place - what do you think now? :)
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on October 16, 2014, 02:47:34 am
Looks better. There's one more thing that I suggest doing: If a language entry lacks a special character index and no default is explicitly specified, then no special character index (not even 0) should be assigned for that language (in other words, it should be left alone). This will make fonts.tbl parsing more robust in case more language-specific parameters are added to that table in the future.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on October 17, 2014, 03:11:09 am
Another good point, the defaults in Lcl_builtin_languages should be left alone if no special character indexes are specified. I've updated the code again, how does it look now?
https://github.com/niffiwan/fs2open.github.com/compare/font-offsets
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: Yarn on October 17, 2014, 01:32:55 pm
I'd put a continue statement in the if statement that checks the value of lang_idx. Other than that, it looks good.
Title: Re: Wrong font size in HUD / lines of text are to close to each other
Post by: niffiwan on October 19, 2014, 03:34:14 am
Thanks for all your help with this - committed in r11151.