diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-font-loading/fontface-override-descriptors.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-font-loading/fontface-override-descriptors.html')
-rw-r--r-- | testing/web-platform/tests/css/css-font-loading/fontface-override-descriptors.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-font-loading/fontface-override-descriptors.html b/testing/web-platform/tests/css/css-font-loading/fontface-override-descriptors.html new file mode 100644 index 0000000000..34506b1547 --- /dev/null +++ b/testing/web-platform/tests/css/css-font-loading/fontface-override-descriptors.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<title>Tests that the ascentOverride, descentOverride and lineGapOverride attributes of FontFace work</title> +<link rel="help" href="https://drafts.csswg.org/css-font-loading/#fontface-interface"> +<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-metrics-override-desc"> +<link rel="match" href="fontface-override-descriptors-ref.html"> +<script> +const face = new FontFace( + 'Ahem', + 'local("Ahem"), url("/fonts/Ahem.ttf")', + {ascentOverride: '100%', descentOverride: '100%', lineGapOverride: '100%'}); +document.fonts.add(face); + +// Line height is ascent + descent + lineGap = 3em +// Baseline is placed at lineGap * 0.5 + ascent = 1.5em below line box top +// Since each Ahem 'X' glyph has 0.8em above baseline, the top of each glyph +// should be placed at 0.7em below line box top +</script> +<style> +#target { + position: absolute; + font-family: Ahem; + font-size: 20px; +} +</style> + +<div id="target"> + XXXXX<br> + XXXXX +</div> |