Closed Bug 229270 Opened 20 years ago Closed 20 years ago

[xft] non-BMP Unicode character rendering broken


(Core Graveyard :: GFX: Gtk, defect)

Not set


(Not tracked)



(Reporter: jshin1987, Assigned: jshin1987)




(Keywords: intl, regression)


(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

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]

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.
setting the milestone to 1.6final
Target Milestone: --- → mozilla1.6final
Attachment #137879 - Flags: superreview?(dbaron) → superreview+
Comment on attachment 137879 [details] [diff] [review]

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]

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]

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

Check in: { 01/04/2004 19:33 }
Check in: { 01/06/2004 16:20	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
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.