[Webkit-unassigned] [Bug 34147] If @font-face does not provide an explicit italic/bold variant, regular is used

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 10 01:28:14 PST 2010


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





--- Comment #3 from Yusuke Sato <yusukes at chromium.org>  2010-02-10 01:28:14 PST ---
Here is a small html that could reproduce the problem.

<html><head>
<style type="text/css">
@font-face {
     font-family: "A";
     src: url("http://HOST.NAME/PATH/TO/FONT.ttf");
}
.test {
     font-family: 'A';
}
</style></head>
<body><div>
<strong><p class="test">abcde</p></strong>
<i><p class="test">abcde</p></i>
<strong><i><p class="test">abcde</p></i></strong>
<p class="test">abcde</p>
<p>abcde</p>
</div></body></html>

When we don't specify font-weight: in a @font-face rule,
WebCore/css/CSSFontSelector.cpp treat the font as if it has
100|200|300|400|...|900 weight. Not 400 (i.e., normal weight).
And when a @font-face font has the 100|...|900 weight mask, current
WebCore/css/CSSSegmentedFontFace.cpp implementation never synthesize a bold
font for the font. That seems to be the problem.
The same is true for italic. Unusual mask is used when font-style: is missing
from @font-face.

I think we could fix the problem by giving special treatment to the 100|...|900
mask in CSSSegmentedFontFace.cpp.

(And I think we shouldn't modify CSSFontSelector.cpp side, since the
100|...|900 mask is necessary for proper handling of this case:
https://bugs.webkit.org/show_bug.cgi?id=16348
 Without the 100|...|900 mask, <i>...</i> text in
https://bugs.webkit.org/attachment.cgi?id=28455&action=prettypatch will be
displayed in Times, not Arial.)

I'll attach a patch with tests shortly.

-- 
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