Closed Bug 577707 Opened 12 years ago Closed 12 years ago

Oriya and Kannada are rendered as single character

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+
status2.0 --- ?

People

(Reporter: stas, Assigned: jfkthame)

Details

Attachments

(6 files)

On current trunk (4.0b2pre) pages in Oriya and Kannada are rendered with one character. For Oriya it's "7", for Kannada it's ":" (colon).

The issue doesn't occur in Firefox 3.6.
Attached image kn_IN Screenshot
Attached image or_IN Screenshot FF4
blocking2.0: --- → ?
Assignee: smontagu → nobody
Component: Internationalization → Layout: Text
QA Contact: i18n → layout.fonts-and-text
blocking2.0: ? → betaN+
Assignee: nobody → jfkthame
I've also seen this problem with Telugu. The issue is that we choose an incorrect font that does not actually support the character range in question, and then try to render using this font (where all characters end up mapping to some arbitrary glyph) in place of a more appropriate one, or in place of missing-glyph hexboxes in the case where no available font actually supports the script.

The bug is caused by an error in gfxSparseBitSet::ClearRange, which is supposed to be used to "mask off" ranges that require complex shaping if the necessary font tables are not present. Unfortunately, when ClearRange decides it needs to clear an entire block of the bitset, and the block in question does not exist, it creates a block with all bits set to 1 instead of 0, and so we end up believing that entire blocks of characters ARE supported when they shouldn't be.

The minimal fix would be to create such blocks zero-filled instead of 1-filled, but actually we can simplify the code further and not create them at all, as "missing" blocks in gfxSparseBitSet are implicitly all zeroes anyway.
Attachment #477103 - Flags: review?(jdaggett)
We need a testcase of some sort here, or at least a page that somehow shows the problem.

At first glance I don't see what the problem with the semantics of the bitset are, what does a block of cleared bits show you that an omitted block doesn't?  And isn't the code the same in FF3.6, why does this explain the problem in FF4?
Test case for those locales is Wikipedia

Kannada: http://kn.wikipedia.org/
Telugu: http://te.wikipedia.org/
Oriya: http://te.wikipedia.org/

with Firefox 3.6.x - it is shown as square Box, attaching Screenshot
(In reply to comment #6)
> Created attachment 478702 [details]
> Kannada Screenshot of Wikipedia with FF3.6

Could you reattach these, bugzilla is complaining that there are errors with these files.
(In reply to comment #5)
> Test case for those locales is Wikipedia
> 
> Kannada: http://kn.wikipedia.org/
> Telugu: http://te.wikipedia.org/
> Oriya: http://te.wikipedia.org/
> 
> with Firefox 3.6.x - it is shown as square Box, attaching Screenshot

Right, these pages show up as boxes in 3.6 or trunk.  The original description has "the issue doesn't occur in Firefox 3.6".

If possible, a very simple testcase that includes a downloadable font would be a huge help here.
Attachment #478703 - Attachment mime type: image/png → image/tiff
Attachment #478702 - Attachment mime type: image/png → image/tiff
(In reply to comment #8)
> (In reply to comment #6)
> > Created attachment 478702 [details] [details]
> > Kannada Screenshot of Wikipedia with FF3.6
> 
> Could you reattach these, bugzilla is complaining that there are errors with
> these files.

my mistake, those are tiff files, tried to update.
> > with Firefox 3.6.x - it is shown as square Box, attaching Screenshot
> 
> Right, these pages show up as boxes in 3.6 or trunk.  The original description
> has "the issue doesn't occur in Firefox 3.6".
> 
> If possible, a very simple testcase that includes a downloadable font would be
> a huge help here.

Telugu Fonts: http://web.nickshanks.com/fonts/telugu/

http://utrrs.org/web/lang/te_IN/font/IndicFontTestCaseCodepoint-Telugu.html
(In reply to comment #9)
 
> > Kannada: http://kn.wikipedia.org/
> > Telugu: http://te.wikipedia.org/
> > Oriya: http://te.wikipedia.org/

> Right, these pages show up as boxes in 3.6 or trunk.  The original description
> has "the issue doesn't occur in Firefox 3.6".

on 10.6

Kannada: http://kn.wikipedia.org/ renders every character as ':' on Gecko 2.0; Gecko 1.9.2 displays the expected boxes.
I tried the page with the Kedage font installed, but it doesn't render correctly (gibberish), differently on 1.9.2 vs 2.0 but both incorrect, and incorrect in WebKit as well.
(Kedage font gives validation errors on 10.6
http://web.nickshanks.com/fonts/kannada/)

Telugu: http://te.wikipedia.org/ renders fine I think, but I have Pothan installed.

Oriya: http://or.wikipedia.org/ renders a '7' on trunk, boxes on 1.9.2
Attached image screenshot - 10.6
as described in comment 12.
in the background: Camino nightly (Gecko 1.9.2), in front, 2 Minefield windows with Kannada and Oriya wikipedia pages.

Interestingly, I just tested those pages under a different, freshly created OS X user account. There both pages render with boxes with the same Minefield build.
Comment on attachment 477103 [details] [diff] [review]
patch, v1 - fix the clear methods in gfxSparseBitSet

Sorry, don't know what I was smoking this morning.  This patch is correct/better.

Still need a real testcase with steps to reproduce.  Safari shows the testpages fine which indicates we're picking up a local font that is tripped up by the incorrect clear/ClearRange code.  I imagine it should be fairly easy to find a font the reproduces the problem.
Attachment #477103 - Flags: review?(jdaggett) → review+
Whiteboard: [needs landing]
(In reply to comment #14)
> Still need a real testcase with steps to reproduce.  Safari shows the testpages
> fine which indicates we're picking up a local font that is tripped up by the
> incorrect clear/ClearRange code.  I imagine it should be fairly easy to find a
> font the reproduces the problem.

On my system, it was caused by Mangal, the OpenType Devanagari font that is (or was) distributed as a sample with Microsoft's VOLT tool. More or less any OT Devanagari font could well trigger the issue, as their character coverage will include the 09xx block, plus some punctuation characters from the 20xx block, so they'll have lots of empty blocks covering the other Indic scripts.

Whether a user will actually see the problem depends on whether they've got another font that really DOES cover the range in question, and which font is found first during the fallback search.
http://hg.mozilla.org/mozilla-central/rev/a95f2ec69e51
Status: NEW → RESOLVED
Closed: 12 years ago
status2.0: --- → ?
Resolution: --- → FIXED
Whiteboard: [needs landing]
I have seen square boxes (instead of : or 7 or 9). It is fixed. tested build 4.0b8pre
You need to log in before you can comment on or make changes to this bug.