SInhala text with zero width non-joiner (ZWNJ) doesn't render as expected

RESOLVED FIXED

Status

()

Core
Layout: Text
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: Harshana, Assigned: jfkthame)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036 Safari/532.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)

<html >
<head >

</head>

<body>
ඔෘ
<br />
ඔ‌ෘ 
</body>
</html>

Save the above to html File and Open it. the second line 2 letters should be show without o.


Reproducible: Always

Steps to Reproduce:
1.<html >
<head >

</head>

<body>
ඔෘ
<br />
ඔ‌ෘ 
</body>
</html>
2.Copy above to Html file.
3.Open it
Actual Results:  
it shows both as same in above sample.

Expected Results:  
First line should shows with o middle and second line is shouldn't show.
(Reporter)

Comment 1

7 years ago
xpected Results:  
First line should shows with o (dotted circle (U+25CC)http://www.fileformat.info/info/unicode/char/25cc/index.htm) middle and second line is shouldn't show.
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles

You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Whiteboard: [CLOSEME 2011-1-30]
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INCOMPLETE
(Reporter)

Comment 4

6 years ago
Created attachment 509030 [details]
Issue is same with FF 3.6.13

Issue is same with FF 3.6.13 with new profile in Windows 7, I'll try to find user who uses XP too

Updated

6 years ago
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Whiteboard: [CLOSEME 2011-1-30]
Version: unspecified → 3.6 Branch

Comment 5

6 years ago
Reporter -> Are you still experiencing this issue with the latest version of Firefox 5? Does the issue occur with the latest nightly? http://nightly.mozilla.org/
(Reporter)

Comment 6

6 years ago
Created attachment 542818 [details]
with FF5

still the issue is there. see the attached picture with Google chrome

Updated

6 years ago
Component: General → Layout: Text
Product: Firefox → Core
QA Contact: general → layout.fonts-and-text
Version: 3.6 Branch → 5 Branch
Summary: zero With Non-Joiner doesn't Render Properly → SInhala text with zero width non-joiner (ZWNJ) doesn't render as expected
(Assignee)

Comment 7

6 years ago
I think this may be a result of how font fallback currently operates. Does it fix the problem if you explicitly choose a Sinhala font for the relevant portion of the text? Try something like:

<body style="font-family: ">
ඔෘ
<br />
ඔ‌ෘ 
</body>
(Assignee)

Comment 8

6 years ago
(In reply to comment #7)
> <body style="font-family: ">

Oops, that should have been

  <body style="font-family: 'Iskoola Pota'">

(or whatever Sinhala font you have available).
(Reporter)

Comment 9

6 years ago
yeah, it is working when we put font family, but it is not practical.
(Assignee)

Comment 10

6 years ago
(In reply to comment #9)
> yeah, it is working when we put font family, but it is not practical.

Right, but that helps confirm the cause of the problem. I'll look into a possible patch that I think could help.
Assignee: nobody → jfkthame
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 5 Branch → Trunk
(Reporter)

Comment 11

6 years ago
(In reply to comment #10)
> (In reply to comment #9)
> > yeah, it is working when we put font family, but it is not practical.
> 
> Right, but that helps confirm the cause of the problem. I'll look into a
> possible patch that I think could help.

Thanks,
(Assignee)

Comment 12

6 years ago
Created attachment 543105 [details] [diff] [review]
patch, try to avoid breaking font runs at zwnj

The problem arises because font fallback is likely to pick a different font for the ZWNJ character than for the surrounding Sinhala characters, and this breaks shaping behavior that depends on seeing the ZWNJ as part of the same run.

The patch fixes this by "propagating" the currently-chosen font from the preceding character to ZWNJ, where possible. We don't necessarily want to propagate it from ZWNJ to the _following_ character (like we do for ZWJ, for the sake of Arabic), as that has been known to cause problems in the past (bug 534919). In the cases where it actually matters, we'll pick the same font for the preceding and following Indic letters anyway, so all that's necessary is to ensure the ZWNJ matches one of these.

Pushed to tryserver with a reftest. I'm expecting the test to fail on (most?) non-Windows platforms, as it'll be dependent on font availability and quirks of shaping engine behavior - e.g., Core Text does not insert dotted circles for "ill-formed" character sequences in the same way the Windows shaping engines do. So the test is only expected to be reliably useful for Windows at this point; I'll mark it random on other platforms, but am just curious to see the actual results first.
Attachment #543105 - Flags: review?(roc)
Comment on attachment 543105 [details] [diff] [review]
patch, try to avoid breaking font runs at zwnj

Review of attachment 543105 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #543105 - Flags: review?(roc) → review+
(Assignee)

Comment 14

6 years ago
http://hg.mozilla.org/mozilla-central/rev/9c848549aa3b
Status: NEW → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.