.style point to the data of the inline style only, and not from the stylesheet. fontSize is probably not set in the inline style on the element itself.
Use .resolvedStyle instead, after that the stylesheet have been resolved, to get the value that will be used to display the element.
Hey there, thanks for reply. The value using label.resolvedStyle.fontSize is also zero.
Just to ensure I’m targeting the correct elements, I can print the name of the label and any other property I’ve set in UI Builder (such as the data key, tooltips, text, etc) - so I have validated that I am targeting the correct element.
As a test, I also manually set the font-size for a couple of these headers to a ridiculous value like 500px in UI Builder.
For the headers that I’ve manually set to 500px (through UI Builder), resolvedStyle returns 500
Ah I see why it wasn’t working now. I was printing it out as a test case to see if I could calculate the value to resize the font if the screen resolution changed. But since I was printing out the value on Start (before the updates happen) that’s why my value was 0, and I just didn’t make that logical connection because I was printing out the other properties on Start, and receiving the correct values from them.
Solved: resolvedStyle is working as intended if used in any event call after updates have been performed.