Reset mUnderlineOffset on all platforms when user font set generation is bumped. (Bug 523717) r=jdaggett

This commit is contained in:
L. David Baron 2009-12-11 08:13:20 -08:00
parent 1fefbc68b6
commit 0d1e7cde54
12 changed files with 169 additions and 0 deletions

View File

@ -1364,6 +1364,7 @@ gfxCoreTextFontGroup::UpdateFontList()
if (mUserFontSet && mCurrGeneration != GetGeneration()) {
// xxx - can probably improve this to detect when all fonts were found, so no need to update list
mFonts.Clear();
mUnderlineOffset = UNDERLINE_OFFSET_NOT_SET;
ForEachFont(FindCTFont, this);
mCurrGeneration = GetGeneration();
}

View File

@ -1948,6 +1948,7 @@ gfxPangoFontGroup::UpdateFontList()
mFonts[0] = NULL;
mFontSets.Clear();
mUnderlineOffset = UNDERLINE_OFFSET_NOT_SET;
mCurrGeneration = newGeneration;
}

View File

@ -113,3 +113,8 @@ HTTP(..) != 507960-1-bad-sfnt-version-woff.html 507960-1-ref.html
HTTP(..) != 507960-1-bad-woff-sig.html 507960-1-ref.html
HTTP(..) != 507960-1-bad-offset-woff.html 507960-1-ref.html
HTTP(..) != 507960-1-woff-bad-hint.html 507960-1-ref.html
# Bug 523717
HTTP(..) == underline-offset-change-1.html underline-offset-change-1-ref.html
HTTP(..) == underline-offset-change-2.html underline-offset-change-2-ref.html
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") fails-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) != underline-offset-change-1-ref.html underline-offset-change-2-ref.html # Bug 534132

View File

@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title>Switching first font to one with higher underline (reference)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "Mark2AHighUnderline";
src: url(../fonts/mark2A-highunderline.ttf);
}
body { font-family: "Mark2AHighUnderline"; }
p { text-decoration: underline; border: blue solid; padding: 0.2em; }
</style>
</head>
<body>
<p style="position:relative; width: -moz-max-content">A</p>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title>Switching first font to one with higher underline</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "Mark2AHighUnderline";
src: url(../fonts/mark2A-highunderline.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "MarkALowUnderline";
src: url(../fonts/markA-lowunderline.ttf);
}
body { font-family: "Mark2AHighUnderline", "MarkALowUnderline"; }
p { text-decoration: underline; border: blue solid; padding: 0.2em; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[0].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[0].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">A<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

View File

@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title>Switching first font to one with lower underline (reference)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "Mark2ALowUnderline";
src: url(../fonts/mark2A-lowunderline.ttf);
}
body { font-family: "Mark2ALowUnderline"; }
p { text-decoration: underline; border: blue solid; padding: 0.2em; }
</style>
</head>
<body>
<p style="position:relative; width: -moz-max-content">A</p>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title>Switching first font to one with lower underline</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "Mark2ALowUnderline";
src: url(../fonts/mark2A-lowunderline.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "MarkAHighUnderline";
src: url(../fonts/markA-highunderline.ttf);
}
body { font-family: "Mark2ALowUnderline", "MarkAHighUnderline"; }
p { text-decoration: underline; border: blue solid; padding: 0.2em; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[0].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[0].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">A<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

View File

@ -68,3 +68,25 @@ for codepoint in range(ord("A"), ord("D") + 1):
f.generate("mark" + mark + charname + ".ttf")
f.generate("mark" + mark + charname + ".otf")
for codepoint in range(ord("A"), ord("A") + 1):
for (mark, width) in [("", 1500), ("2", 1800)]:
for (uposname, upos) in [("low", -350), ("high", -50)]:
charname = chr(codepoint)
f = fontforge.font()
n = "Mark" + mark + charname
f.fontname = n
f.familyname = n
f.fullname = n
f.descent = 400
f.upos = upos
f.uwidth = 100
f.copyright = "Copyright (c) 2008 Mozilla Corporation"
g = f.createChar(codepoint, charname)
g.importOutlines("mark" + mark + "-glyph.svg")
g.width = width
f.generate("mark" + mark + charname + "-" + uposname +
"underline.ttf")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.