Closed Bug 229270 Opened 20 years ago Closed 20 years ago

[xft] non-BMP Unicode character rendering broken

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.6final

People

(Reporter: jshin1987, Assigned: jshin1987)

References

()

Details

(Keywords: intl, regression)

Attachments

(1 file)

I've just found that non-BMP (Unicode plane 1 and above) character rendering is
broken in 1.6 branch and the trunk. I went back to nsFontMetricsXft.cpp v 1.29
and went upward until I found the revision with regression. It's version 1.34
[1] for bug 223813 that broke the plane 1 rendering. I haven't yet figured out 
how it could broke the non-BMP Unicode character rendering.  

I think we have to fix this before releasing 1.6. It may not be important to
everyday use, yet, but it has a high 'geek' value. Besides, some Chinese people
may have some practical reasons for non-BMP character support (plane 2).

Tex's  page given in the URL field have links to fonts (Code2001 and other two
fonts) to install to test the demo page. Code2001 alone should be enough for
testing. 

[1]
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsFontMetricsXft.cpp&branch=&root=/cvsroot&subdir=mozilla/gfx/src/gtk&command=DIFF_FRAMESET&rev1=1.33&rev2=1.34
I figured it out. |FindFont (PRUnichar)| (that used be called only with 'a'
before 1.34) is now called with actual Unicode characters to render. PRUnichar
(16bit short) is too narrow to cover the full range of Unicode characters
(21bit). We have to use PRUint32 (or FcChar32). 
Attached patch patchSplinter Review
4-liner !
Comment on attachment 137879 [details] [diff] [review]
patch

asking for r/sr.

bryner is away so that I'm trying blizzard and dbaron.
Attachment #137879 - Flags: superreview?(dbaron)
Attachment #137879 - Flags: review?(blizzard)
FYI, gcc (and I guess the same is true of g++) doesn't warn (even with -Wall and
-pedantic) when numeric values are truncated. There's a bug filed on this at the
gcc bugzilla.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2707
Status: NEW → ASSIGNED
setting the milestone to 1.6final
Target Milestone: --- → mozilla1.6final
Attachment #137879 - Flags: superreview?(dbaron) → superreview+
Comment on attachment 137879 [details] [diff] [review]
patch

bryner, can you review? 

I'd like to get this in for 1.6 (and firebird 0.8 as well)..
Attachment #137879 - Flags: review?(blizzard) → review?(bryner)
Attachment #137879 - Flags: review?(bryner) → review+
Comment on attachment 137879 [details] [diff] [review]
patch

thanks for r/sr. fix checked into the trunk.
 asking for a1.6

This patch fixes a broken non-BMP character  (Unicode characters above U+FFFF)
rendering. It worked in 1.4 but was regressed in 1.5. With the increasing
number of non-BMP characters added to Unicode and   a few good free non-BMP
fonts available, leaving this broken in 1.6 would be  bad in terms of 'PR'
because non-BMP support is  tested frequently in 'I18N benchmarks'.

Platform : Linux/*BSD and other Unix with Xft build (not a default build)
Risk : very very low. It's  a trivial fix (number truncating error that should
have been caught by g++ but was not because of a bug in g++)

P.S bryner, can I check in this for firebird 0.8 branch as well?
Attachment #137879 - Flags: approval1.6?
Comment on attachment 137879 [details] [diff] [review]
patch

a=chofmann for 1.6
Attachment #137879 - Flags: approval1.6? → approval1.6+
Comment on attachment 137879 [details] [diff] [review]
patch


Check in: { 01/04/2004 19:33	jshin%mailaps.org }
Check in: { 01/06/2004 16:20	jshin%mailaps.org	MOZILLA_1_6_BRANCH }

Comment 7:
{
P.S bryner, can I check in this for firebird 0.8 branch as well?
}
should get sucked in to firebird branch on the next update...

marking fixed
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.