<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>31804</bug_id>
          
          <creation_ts>2009-11-23 06:33:27 -0800</creation_ts>
          <short_desc>Safari/Chromium for Windows fails to load many CJK WebFonts and some Latin WebFonts</short_desc>
          <delta_ts>2009-12-02 11:18:02 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yusuke Sato">yusukes</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>agl</cc>
    
    <cc>aroben</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>165843</commentid>
    <comment_count>0</comment_count>
    <who name="Yusuke Sato">yusukes</who>
    <bug_when>2009-11-23 06:33:27 -0800</bug_when>
    <thetext>Safari for Windows fails to load OpenType web fonts (@font-face) that have 2 or more faces.
Chromium for Windows also fails to load TrueType and OpenType web fonts that have 2 or more faces.

This is because the renameAndActivateFont() function in WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp, which is used by Safari for Windows and Chromium for Windows, explicitly refuses such fonts. However, since most of CJK ttf/otf fonts and some of Latin ttf/otf fonts have more than 2 faces (e.g., one is for horizontal writing and the other is for vertical writing), the restriction seems to be too strict. For example, HIRAGINO (ヒラギノ) font, which is the default Japanese OpenType font for Mac OS X, has 2 faces.

I&apos;ll attach a one-line patch that allows WebKit to load such fonts. Just for reference, Safari for Mac seems not to have the restriction. I tried to load the HIRAGINO font to Safari for Mac via @font-face (on my local machine, of course), and it succeeded. A comment in WebCore/platform/graphics/mac/FontCustomPlatformData.cpp says that when a font has more than 2 faces, the first one is used for rendering, and I believe this behavior is good enough for most cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>165845</commentid>
    <comment_count>1</comment_count>
      <attachid>43711</attachid>
    <who name="Yusuke Sato">yusukes</who>
    <bug_when>2009-11-23 06:41:43 -0800</bug_when>
    <thetext>Created attachment 43711
allow_multiple_faces_v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166624</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-11-25 21:18:49 -0800</bug_when>
    <thetext>mitz wrote the code, hyatt reviewed it.  The change looks fine to me, but perhaps mitz had a reason for making this != 1 instead of &lt; 1.

I would suggest we let mitz comment before this is landed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167232</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Sato">yusukes</who>
    <bug_when>2009-11-30 07:15:50 -0800</bug_when>
    <thetext>Slightly modified the summary so that it states the actual circumstance of the issue. An example of load failure of a Latin webfont is: http://code.google.com/p/chromium/issues/detail?id=28567

mitz, can you please take a look at the patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167346</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-11-30 12:35:25 -0800</bug_when>
    <thetext>style-queue successfully ran check-webkit-style on attachment 43711 without any errors</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167659</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-12-01 10:00:20 -0800</bug_when>
    <thetext>I am trying to understand how this is supposed to work. On my Mac OS X v10.6 system, there are multiple font files whose name begins with ヒラギノ. Does one of them contain multiple faces? Which one?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167807</commentid>
    <comment_count>6</comment_count>
    <who name="Yusuke Sato">yusukes</who>
    <bug_when>2009-12-01 17:39:18 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; I am trying to understand how this is supposed to work. On my Mac OS X v10.6
&gt; system, there are multiple font files whose name begins with ヒラギノ. Does one of
&gt; them contain multiple faces? Which one?

Please try &quot;ヒラギノ角ゴ ProN W6&quot;, for example.

$ ls -l /System/Library/Fonts/ヒラギノ角ゴ\ ProN\ W6.otf
-rw-r--r--  1 root  wheel  7515064 May 31  2008 /System/Library/Fonts/ヒラギノ角ゴ ProN W6.otf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168007</commentid>
    <comment_count>7</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-12-02 08:54:38 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; An example of load failure of a Latin webfont is:
&gt; http://code.google.com/p/chromium/issues/detail?id=28567

The URL in that bug, &lt;http://www.alistapart.com/d/cssatten/stef.html&gt;, is rendered correctly in Safari on Windows with TOT WebKit. I confirmed that even if I skip the TTLoadEmbeddedFont() call in createFontCustomPlatformData() and take the renameAndActivateFont() branch, all fonts on that page load correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168015</commentid>
    <comment_count>8</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-12-02 09:20:26 -0800</bug_when>
    <thetext>(In reply to comment #6)

&gt; Please try &quot;ヒラギノ角ゴ ProN W6&quot;, for example.

I could reproduce the problem with that font, i.e. numFonts was 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168022</commentid>
    <comment_count>9</comment_count>
      <attachid>43711</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-12-02 09:28:45 -0800</bug_when>
    <thetext>Comment on attachment 43711
allow_multiple_faces_v1

Marking cq+ since Yusuke isn&apos;t a committer yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168087</commentid>
    <comment_count>10</comment_count>
      <attachid>43711</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-12-02 11:17:54 -0800</bug_when>
    <thetext>Comment on attachment 43711
allow_multiple_faces_v1

Clearing flags on attachment: 43711

Committed r51605: &lt;http://trac.webkit.org/changeset/51605&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168089</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-12-02 11:18:02 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>43711</attachid>
            <date>2009-11-23 06:41:43 -0800</date>
            <delta_ts>2009-12-02 11:17:54 -0800</delta_ts>
            <desc>allow_multiple_faces_v1</desc>
            <filename>bug-31804-20091123234141.patch</filename>
            <type>text/plain</type>
            <size>1316</size>
            <attacher name="Yusuke Sato">yusukes</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
NDU2MDc4Yy4uOWJiNjYzNCAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxMyBAQAorMjAwOS0xMS0yMyAgWXVzdWtlIFNhdG8g
IDx5dXN1a2VzQGNocm9taXVtLm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICBTYWZhcmkvQ2hyb21pdW0gZm9yIFdpbmR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UmVzb3Vy
Y2VFeChyZXdyaXR0ZW5Gb250RGF0YS5kYXRhKCksIGZvbnREYXRhLT5zaXplKCkgKyBuYW1lVGFi
bGVTaXplLCAwLCAmbnVtRm9udHMpOwogCi0gICAgaWYgKGZvbnRIYW5kbGUgJiYgbnVtRm9udHMg
IT0gMSkgeworICAgIGlmIChmb250SGFuZGxlICYmIG51bUZvbnRzIDwgMSkgewogICAgICAgICBS
ZW1vdmVGb250TWVtUmVzb3VyY2VFeChmb250SGFuZGxlKTsKICAgICAgICAgcmV0dXJuIDA7CiAg
ICAgfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>