[librsvg: 3/15] Add a test to ensure we are using the Ahem font correctly
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 3/15] Add a test to ensure we are using the Ahem font correctly
- Date: Mon, 18 Oct 2021 23:15:47 +0000 (UTC)
commit ff1c99b7adc6a62547df77524e2ea9aa3b5b85ab
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Oct 8 17:43:07 2021 -0500
Add a test to ensure we are using the Ahem font correctly
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/613>
tests/src/primitives.rs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
---
diff --git a/tests/src/primitives.rs b/tests/src/primitives.rs
index e1564bf8..638f00d2 100644
--- a/tests/src/primitives.rs
+++ b/tests/src/primitives.rs
@@ -400,3 +400,27 @@ test_compare_render_output!(
<rect x="0" y="0" width="20" height="20" fill="black" transform="translate(-10 -20) scale(2) rotate(45)"/>
</svg>"##,
);
+
+// From https://www.w3.org/Style/CSS/Test/Fonts/Ahem/
+//
+// > The Ahem font was developed by Todd Fahrner and Myles C. Maxfield to
+// > help test writers develop predictable tests. The units per em is 1000,
+// > the ascent is 800, and the descent is 200, thereby making the em
+// > square exactly square. The glyphs for most characters is simply a box
+// > which fills this square. The codepoints mapped to this full square
+// > with a full advance are the following ranges:
+//
+// So, ascent is 4/5 of the font-size, descent is 1/5. Mind the positions below.
+test_compare_render_output!(
+ ahem_font,
+ 500,
+ 500,
+ br##"<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500">
+ <text style="font: 50px Ahem;" x="50" y="50" fill="black">abcde</text>
+</svg>"##,
+ br##"<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500">
+ <rect x="50" y="10" width="250" height="50" fill="black"/>
+</svg>"##,
+);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]