Page 1 of 1

Extending TextWidth()

Posted: Wed Sep 08, 2021 7:48 pm
by Allanon
Hello :)
If it is possible I'd like to have an additional parameter to exclude from the returned size any formatting tags, I've some custom functions for this job but parsing many strings results in a general slowdown, an inbuilt function could help a lot :)

For example, if I have to manually position a string like this:

Code: Select all

[B][COLOR=$FF0000]Hello World![/COLOR][/B]
I need to get the size of "Hello World!" and not of the entire string, so I've to run a custom function to strip all the formatting tags before getting the size I need.

Re: Extending TextWidth()

Posted: Fri Sep 10, 2021 11:55 pm
by airsoftsoftwair
Have you tried PatternReplaceStr()?

Re: Extending TextWidth()

Posted: Thu Sep 16, 2021 8:48 am
by Allanon
I've tried it: it worked great :)
Thanks for the tip!