Bug 17194 - REGRESSION (2.0.4-3.0): Changing text to bold changes font family
Summary: REGRESSION (2.0.4-3.0): Changing text to bold changes font family
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.5
: P1 Normal
Assignee: Nobody
URL: data:text/html,<span%20style="font-fa...
Keywords: HasReduction, Regression
Depends on:
Blocks:
 
Reported: 2008-02-06 05:08 PST by Adriaan Tijsseling
Modified: 2008-02-07 09:20 PST (History)
1 user (show)

See Also:


Attachments
Use the family of the font whose name matches the desired family (32.61 KB, patch)
2008-02-06 13:18 PST, mitz
darin: review+
Details | Formatted Diff | Diff
Screenshot of test case in Safari 2.0.4 (5.07 KB, image/png)
2008-02-07 09:20 PST, David Kilzer (:ddkilzer)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adriaan Tijsseling 2008-02-06 05:08:44 PST
Using the WebKit sample, Blot, included with developer tools, load a file with the following HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Untitled</title>

<style type="text/css">
/*<![CDATA[*/
<!--
body, div, p {
  margin: 3px 6px 3px 6px;
  padding: 0;
  font: 13px "LucidaGrande";
  background: #ffffff;
  color: #333333;
  text-align: justify;
}

-->
/*]]>*/
</style>
</head>
<body>
<p>Making this word bold will turn it into Times on 10.5.</p>
</body>
</html>


Select a word to turn it bold and it will use the Times font. This does not happen on 10.4 with the publick Safari 3 installed there, only on 10.5.
Comment 1 mitz 2008-02-06 08:27:35 PST
I think the problem is that when you specify "LucidaGrande" rather than "Lucida Grande", WebKit fails to find a font family with that name and therefore falls back on finding a font with the PostScript name LucidaGrande. That works for the regular weight but when you ask for the bold weight, since you did not specify the correct family name, WebKit fails to match Lucida Grande Bold with "LucidaGrande".
Comment 2 mitz 2008-02-06 13:18:51 PST
Created attachment 18967 [details]
Use the family of the font whose name matches the desired family
Comment 3 Adriaan Tijsseling 2008-02-06 15:45:11 PST
Indeed, using font family names fixes the issue. Thanks for the pointer!
Comment 4 mitz 2008-02-06 16:05:09 PST
I would still like the patch to be considered.
Comment 5 Darin Adler 2008-02-06 16:52:09 PST
Comment on attachment 18967 [details]
Use the family of the font whose name matches the desired family

r=me
Comment 6 mitz 2008-02-07 09:01:45 PST
Fixed in <http://trac.webkit.org/projects/webkit/changeset/30066>.
Comment 7 David Kilzer (:ddkilzer) 2008-02-07 09:18:23 PST
This was a regression from Safari 2.0.4 (419.3) with original WebKit on Mac OS X 10.4.11 (8S165).

The font family did NOT change when the text became bold in Safari 2.0.4.
Comment 8 David Kilzer (:ddkilzer) 2008-02-07 09:20:03 PST
Created attachment 18984 [details]
Screenshot of test case in Safari 2.0.4