<?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>264115</bug_id>
          
          <creation_ts>2023-11-02 15:08:11 -0700</creation_ts>
          <short_desc>An incorrect fallback font for Ahem returns where unicode-range is set.</short_desc>
          <delta_ts>2024-01-26 11:59:46 -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>Text</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=264120</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="ChangSeok Oh">changseok</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fantasai.bugs</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>ntim</cc>
    
    <cc>vitor.roriz</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1989537</commentid>
    <comment_count>0</comment_count>
    <who name="ChangSeok Oh">changseok</who>
    <bug_when>2023-11-02 15:08:11 -0700</bug_when>
    <thetext>While I was investigating the failure of size-adjust-unicode-range-system-fallback.html [1], I found Mac port behaved unexpectedly to unicode-range. Please try the following HTML snippet.

```
&lt;style&gt;
@font-face {
  font-family: large-font;
  src: local(Ahem), url(/fonts/Ahem.ttf);
  size-adjust: 1000%;
  unicode-range: U+0020;
}

.test {
  font-family: large-font;
}
&lt;/style&gt;
&lt;span class=&quot;test&quot;&gt;X&lt;/span&gt;
```

The expected result is a small `X`, but Mac port shows a large square from Ahem.
Aside from the different sizes, unicode-range is set with U+0020 (i.e., space) so Ahem should be limited to only spaces.

When I tracked down this issue, I encountered that CTFontCreateForCharactersWithLanguageAndOption returned Ahem as a fallback for Ahem in lookupFallbackFont() at FontCacheCoreText.cpp. However, further investigation was not possible since I could not see the definition of CTFontCreateForCharactersWithLanguageAndOption.

Maybe, Apple folks want to look into this issue. FYI, GTK/WPE ports work fine.

[1] https://wpt.fyi/results/css/css-fonts/size-adjust-unicode-range-system-fallback.html?label=experimental&amp;label=master&amp;aligned</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1991290</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-11-09 14:09:23 -0800</bug_when>
    <thetext>&lt;rdar://problem/118199422&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2008002</commentid>
    <comment_count>2</comment_count>
      <attachid>469561</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-01-26 11:58:18 -0800</bug_when>
    <thetext>Created attachment 469561
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2008003</commentid>
    <comment_count>3</comment_count>
      <attachid>469562</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-01-26 11:59:00 -0800</bug_when>
    <thetext>Created attachment 469562
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2008004</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-01-26 11:59:46 -0800</bug_when>
    <thetext>The WPT link no longer shows the problem, as the test got changed to work around it. Attaching the original test.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>469561</attachid>
            <date>2024-01-26 11:58:18 -0800</date>
            <delta_ts>2024-01-26 11:59:00 -0800</delta_ts>
            <desc>test case</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>229</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PHN0eWxlPgpAZm9udC1mYWNlIHsKICBmb250LWZhbWlseTogbGFyZ2UtZm9udDsKICBzcmM6IGxv
Y2FsKEFoZW0pLCB1cmwoaHR0cDovL3dwdC5saXZlL2ZvbnRzL0FoZW0udHRmKTsKICBzaXplLWFk
anVzdDogMTAwMCU7CiAgdW5pY29kZS1yYW5nZTogVSswMDIwOwp9CgoudGVzdCB7CiAgZm9udC1m
YW1pbHk6IGxhcmdlLWZvbnQ7Cn0KPC9zdHlsZT4KPHNwYW4gY2xhc3M9InRlc3QiPlg8L3NwYW4+
Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>469562</attachid>
            <date>2024-01-26 11:59:00 -0800</date>
            <delta_ts>2024-01-26 11:59:00 -0800</delta_ts>
            <desc>test case</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>230</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PHN0eWxlPgpAZm9udC1mYWNlIHsKICBmb250LWZhbWlseTogbGFyZ2UtZm9udDsKICBzcmM6IGxv
Y2FsKEFoZW0pLCB1cmwoaHR0cHM6Ly93cHQubGl2ZS9mb250cy9BaGVtLnR0Zik7CiAgc2l6ZS1h
ZGp1c3Q6IDEwMDAlOwogIHVuaWNvZGUtcmFuZ2U6IFUrMDAyMDsKfQoKLnRlc3QgewogIGZvbnQt
ZmFtaWx5OiBsYXJnZS1mb250Owp9Cjwvc3R5bGU+CjxzcGFuIGNsYXNzPSJ0ZXN0Ij5YPC9zcGFu
Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>