Closed Bug 188759 Opened 22 years ago Closed 22 years ago

right-margin problems of justified Arabic text (all fonts)

Categories

(Core :: Layout: Text and Fonts, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.4alpha

People

(Reporter: neokuwait, Assigned: smontagu)

References

()

Details

(Keywords: regression)

Attachments

(6 files)

This happened after bug 187866 was fixed and it's not reproducible in build 20030106 (or any post bug 131023 build) TO REPRODUCE: 1. Go to URL 2. Ctrl+A to select all text (just for clarity) 3. look at the third paragraph ACTUAL: miss-aligned right margins on some lines. EXPECTED: even margins
WFM. 2003011204 / XP. The lines are all evenly right-aligned. Unless I don't understand the report.
The same for me. (2003011204 on Win2k) You mean it worked from December until a few days ago? What build are you using? Did the page change?
Attached image Screenshot
Here is a screenshot of the problem on build 2003011208.
Still WFM with the 1208 build under XP. I do not see what's shown in the screenshot - everything lines up evenly at the right. Reporter: Did you do a completely clean install of Mozilla and create a new profile to test this with?
Attached file Reduced testcase
On Win2K I can always reproduce the bug with this testcase. If the error doesn't appear on initial load, it can be made to appear by making the window wider or narrower. It seems to be always in the line containing the word ÃáÇ (alef hamza, lamalef shadda). If the bug doesn't appear on XP, it's possibly a bug in the measuring routines in Windows which was corrected between 2000 and XP.
Both lines should look the same, with the whole word appearing on a yellow background
OK, the difference is not between W2K and XP but between Windows systems with and without Arabic support installed. This screenshot is from XP with "support for complex scripts and right-to-left languages" installed and is the same as on my W2K machine.
The nearest to a correct rendering, by the way, is the top example in attachment 113818.
Status: NEW → ASSIGNED
Both text frames in the attachment are given the correct width in nsTextFrame::Reflow, but by the time we get to nsTextFrame::Paint, the mRect.width of the justified frame is too small. What could be changing it?
My last comment was not very accurate. The justified frame is measured incorrectly because of a bug in nsTextTransformer::GetNextWord. After shaping the Arabic text and converting lam + alef to a lam alef ligature (or any other transformation which makes the output length different from the input length), we should be resetting the pointer to the transformed buffer. Most of the time this was resulting mismeasurement was imperceptible (since we were measuring the correct number of characters, though not the same characters that we were rendering), but in the case here of a word containing a lam + alef and a diacritic with zero width, there was a noticeable difference.
Attached patch PatchSplinter Review
Blocks: 172683
Attachment #114055 - Flags: superreview?(rbs)
Attachment #114055 - Flags: review?(rbs)
Target Milestone: --- → mozilla1.4alpha
Comment on attachment 114055 [details] [diff] [review] Patch + mBufferPos = prevBufferPos + *aWordLenResult; Actually, this should be an invariant, right? i.e., there should be an post-condition in that function: NS_ASSERTION(mBufferPos == prevBufferPos + *aWordLenResult, "internal error");
Comment on attachment 114055 [details] [diff] [review] Patch Tested and didn't see any secondary weirdness. Please document this general invariant with the suggested assertion.
Attachment #114055 - Flags: superreview?(rbs)
Attachment #114055 - Flags: superreview+
Attachment #114055 - Flags: review?(rbs)
Attachment #114055 - Flags: review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: