[Webkit-unassigned] [Bug 96348] New: Texts with monospace font are incorrectly chosen when lang=zh

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 10 20:00:46 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=96348

           Summary: Texts with monospace font are incorrectly chosen when
                    lang=zh
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
               URL: http://jsfiddle.net/HjJcD/1/
        OS/Version: Mac OS X 10.8
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P3
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ducksteven at gmail.com


Created an attachment (id=163268)
 --> (https://bugs.webkit.org/attachment.cgi?id=163268&action=review)
Screenshot of Facebook FQL sample code, when logged in as a Chinese user

Safari version: 6.0
OS X Version: 10.8.1

Summary:

When a <pre> or <code> has lang attribute set to zh, zh-tw or zh-cn, or is inside an element with such lang attribute, then the texts are not in monospace font.

Code to reproduce:

    <pre lang='zh-tw'>hello world</pre>

Expected result:

"hello world" should be in monospaced font.

Actual result:

"hello world" are in sans-serif font.

Test code:

http://jsfiddle.net/HjJcD/1/

Real-world example:

https://developers.facebook.com/docs/reference/fql/

When logged in a Facebook account with user language set to Chinese (Traditional), the code examples are not in monospace font, but in Heiti TC.

I think this is because Safari now chooses font by the lang attribute, and in Mac OS X, monospace font of zh, zh-tw and zh-cn are the same as sans-serif font, described in DefaultFontFallback.plist (under /System/Library/Frameworks/CoreText.framework/Versions/A/Resources)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list