Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hebrew language is messed up in Firefox, Safari #10109

Open
drehelis opened this issue Apr 22, 2024 · 3 comments
Open

Hebrew language is messed up in Firefox, Safari #10109

drehelis opened this issue Apr 22, 2024 · 3 comments
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas

Comments

@drehelis
Copy link

Are you experiencing an issue with...

shields.io

馃悶 Description

Safari (text is mirrored) -
image

Firefox -
image

However, works as expeced in Chrome, Chromium, Edge.
image

Anyway to make it work? :)

馃敆 Link to the badge

https://img.shields.io/endpoint?color=neon&style=plastic&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fsammy_ofer_notification_channel

馃挕 Possible Solution

No response

@drehelis drehelis added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Apr 22, 2024
Copy link
Contributor

Badge tested using npm run badge https://img.shields.io/endpoint?color=neon&style=plastic&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fsammy_ofer_notification_channel
Output is available here

@chris48s
Copy link
Member

Hmm.
I get the same behaviour as you. I suspect this is about what fonts are available on the client side.
If I view a badge in chromium, the badge is rendered using DejaVu Sans for me.
In firefox, it looks like it is falling back to the default sans serif font.
I wouldn't be able to test safari.
I'm not sure why the subset of fonts available to firefox is different here. Not sure if this is a browser thing, or if there is anything we can do.

@jNullj
Copy link
Collaborator

jNullj commented Apr 23, 2024

Native Hebrew speaker here, so i gave it a try.
Tested in Firefox only as i don't have Safari.

  1. Changed the font yet it did not change the issue.
  2. The text is squashed due to the textLength attribute. When the attribute is changed the text is getting spaced. Made sure both browsers default units are in px, yet i see the difference.
  3. After playing a bit with textLength i found out this! The value we use in this example is 2250. This is squashed. So i increased to make it more spaced out, which works but it was reversed regardless of the direction attribute. (4500 is a bit shorter then 2250 on chromium). Untill, i used textLength=890 then the letter order was currect and it started getting spaced out the smaller i made the textLength.
  4. I then went to test textLength in an example on mdn web docs and confirmed that this is not related to shields.io but a firefox issue. Here is a short animation to show how the mmdn docs example starts breaking once the text is hebrew instead of English. I suspect the length calculated for each letter is somehow a negative value as the 0px behavior is rendered at large values (620px~ in the example bellow).
    Video taken from this part in mdn web docs replaced the innerHtml with herbew for hello world.
Peek.2024-04-23.16-55.mp4

The text acts odd, the 0 point for textLength is about 620px and after crossing it the text is reveresed, before crossing it lower values create higher length.

edit: searched firefox for open issue on that, couldn't find one. I will look into firefox source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas
Projects
None yet
Development

No branches or pull requests

3 participants