mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
layout: Implement per-glyph font fallback.
This improves numerous pages, for example Wikipedia and Ars Technica. Closes #177.
This commit is contained in:
parent
19b443ecc8
commit
fec43b49bb
9 changed files with 308 additions and 121 deletions
|
@ -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
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
body {
|
||||
font-size: 16px;
|
||||
font-family: Ahem, monospace;
|
||||
font-family: Ahem;
|
||||
padding-top: 5px;
|
||||
}
|
||||
#floaty {
|
||||
|
|
24
tests/ref/per_glyph_font_fallback_a.html
Normal file
24
tests/ref/per_glyph_font_fallback_a.html
Normal 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←</section>
|
||||
<section>→x</section>
|
||||
<section>→x←</section>
|
||||
</body>
|
||||
</html>
|
||||
|
28
tests/ref/per_glyph_font_fallback_ref.html
Normal file
28
tests/ref/per_glyph_font_fallback_ref.html
Normal 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>←</span></section>
|
||||
<section><span class=arrow>→</span>x</section>
|
||||
<section><span class=arrow>→</span>x<span class=arrow>←</span></section>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
div {
|
||||
width: 100px;
|
||||
font-size: 10px;
|
||||
font-family: Ahem, monospace;
|
||||
font-family: Ahem;
|
||||
padding: 10px !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
div {
|
||||
width: 100px;
|
||||
font-size: 10px;
|
||||
font-family: Ahem, monospace;
|
||||
font-family: Ahem;
|
||||
padding: 10px !important;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue