Re: [csswg-drafts] [css-fonts-5] Feature for making text always fit the width of its parent (#2528)

The way to solve the fit-to-width issue with font-size I am currently thinking about: **make the “max font-size” limit to be 200% of the starting original font-size**.

With all major browsers that I tested, they provide around 500% full-page zoom (not counting pinch-to-zoom and similar cases). That means that if we limit the max font-size that our fit-to-width algorithm could reach to 200%, the built-in zoom allows a user to zoom the original text to around 250% in the worst scenario.

This will be very similar to the case described in the [“Understanding SC 1.4.4”](https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html) with the size of the layout (see [second note there](https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html#:~:text=for%20some%20users.-,Note,-As%20with%20most)).

This will also solve another issue that I encountered with fit-to-width much more often than an inability to zoom in — an ability to _zoom out_. An unbounded fit-to-width on bigger screens can lead to text that is too big, it becomes unreadable.

I am planning to research the existing cases for fit-to-width, and see if 200% max font-size will be enough for them. I anticipate that it should — and not having this big range of values will also mean that authors will have to define a better fallback size for browsers that won't support fit-to-width.



-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2528#issuecomment-2784658224 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 7 April 2025 21:22:37 UTC