We have a custom implementation for underlining text, and the logic involves checking for a range of glyphs in strings. For text with special glyphs (e.g. Arabic language), this range is sometimes out of the bound of the text (I have yet to find an exact explanation for this).
The fix is to fall back to using the default implementation if we detect that a glyph range is invalid.
Testing steps
Run the demo app
Open the content Underline NBSP
Check that underlines are drawn correctly and the app doesn't crash.
[x] I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.
Fixes https://github.com/woocommerce/woocommerce-ios/issues/11866
Description
We have a custom implementation for underlining text, and the logic involves checking for a range of glyphs in strings. For text with special glyphs (e.g. Arabic language), this range is sometimes out of the bound of the text (I have yet to find an exact explanation for this).
The fix is to fall back to using the default implementation if we detect that a glyph range is invalid.
Testing steps
CHANGELOG.md
if necessary.