From 115f01273b01beaf9fc9aaec1515ef4197c00df4 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 9 Jul 2025 18:55:23 +0100 Subject: [PATCH] [css-fonts-5]: define text-scale, legacy/scale keywords, env(preferred-text-scale) --- css-fonts-5/Overview.bs | 78 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/css-fonts-5/Overview.bs b/css-fonts-5/Overview.bs index 422d5b0e465..7ec5c5f3a47 100644 --- a/css-fonts-5/Overview.bs +++ b/css-fonts-5/Overview.bs @@ -59,7 +59,83 @@ rules defined in CSS Fonts Level 4. This specification is currently a delta to the CSS Fonts Level 4 specification. Do not assume that if something is not here, it has been dropped. +

+Environment Variables

+ +Text Scale {#text-scale-envs} +------------------------------------------------------------------ + + + + +
Name + Value + Number of dimensions +
preferred-text-scale + <> + 0 (scalar) +
+ +The text-scale [=environment variables=] define the devices text scale, which +must be a non-zero number for which all text can be scaled by. + +The preferred-text-scale unit must be a value that computes to the documents +initial font-size, when multiplied by 16px: + +
+	:root {
+		font-size: calc(16px * env(preferred-text-scale));
+	}
+
+ +

+Text-Scale <meta> element

+ +A document with a <meta> tag whose name attribute +is a ASCII case-insensitive match for +"text-scale" is recognized as setting the +initial font size of the document. The value of the content +attribute must be an ASCII case-insensitive match for one of the +recognized keywords. + +Documents without this <meta> tag will have an assumed default +value of legacy. + +

+Keywords

+ +The recognized keywords in the [=text-scale=] +<meta> element are: + + + +

The 'legacy' keyword

+ +The legacy property is +recognized in the [=text-scale=] content attribute value. + +When the value of the [=text-scale=] content attribute is +legacy the user agent should set the initial font size +to 16px. The user agent may chose a different initial value, such as one based +on a user preference. The ''env()/preferred-text-scale'' value must be 1. + +

The 'scale' keyword

+ +The scale property is +recognized in the [=text-scale=] content attribute value. + +When the value of the [=text-scale=] content attribute is +scale the user agent may determine the initial font size +based on the operating systems text scale setting. The +''env()/preferred-text-scale'' value must be a number that, when multiplied by +16px, provides a <> that matches that of the initial font size. +Note: It is expected that authors will use +''calc(16px * env(preferred-text-scale))'' in stylesheets to match the font +size of the user agent, based on the initial font size.

Value Definitions

@@ -706,7 +782,7 @@ Issue(5484):

-Font Feature and Variation Resolution

+Font Feature and Variation Resolution Issue(5635):