Is there an official method to convert a piece of RichText (such as <b>Shop</b>
) into normal text (i.e. Shop
)?
There doesn’t appear to be any having a skim through TextService.
If that method doesn’t exist, is there a method to calculate the size of some text while ignoring all RichText tags?
Both GetTextBoundsParams(...)
and :GetTextSize(...)
fail to do this. I also want to achieve this without generating a TextLabel and using its ContentText.
Current:
print(game.TextService:GetTextSize("<b>Shop<b>", 20, Enum.Font.Arial, Vector2.new(10000, 20)).X)
→ 112
print(game.TextService:GetTextSize("Shop", 20, Enum.Font.Arial, Vector2.new(10000, 20)).X)```
→ 57
Desired:
print(game.TextService:GetTextSize("<b>Shop<b>", 20, Enum.Font.Arial, Vector2.new(10000, 20)).X)
→ 57
print(game.TextService:GetTextSize("Shop", 20, Enum.Font.Arial, Vector2.new(10000, 20)).X)
→ 57