-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profile text displayed right to left but correct on web #3294
Comments
The account is https://mastodon.social/api/v1/accounts/109354069933492315, if you pull that and look at the bytes for the profile info you get:
If you paste the text in to an editor that supports bidirectionality (e.g., Android Studio) and run the cursor through the name text you'll see a marker at the top of the cursor swap direction as you move through the text. The sword emoji is I thought this might be https://www.w3.org/International/articles/inline-bidi-markup/#nomarkup, but it doesn't look like there's embedded unicode to change the directionality of the text, it's the individual "letters" themselves. https://www.babelstone.co.uk/Unicode/whatisit.html seems to confirm that, reporting:
Hebrew is written right-to-left (unlike Cherokee). Given https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection and other references in the docs I think Android is seeing the first Hebrew character as having a strong text direction (right to left) and is using that for the rest of the text. It might be possible to work around this. |
Spot checked Megalodon and Fedilab, they handle this correctly, so there is something that can be done. |
The profile page has changed since I submitted this issue, so here is a link to a post with the same characters if you need it: |
Yeah, I can duplicate this on my profile page. That should be enough to debug some more. |
I think I've tracked this down.
Per https://developer.android.com/reference/android/view/View.html#attr_android:textDirection this will set the text direction like so:
This was added in #964. The discussion on that PR has these two comments: @charlag: Didn't we have this discussion at #878 and decided against anyRTL? @connyduck: yes but #878 was about user generated content and this is about our interface (or am I missing something?) If that (setting That's the private note, the account bio, and the titles/content of the account fields. I'll prep a PR that does that for further discussion. |
`activity_account` sets the root text direction to `anyRtl`. This is OK for UI elements, but can be a problem for user generated content (UGC) that may contain bidirectional text. Fix this by explicitly restoring the default behaviour, `firstStrong`, on views in `activity_account` that can show UGC. Fixes #3294
The profile text for https://mastodon.social/dungeons changes based on the current character. At the moment the profile in website looks like this:
But it appears in Tusky like this:
The timeline posts mentioning this character also appear using right to left text:
Tusky Version: 21.0
Android Version: 12
Android Device: Galaxy S10
Mastodon instance (if applicable):
I searched or browsed the repo’s other issues to ensure this is not a duplicate.
The text was updated successfully, but these errors were encountered: