mathjazz / pontoon

In-place localization tool
https://pontoon.mozilla.org/
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Hebrew hyphen takes no space in textarea #1169

Open mathjazz opened 5 years ago

mathjazz commented 5 years ago

This issue was created automatically by a script.

Bug 1526686

Bug Reporter: roigby@gmail.com CC: @flodolo, @ItielMaN, @mathjazz, @yarons, @tomer

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

insert the hyphen character to the pontoon textarea (unicode #1470 - https://en.wiktionary.org/wiki/־).

Actual results:

the character took no horizontal space at the textarea, resulting in no spacing between words. this is due to the "Lucida Sans Unicode" font familiy attributed to the textarea's style.

Expected results:

should have acted as a dash/hyphen (separate between adjacent words).

mathjazz commented 5 years ago

Comment Author: @flodolo

Can you attach a screenshot? I see a space between words, but I'm on macOS and it seems to use Open Sans from devtools.

mathjazz commented 5 years ago

Comment Author: roigby@gmail.com

Created attachment 9042748 dash vs. hebrew hyphen

Thanks for the quick response Attached image contains some text separated by dash on the first line (expected), and hyphens on the second line.

You can see that the hyphens exist, but take no horizontal space and thus get overriden by the next letter.

Upon inspecting the textarea style, I found out it is a by-product of the "Lucida Sans Unicode" font family.

Attached file: image.png (image/png, 607 bytes) Description: dash vs. hebrew hyphen

mathjazz commented 5 years ago

Comment Author: roigby@gmail.com

Created attachment 9042749 without lucida sans unicode

Here is the text when removing "Lucida Sans Unicode" from the textarea's font-family.

Attached file: image.png (image/png, 558 bytes) Description: without lucida sans unicode

mathjazz commented 5 years ago

Comment Author: @mathjazz

Thanks for the report, roigby!

I'm having trouble reproducing the problem. If I insert the Hebrew hyphen here, it looks like the 2nd line in attachment 9042749: https://pontoon.mozilla.org/he/firefox/browser/chrome/browser/aboutPrivateBrowsing.dtd/?string=75047

The font family in use is actually Open Sans.

Roigby, what OS do you use? I wonder if it has something to do with that, as Flod hinted.

mathjazz commented 5 years ago

Comment Author: roigby@gmail.com

Thanks Matjaz :)

I use Windows 10, and didn't have Open Sans font installed until now (So the browser fell back to "Lucida Sans Unicode"). The problem persists after installing Open Sans - probably because the font file I found does not support hebrew...

If you can help me find an Open Sans font that also supports hebrew - please let me know.

mathjazz commented 5 years ago

Comment Author: @mathjazz

Thanks Roigby.

Sadly we're still unable to reproduce the problem. Open Sans is used as a web font, which means the browser should download it and use it. All modern browsers support the feature, but just in case - what browser and browser version do you use?

Yaron, Tomer, can you perhaps reproduce the problem?

mathjazz commented 5 years ago

Comment Author: roigby@gmail.com

I run Firefox 65.0.1, but was able to reproduce the problem on another Windows machine running chrome.

It seems to be 2 problems in Windows preinstalled fonts (Open Sans not included, and Lucida Sans Unicode does not respect the "־" character).

Thanks again for your attention.

mathjazz commented 5 years ago

Comment Author: @tomer

Does this problem reproduce on sites other than Pontoon?

Are you sure you are typing the Maqaf symbol (AltGr-minus on standard Hebrew keyboard) and not Rafe (AltGr-])?

־ - Maqaf https://en.wiktionary.org/wiki/%D6%BE ֿ - Rafe https://en.wiktionary.org/wiki/%D6%BF

mathjazz commented 5 years ago

Comment Author: @ItielMaN

(In reply to Matjaz Horvat [:mathjazz] from comment #6)

Thanks Roigby.

Sadly we're still unable to reproduce the problem. Open Sans is used as a web font, which means the browser should download it and use it. All modern browsers support the feature, but just in case - what browser and browser version do you use?

Yaron, Tomer, can you perhaps reproduce the problem?

A week ago I got a new SSD and installed a clean copy of the latest Windows 10 on it (Hebrew locale). The "old" Windows was once upgraded from Windows 7, and everything works fine there. On the "new" Windows, running the same profile and (latest) Nightly version, I can see the same issue as @roigby is seeing, with a different font being used.

mathjazz commented 5 years ago

Comment Author: @tomer

Created attachment 9045022 expected result

Reduced testcase: (copy the code below to the browser location bar) data:text/html,<meta charset='utf-8'/><input type='text' value='%D7%90%D6%BE%D7%91%D6%BE%D7%92'/>

Attached file: image.png (image/png, 2993 bytes) Description: expected result

mathjazz commented 5 years ago

Comment Author: @ItielMaN

(In reply to Tomer Cohen :tomer from comment #10)

Created attachment 9045022 expected result

Reduced testcase: (copy the code below to the browser location bar) data:text/html,<meta charset='utf-8'/><input type='text' value='%D7%90%D6%BE%D7%91%D6%BE%D7%92'/>

This test case looks and works well in both old and new Windows. See attached screenshots for the fonts used on Pontoon on the old vs. new Windows.

mathjazz commented 5 years ago

Comment Author: @ItielMaN

Created attachment 9045025 Fonts used- old Windows

Attached file: Fonts used- old Windows.png (image/png, 11467 bytes) Description: Fonts used- old Windows

mathjazz commented 5 years ago

Comment Author: @ItielMaN

Created attachment 9045026 Fonts used- new Windows

Attached file: Fonts used- new Windows.png (image/png, 11975 bytes) Description: Fonts used- new Windows

mathjazz commented 5 years ago

Comment Author: @ItielMaN

fwiw it makes no difference if I check this on a new profile, on latest Nightly.

mathjazz commented 5 years ago

Comment Author: @tomer

(In reply to Itiel from comment #11)

This test case looks and works well in both old and new Windows. See attached screenshots for the fonts used on Pontoon on the old vs. new Windows.

Below is a revised testcase that request the problematic font. The problem should reproduce here.

data:text/html,<meta charset='utf-8'/><input type='text' 
value='%D7%90%D6%BE%D7%91%D6%BE%D7%92' style="font-family: 'lucida sans unicode'"/>
mathjazz commented 5 years ago

Comment Author: @ItielMaN

(In reply to Tomer Cohen :tomer from comment #15)

The problem should reproduce here.

... and it does.