App
App copied to clipboard
[$1000] Italics is trimming the text from right side
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Open any chat
- Type something in a different language (eg: हैलौ)
- Send it normally and then send it in italics
Expected results:
text should be rendered completely
Actual results:
text trimmed from right
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [x] Android / native
- [ ] Android / Chrome
- [ ] iOS / native
- [ ] iOS / Safari
- [ ] MacOS / Chrome / Safari
- [ ] MacOS / Desktop
Version Number: 1.3.1 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/43996225/232652535-a645e101-880e-4c81-a8b3-ab588ae71994.mp4


Expensify/Expensify Issue URL: Issue reported by: @chiragxarora Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681719422937499 View all open jobs on GitHub
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~012c31dd93569c6a66
- Upwork Job ID: 1649042299370901504
- Last Price Increase: 2023-04-27
Triggered auto assignment to @slafortune (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Bug0 Triage Checklist (Main S/O)
- [x] This "bug" occurs on a supported platform (ensure
Platforms
in OP are ✅) - [x] This bug is not a duplicate report (check E/App issues and #expensify-bugs)
- If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
- [x] This bug is reproducible using the reproduction steps in the OP. S/O
- If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
- If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
- [x] This issue is filled out as thoroughly and clearly as possible
- Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
- [x] I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
Looks good!
Job added to Upwork: https://www.upwork.com/jobs/~012c31dd93569c6a66
Current assignee @slafortune is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External
)
Triggered auto assignment to @AndrewGable (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
The Expensify Neue
family of fonts does not include hindi language characters.
On iOS if the font does not support the character it seems like the OS falls back to a font which supports the character. In this case the font falls back to a non-italic one.
On Android it looks like the OS tries to render an oblique/faux italic
style if the font does not support an italic character. Hence the trimmed text on Android.
ExpensifyNeue
Android | iOS |
---|---|
![]() |
![]() |
For instance this is how Poppins
, which support italic hindi language characters render.
Poppins
Android | iOS |
---|---|
![]() |
![]() |
The hacky solution seems to be adding an NBSP to the end of the string on Android but this will potentially break on multiline texts.
📣 @peterlazar1993! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01ea98e1bac7222f62
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Hi @peterlazar1993 , problem is not with the fonts not being supported, because the similar issue is seen with uppercase W's too. Author hasn't included that image so I'll do that for you.
Problem is with letters going outwards from upper right corner.
@chiragxarora Thank you for clarifying, you are right. The issue is in general with italic text that is wide.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In chat, text in italics is trimmed at the end of the string
What is the root cause of that problem?
I beleive the root cause of the problem is the underlying native Text component which does not account for the right width for slanting characters. For eg. iOS, Android
What changes do you think we should make in order to solve the problem?
The idea is to give a larger width to the Text component than the rendered length.
The formatted text(bold, italics) is rendered using react-native-render-html
which in turn creates View
and Text
elements. By allowing the container View
element to flex to full width, the Text
can extend beyond the rendered width.
Results
Before | After |
---|---|
![]() |
![]() |
@AndrewGable, @slafortune, @rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!
@AndrewGable, @slafortune, @rushatgabhane Huh... This is 4 days overdue. Who can take care of this?
what issss this issue. @peterlazar1993 @chiragxarora sorry, I don't understand the root cause of this issue. Could you please elaborate on the exact root cause of this issue? Thanks 🙇
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Still waiting on more context in proposals as https://github.com/Expensify/App/issues/17553#issuecomment-1523559722 mentions
@AndrewGable @slafortune @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@AndrewGable @slafortune @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Still waiting more proposals
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@AndrewGable, @slafortune, @rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Bumped on slack for proposals https://expensify.slack.com/archives/C01GTK53T8Q/p1683611957463039
Proposal
Please re-state the problem that we are trying to solve in this issue.
In the chat report, italics text is being clipped on the right hand side.
What is the root cause of that problem?
There is an issue on Android where text that does not have a truetype italics variant gets clipped at the right hand side due to the measured width of TextView
widget. The measured width tends to be calculated during rendering of a native control. There is a StackOverflow question from over 12 years ago where this is properly detailed.
What changes do you think we should make in order to solve the problem?
There are a few ways to solve the problem.
- Fix: Use a font that has an italics variant (Source).
-
Fix: Create a custom widget based on the TextView widget and override the
onMeasure
method to increase the width of the control. This would require changes to upstream React Native. - Hack: Add the Unicode hairspace character to the end of the string ( )
What alternative solutions did you explore? (Optional)
None.
@AndrewGable @slafortune @rushatgabhane this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
@AndrewGable, @slafortune, @rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!
@rushatgabhane @AndrewGable do you think we need more proposals?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸