#GitHub - noaccessl/glua-VisualCharacterH...

1 messages · Page 1 of 1 (latest)

teal wadi
#

I wonder if it would be faster to cache individual character sizes for each font and use those to determine the height of a given string

#

There may also be potential in keeping track of which character is the tallest for each font, then simply checking if the string contains that character. If it does you can just return that character's height instead of checking each character in the string

#

I'm generally assuming that the most expensive part of this process is always capturing the pixels and iterating over them

timber orchid
#

this is 100% supported in my imgui-lua + gmod backend impl. i even ported stb_truetype. it's quite sad that gmod provides little support for fonts in terms lua api

fleet prairie
fleet prairie
fleet prairie
#

Also, without cache it was dropping fps significantly if called every frame plus multiple times.

#

So at this point the current solution is quite optimal and broadly suitable, in my view. One should have some resourcefulness.

teal wadi
#

If you prefer to leave the optimization to users that’s reasonable, but I think complexity is not the issue