Fonts of different weights in the same text box?

Posts: 100
Hi all,

One thing I'd like to do is have varying font weights within a text box.

Kyle Heyer

Something like that. Is this a feature that could be added? Or can it already be achieved somehow with dynamic text box widths?

Thanks!
Posts: 785
It is not possible with a single Label, but it should be possible using the various layout options that I added specifically for this reason. However when I just tested it did not work anymore, maybe I broke it somehow... I will check it out this evening.

Basically what you need is:

- A SubWidget with two Labels, one for the first name and one for last name
- Give the first label and second label different font weight
- Enable the "Autosize" option for at least the first label. This way - it should automatically scale by its contents and put the second label next to it. (This seems to be broken currently)
- In the SubWidget set the Child Layout to StackedHorizontal - this should place the labels next to each other

You can try to play around with it to see if you can get it to work, I only had a few minutes. I will investigate this evening if there is something I need to fix.
Edited (1 time)
Posts: 100
Nick Thissen wrote:
It is not possible with a single Label, but it should be possible using the various layout options that I added specifically for this reason. However when I just tested it did not work anymore, maybe I broke it somehow... I will check it out this evening.

Basically what you need is:

- A SubWidget with two Labels, one for the first name and one for last name
- Give the first label and second label different font weight
- Enable the "Autosize" option for at least the first label. This way - it should automatically scale by its contents and put the second label next to it. (This seems to be broken currently)
- In the SubWidget set the Child Layout to StackedHorizontal - this should place the labels next to each other

You can try to play around with it to see if you can get it to work, I only had a few minutes. I will investigate this evening if there is something I need to fix.


It does seem to be working incorrectly. Hm. Is there a way to assign weight based on the databinding within the same label? And while we're on that - adjustable kearning would be really neat. Probably getting out of the scope of what's reasonable.

Kyle
Posts: 785
I seem to have broken it back when I added support for opacity masks. I looked into it but did not find a solution yet unfortunately. I'll keep looking.

There is no way to set different weights currently, but I can perhaps also look into that. The whole layout system is overly complicated for this common usecase. I will look into that as a simpler solution.

Adjustable kerning seems like it's not possible, sorry.

Posts: 100
Nick Thissen wrote:
I seem to have broken it back when I added support for opacity masks. I looked into it but did not find a solution yet unfortunately. I'll keep looking.

There is no way to set different weights currently, but I can perhaps also look into that. The whole layout system is overly complicated for this common usecase. I will look into that as a simpler solution.

Adjustable kerning seems like it's not possible, sorry.


Kerning is probably the least of my worries - the weights would be great though. Thanks Nick! It'd be great to set some text properties per databinding. Always using a heavy weight for last name, etc.

Kyle
Posts: 785
Hi Kyle,

I believed I have fixed the "Auto size" and layout issue so you should be able to use the approach I mentioned at the top. However I am not quite sure if this is without unintended side effects, so I will be releasing it on alpha first. I know you had some issues with videos on that build previously so just wanted to give you a headsup.

I will most likely release it either this evening or tomorrow.
Posts: 100
Nick Thissen wrote:
Hi Kyle,

I believed I have fixed the "Auto size" and layout issue so you should be able to use the approach I mentioned at the top. However I am not quite sure if this is without unintended side effects, so I will be releasing it on alpha first. I know you had some issues with videos on that build previously so just wanted to give you a headsup.

I will most likely release it either this evening or tomorrow.

Thanks for the heads up! I switched all my videos to a different format when that issue happened and this new build doesn't seem to spit out any weird behavior there. The text request is part of a generational change in my overlays so I will be building those labels in from scratch - might take me a bit to get around to it but I will let you know if I notice anything odd. Thanks!
Posts: 100
This feature seems to be working as intended from my testing, thanks for the fix.

One small thing that I can't figure out though - I've got two side-by-side labels and would like to stack them from the right to the left, meaning, I want them to be right justified. Messing with both the labels and the subwidget they seem stuck on the left. Am I doing something wrong?

Kyle
Posts: 785
I think you can use the Dock layout for that:

- SubWidget "Child Layout" property: Dock
- Label "Dock" property: Right

You may have to play with the order (Z-index) of the labels to get them in the right order.
Posts: 100
Nick Thissen wrote:
I think you can use the Dock layout for that:

- SubWidget "Child Layout" property: Dock
- Label "Dock" property: Right

You may have to play with the order (Z-index) of the labels to get them in the right order.

Lovely, that did it. I didn't have the Subwidget Child Layout set properly. As always, thanks.