A Fallout 3 and New Vegas mod that greatly improves the user interface without compromising the original style.

Forum Thread
  Posts  
Fix for an empty line inserted in strings whose length is close to wrapwidth. (Games : Fallout: New Vegas : Mods : Vanilla UI Plus : Forum : Support & Feedback : Fix for an empty line inserted in strings whose length is close to wrapwidth.) Locked
Thread Options
Nov 11 2018 Anchor

I'm currently adapting inventories to work with smaller monofonto size ( 28 ) rendered with DC Font Generator and I run into same issue.

So what tweaks to the font map were necessary, what is the cause of the problem ?

Nov 11 2018 Anchor

There are two issues with fonts created by this, otherwise excellent, utility:

1) The generated space character has the wrong dimensions. This is what causing the wrapping bug.

To fix this problem, you need to open your font at DCFG and at the adjust tab type at the From field the hexadecimal code 20. This is the space character. You'll find that a tiny red dot has appeared in your character set. Here is mine:

DC Font Generator space characte

Now look at, my space character; it has a modified left space of -0.3 instead of whatever it was. I didn't change right space. I might have changed view width, but I don't remember. You should apply the same edits to left space and see if it works.

This is done by clicking on the Left Spacing radio button, set the increment to 0.1 and click the Minus sign. Move your mouse over that red dot to make sure your changes have been applied. Save your font, don't close the DC Font Generator, run the game and see if it works. Test various wrapwidths. The quest names and stages at the Pip-Boy are good test subjects.

For VUI+, I opened the container_menu and changed the width of CM_Items_InventoryList to a smaller value to force a near-wrapwidth for more items. I then picked up all items from my stash and presto, I had a great sample. I kept editing the font and testing various wrapwidths at the container menu.

Now we can move to the second problem

2) Fonts created by the DC Font Generator are missing the carriage return character. This is causing a weird positioning bug on centered strings that start with an empty line.

To deal with this problem, I must ask you to install VUI+ without Original Fonts and use your own version of Monofonto_Large (replace my font mapping at the Textures\Fonts folder). Then install JSawyer Ultimate Edition - GRA Merged (no need to install anything else, this is stand alone). Get a Katana and its 3 mods. Go to the mod menu and you'll see that in 2 out of 3 mods the description is moved to the far right of the screen.

Post a screenshot of this menu here (please use ModDB's internal images, online image upload services suck) and we can continue this tutorial.

Nov 12 2018 Anchor

After few hours of trying I didn't have any luck eliminating empty line wrap. I've downloaded 100% completion save and on the list of quest stages and I've spotted at least one instance of empty line with classic font from VUI+, so it's not completely eliminated. On my font I was fluctuating between 5 - 8 instances, places were also changing, so it's maybe more about line lenght change than anything with a space char ?

As for the second issue I couldn't replicate it with my font, maybe describe what the issue and solution was without example.


Nov 12 2018 Anchor

Send me your font, I'll try to fix it myself.

Nov 12 2018 Anchor

I don't want you to waste your time, I've come to conclusion that default font size is fine. I'll maybe only change all instances of font 1 to either default font 2, or 3 and will leave small font 1 for on HUD display mods like oHUD, loot menu, PPA, etc.

Nothing to send: true type monofonto ( downloaded from dafont.com ), size 28, I was using 2 points glow for font1 and no glow for font 2.

Thank you for your time and excellent work on VUI+


Edited by: waleriusz

Nov 18 2018 Anchor

Axonis, I followed your advice about the fine tuning with the left and right spacing settings with DCFG and I get rid of all the carrier return glitches I could find at the whole pip-boy lettering.

So I want to join in the conversation and ask about how to fix this, heh:

User Posted Image

Nov 19 2018 Anchor

This issue almost got me ripping the Original Fonts option out of Vanilla UI Plus because I felt that 3rd party fonts could have serious unforeseen issues. Thankfully, before doing so I opened the GRA plugin with FNVedit and noticed that the related entry had a leftover carriage return in its beginning.

Then I typed 0D (which is the hex code for carriage return) at the relevant field in DCFG and noticed that my custom font didn’t have this character. So I opened both my font and the original one with PSPad (which switches to a hex editor when opening binary files) and it became certain that DCGF would not create maps for control characters.

As you can see here, there are missing characters:

DCFG Fonts Hex Comparison

So, while at PSPpad I first copied all lines from 0030 to 07E0 from the original font to the clipboard, then I selected the same binary area on the custom font, and pasted them. Selection was necessary to avoid adding bytes instead of replacing them.

I then opened by font at DCFG, rendered it once more for good measure and 0D was now present. After saving the font at DCFG I noticed that my control characters would now have some extra information that wasn’t present at the original maps, (I guess DCFG is adding default metrics to all characters that don’t have them).

I tested again with the Katana mod, and it was a win :)

Nov 19 2018 Anchor

Man, I couldn't feel more grateful towards you right now. Thanks for the hints, I'm putting your name on the credits for the mod. Now I got to fix all my other fonts to release them without this issue.

User Posted Image

Dec 22 2018 Anchor

I've abadonned smaller monofonto, because emptybell's callifornia is more space efficient and readable at smaller size. But the smaller size is wasted on vanilla line spacing. Could you add vertical spacing for barter,container,recipe,inventory,map,stats scrollable lists adjustment to fonts.xml ? All menus can use the same setting. Also make line height to be calculated as font height + vertcal spacing ? Here is an example how it can look with emptybell's smaller fonts ( 15 lines and there is still a space for companion bark, it's zipped to install/uninstall with mod manager ): 'deleted link'

Another idea, I hate these "floating" scrollable lists that break illusion of an old text interface. With emptybell's fonts and without sorter prefixes inventory lists never wrap and with properly adjusted display height the lines stay in place when you scroll. I've tried to adjust vertical spacing same as spacing on wrapped lines but it seems that scroll tick is calculated from list height / number of items, so the moment even one line wrap list starts to "float". Would it be possible to make scroll tick always equal font height + vertical spacing ?

Edited by: waleriusz

Dec 22 2018 Anchor

The major selling point of the font metrics feature is that you can use any font you like without having to rewrite the entire user interface. For example, your edits don't look nice with the standard fonts:

short vertical spacing 1

and aside from the subjective factor, it would make wrapped lines almost impossible to distinguish from each other:

short vertical spacing 2

In the example above, Bottle Cap (52) looks almost as it is a separate item. That will look even worse with the California fonts.

If you'd suggest that I adjust vertical spacing based on font height I can consider that but I have even better news:

The reason Emptybell's fonts have such a large line height is that they include certain very high characters that are not used in the original game's fonts. The game calculates a font's height based on the tallest character in the set.

It's possible to fix this problem, if Emptybell considers it a problem, by removing those useless characters using the DC Font Generator and I can provide easy directions to do so. So, Emptybell if you're reading this, let me know.

I don't think I understand your 2nd point.

Dec 22 2018 Anchor

Use 15 lines in settings.xml and callifornia font and you'll get the look and behaviour I've intended, but I was not suggesting you should change the font, or line spacing in your mod at all. I was suggesting to just provide two additional variables for an end user to adjust spacing to their liking like I did for myself. It's just a feature idea not a request to change how VUI+ looks by default.

It's only an example of how it could potentially be adjusted, if such option was available, user could just set spacing: 8, font height: 27, lines: 15 to get same result.

Edit:

First idea should be like 10 - 15 lines of very basic code edits, nothing compared to what you've already done for 3rd party fonts support. I just don't know xml to do it myself, that's why I've only adjusted constants in the code to show example.

As for the second point:

If the item lines don't wrap, the text lines keep position when you scroll the list. When any text on the list wrap, scroll tick increases and lines of text starts to "float upward" when you scroll them. I've asked if you, if it's possible to change this behaviour, so the scroll tick doesn't change when texts on the list get wrapped. Probably it's hardcoded behavior and there is nothing you can do about it.

Edited by: waleriusz

Dec 23 2018 Anchor

Both your points are related to each other.

Yes, I can make a VUI+ vertical spacing trait at globals xml and allow font mods to optionally override it at fonts.xml. Then I can use this trait to adjust the vertical spacing in lists. It doesn't sound difficult but if one wishes to achieve the level of quality I've set for my mod, things can become really complicated.

The skills list for example is using a very small vertical spacing to allow all 13 skills to fit into the Pip-Boy. To correctly calculate vertical spacing for this list I would have to take into account the height of the font and the ability to fit 13 (or even better 14 for TTW) items there. Then I could properly define a good vertical spacing that would allow skills to look nice and not too dense.

But the main issue I have with your suggestion is that a vertical spacing will not solve the problem of font height I've mentioned in my screenshot. You assume that names never wrap, but that's only true for the level-up and skill lists. Item, quests and notes lists do have very long names that wrap no matter how narrow your fonts will be. And the only solution for this issue is to reduce any redundant font height from the font itself instead of working with vertical spacing.

Your 2nd point is related to the issue. In VUI+ I've made sure that all list heights are multiples of unwrapped list items. This is what makes them look perfectly sized and it also allows for this effect you're mentioning, when none of their items wrap. To apply this sort of fine tuning to a variable vertical spacing would require even more edits everywhere. That would overcomplicate the code of my mod and it would make it impossible for any other author to edit. I want my mod to be studied and extended by other authors, so I'd rather avoid such complicated edits.

To make my point clear: probably yes for vertical spacing, no for precise list height edits.

Dec 23 2018 Anchor

So, I've made it: *deleted link* , fonts.xml to use with callifornia font: *deleted link*

fonts.xml has two font height variables for pibboy and container type menus, they're not supposed to be edited by an end user. settings.xml has two more variables to adjust spacing for pipboy and container type menus. Everything else adjusts itself.

Could you point me all files, that are relevant to this scroll behaviour ? I'd like to take a look at it.

Edit: Fixed mediafire link

Edited by: waleriusz

Dec 23 2018 Anchor

List height is defined by the height of the list_box.xml (not list_box_template) element(s) in a menu.

To make it look in the way you want, set its height to a multiple of the list item height. List item height =

<copy src="globals" trait="_VUI+FontH_2" />
<add> 14 </add>

Where 14 is the vertical spacing of the list_item_template you wish to modify.

All files? That's every menu that has a list, eg. the level up menus, container based, repair services, pip-boy menus etc.

Dec 23 2018 Anchor

Adjustable spacing is already done and working check the first link in the previous post.

I've just updated the link in the previous post in case you've managed to download a zip with a wrong work in progress files. I was very distracted by outside forces when working on it ;) Tell me what you think.

So you say FontHeight variable I've added, can be replaced with _VUI+FontH_2 ? I'l check this out.

As for the question, I've meant files relevant to scroll tick increasing with wrapping lines.

Edited by: waleriusz

Dec 23 2018 Anchor

I couldn't download your file before, the link didn't work. I can now.

No. Your font height variable is not used by the engine. The engine considers the height of list elements using the formula I've provided you above. _VUI+FontH_ is essential to what you wish to achieve and the number 2 is due to all lists in the game using font #2. FontH is calculated based on the font's real height at globals.xml.

Please create a new thread for this discussion. This one was made for a different purpose.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.