Firefox doesn't consider font size in SVG text

I'm having a problem where Firefox doesn't seem to apply the font-size property (set in CSS) to SVG text elements.

The following example is enough to reproduce the problem in Firefox:

  <svg width="40em" height="25em" viewBox="0 0 40 25"> <style type="text/css"><![CDATA[ text { font-size: 1px; } text.foo { font-size: 2px; } ]]></style> <text x="0" y="10" class="foo">Hello, world! foo</text> <text x="0" y="20">Hello, world! bar</text> </svg> 

Here is the expected result (Chromium): enter image description here

Here's what Firefox does: enter image description here

I cannot find what I am doing wrong. Any ideas? Thanks.

+5
source share
1 answer

You probably have the minimum font size set. This is a known mistake, I hope we will fix it someday.

Unplug it like that.

Minimum font size

+4
source

All Articles