Check if text is underline and/or strikethru and/or superscript.... and so on
Hi,
I'm trying to simplify a function that checks what of the below properties a string has:
Allcaps, Smallcaps, Superscrtipt, Subscript, Underline, Strikethrough
Some of the above properties could be in different combinations. For example, a text could be underline, strikethrough and allcaps at the same time.
Some can not be in combinations, like allcaps and smallcaps OR superscript and subscript.
What is the best approch to getting all properties that a text has?
I tried with:
1. searching for all text that is allcaps, and checking if the findings has any else of the above properties.
then
2. searching for all text that is smallcaps, and checking if the findings has any else of the above properties.
then
3. searching for all text that is superscript, and checking if the findings has any else of the above properties....
...and so on.
It kind of works, but seems like a bad solution.
It easily becomes complex. If I search for allcaps and then check for superscript and have a result, I will find the same result when starting to search for superscript (like in example 3.)
I also tried looping over textstyleranges and checking what properties the text has. It might work, but also seems too complicated...
My question is. Could anybody think of a more clever solution?
