layout: Implement per-glyph font fallback.

This improves numerous pages, for example Wikipedia and Ars Technica.

Closes #177.
This commit is contained in:
Patrick Walton 2015-04-07 18:43:18 -07:00
parent 19b443ecc8
commit fec43b49bb
9 changed files with 308 additions and 121 deletions

View file

@ -234,6 +234,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html
== overflow_simple_a.html overflow_simple_b.html
== overflow_wrap_a.html overflow_wrap_ref.html
== overflow_xy_a.html overflow_xy_ref.html
== per_glyph_font_fallback_a.html per_glyph_font_fallback_ref.html
== percent_height.html percent_height_ref.html
== percentage_height_float_a.html percentage_height_float_ref.html
== percentage_height_root.html percentage_height_root_ref.html

View file

@ -9,7 +9,7 @@
}
body {
font-size: 16px;
font-family: Ahem, monospace;
font-family: Ahem;
padding-top: 5px;
}
#floaty {

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that font fallback occurs on a per-glyph basis. -->
<style>
@font-face {
font-family: 'ahem';
src: url(fonts/ahem/ahem.ttf);
}
body {
font-family: Ahem, sans-serif;
font-size: 24px;
line-height: 24px;
}
</style>
</head>
<body>
<section>x&larr;</section>
<section>&rarr;x</section>
<section>&rarr;x&larr;</section>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that font fallback occurs on a per-glyph basis. -->
<style>
@font-face {
font-family: 'ahem';
src: url(fonts/ahem/ahem.ttf);
}
body {
font-family: Ahem, sans-serif;
font-size: 24px;
line-height: 24px;
}
.arrow {
font-family: sans-serif;
}
</style>
</head>
<body>
<section>x<span class=arrow>&larr;</span></section>
<section><span class=arrow>&rarr;</span>x</section>
<section><span class=arrow>&rarr;</span>x<span class=arrow>&larr;</span></section>
</body>
</html>

View file

@ -9,7 +9,7 @@
div {
width: 100px;
font-size: 10px;
font-family: Ahem, monospace;
font-family: Ahem;
padding: 10px !important;
}

View file

@ -9,7 +9,7 @@
div {
width: 100px;
font-size: 10px;
font-family: Ahem, monospace;
font-family: Ahem;
padding: 10px !important;
}