mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 538730: fix Windows synthetic bolding regression from bug 493280. r=jdaggett
This commit is contained in:
parent
06740d3796
commit
54e01fdc15
@ -346,6 +346,14 @@ gfxWindowsFont::FillLogFont(gfxFloat aSize)
|
||||
isItalic = (GetStyle()->style & (FONT_STYLE_ITALIC | FONT_STYLE_OBLIQUE));
|
||||
PRUint16 weight = fe->Weight();
|
||||
|
||||
// determine whether synthetic bolding is needed
|
||||
PRInt8 baseWeight, weightDistance;
|
||||
GetStyle()->ComputeWeightAndOffset(&baseWeight, &weightDistance);
|
||||
if ((weightDistance == 0 && baseWeight >= 6)
|
||||
|| (weightDistance > 0)) {
|
||||
weight = PR_MAX(weight, 700); // synthetic bold this face unless already bold
|
||||
}
|
||||
|
||||
// if user font, disable italics/bold if defined to be italics/bold face
|
||||
// this avoids unwanted synthetic italics/bold
|
||||
if (fe->mIsUserFont) {
|
||||
@ -353,14 +361,6 @@ gfxWindowsFont::FillLogFont(gfxFloat aSize)
|
||||
isItalic = PR_FALSE; // avoid synthetic italic
|
||||
if (fe->IsBold()) {
|
||||
weight = 400; // avoid synthetic bold
|
||||
} else {
|
||||
// determine whether synthetic bolding is needed
|
||||
PRInt8 baseWeight, weightDistance;
|
||||
GetStyle()->ComputeWeightAndOffset(&baseWeight, &weightDistance);
|
||||
if ((weightDistance == 0 && baseWeight >= 6)
|
||||
|| (weightDistance > 0)) {
|
||||
weight = 700; // set to get GDI to synthetic bold this face
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -472,13 +472,13 @@ gfxWindowsFont::GetOrMakeFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aSty
|
||||
// things in the cache so we don't end up with things like 402 in there.
|
||||
gfxFontStyle style(*aStyle);
|
||||
|
||||
if (aFontEntry->mIsUserFont && !aFontEntry->IsBold()) {
|
||||
if (!aFontEntry->IsBold()) {
|
||||
// determine whether synthetic bolding is needed
|
||||
PRInt8 baseWeight, weightDistance;
|
||||
aStyle->ComputeWeightAndOffset(&baseWeight, &weightDistance);
|
||||
|
||||
if ((weightDistance == 0 && baseWeight >= 6) || (weightDistance > 0 && aNeedsBold)) {
|
||||
style.weight = 700; // set to get GDI to synthetic bold this face
|
||||
style.weight = 700; // set to get GDI to synthetic bold this face
|
||||
} else {
|
||||
style.weight = aFontEntry->mWeight;
|
||||
}
|
||||
|
@ -1 +1,6 @@
|
||||
== CSS21-t1502-no-inherited-font-family.xhtml CSS21-t1502-no-inherited-font-family-ref.xhtml
|
||||
|
||||
# basic tests for bug 538730
|
||||
!= synthetic-bold-1.html synthetic-bold-1-ref.html
|
||||
!= synthetic-bold-2.html synthetic-bold-2-ref.html
|
||||
|
||||
|
11
layout/reftests/font-matching/synthetic-bold-1-ref.html
Normal file
11
layout/reftests/font-matching/synthetic-bold-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body { font-family: Symbol, OpenSymbol, "Standard Symbols L"; font-size: 2em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p> abc</p>
|
||||
<p> abc</p>
|
||||
</body>
|
||||
</html>
|
12
layout/reftests/font-matching/synthetic-bold-1.html
Normal file
12
layout/reftests/font-matching/synthetic-bold-1.html
Normal file
@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body { font-family: Symbol, OpenSymbol, "Standard Symbols L"; font-size: 2em; }
|
||||
</style>
|
||||
</head>
|
||||
<!-- if synthetic bolding is working, this should NOT match the reference -->
|
||||
<body>
|
||||
<p> abc</p>
|
||||
<p><b> abc</b></p>
|
||||
</body>
|
||||
</html>
|
11
layout/reftests/font-matching/synthetic-bold-2-ref.html
Normal file
11
layout/reftests/font-matching/synthetic-bold-2-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body { font-family: "Apple Chancery", Impact, "Microsoft Sans Serif", "URW Chancery L"; font-size: 2em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello World</p>
|
||||
<p>Hello World</p>
|
||||
</body>
|
||||
</html>
|
12
layout/reftests/font-matching/synthetic-bold-2.html
Normal file
12
layout/reftests/font-matching/synthetic-bold-2.html
Normal file
@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body { font-family: "Apple Chancery", Impact, "Microsoft Sans Serif", "URW Chancery L"; font-size: 2em; }
|
||||
</style>
|
||||
</head>
|
||||
<!-- if synthetic bolding is working, this should NOT match the reference -->
|
||||
<body>
|
||||
<p>Hello World</p>
|
||||
<p><b>Hello World</b></p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user