SVG image with text distorted with a minimum font size in Firefox preferences
Categories
(Core :: SVG, defect)
Tracking
()
People
(Reporter: pascalc, Unassigned)
References
Details
Attachments
(2 files)
I don't know if this bug belongs to fonts, SVG or another component, feel free to move it to a better component.
Using any version of Firefox (tested 78, 83, 85), the svg animation at https://github.com/sharkdp/fd is broken with gigantic text if you set a minimum font size in Firefox.
I checked in Chrome and with the same minimum font size, the svg animation remains unaffected.
The svg file is at https://raw.githubusercontent.com/sharkdp/fd/master/doc/screencast.svg
I am attaching a screencast of the difference in behaviour between Nightly 85 on the left and Chome 86 on the right.
Comment 1•4 years ago
|
||
Hmm. https://bug358032.bmoattachments.org/attachment.cgi?id=243486 is unaffected by minimum font size. bug 935056 fixed that case. I wonder what the difference is.
Comment 2•4 years ago
|
||
Comment 3•4 years ago
|
||
If you take the simplified testcase and move the font-size attribute to the text element then the minimum font size issue goes away. Any ideas Cameron?
Comment 4•4 years ago
|
||
We apply the internal -x-text-zoom: false
property to SVG text
elements (which we also use for disabling minimum font size):
and the minimum size is applied at computed value time:
We have code that undoes the effect of text zoom, if that is enabled:
We don't do anything similar for undoing the effect of the minimum font size, nor can we, unless we stored what the original unclamped value was.
Not sure what the best way to solve this is. We could move the -x-text-zoom
rule to apply to svg
elements, which would fix this case, but wouldn't fix other cases where a font-size is inherited in from some containing HTML, for example. (It'd also disabling text zoom and minimum font sizes for content inside a foreignObject
, too.)
Still an issue here on Firefox 99 with a minimum font size of 13 set. On Linux I need to set this minimum to deal with font scaling issues on hidpi screens.
I found the text large and seemingly corrupted with release-it's svg animation and reported it to them before finding this existing bug.
Testing the svg workaround of setting font-size attribute to every text element did resolve the issue.
Comment 7•2 years ago
|
||
As a practical note, many people generate SVGs of their code in action and place them in their GitHub repo Readme's. Here's one of the many tickets with screenshots I've filed with repos about this. At my minimum font size of 20 these SVG screencasts are literally unreadable (not because of low vision issues, because they text size is completely screwed up).
This is a very real accessibility issue for people with low vision needs.
I'd add the screenshot here but i don't seem to have that option.
Description
•