Closed
Bug 548558
Opened 15 years ago
Closed 15 years ago
SVG renders font sizes incorrectly
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
DUPLICATE
of bug 311569
People
(Reporter: kumaran, Unassigned)
Details
Attachments
(4 files)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.6) Gecko/20091216 Fedora/3.5.6-1.fc11 Firefox/3.5.6
Build Identifier: 1.9.1.6
When the "font-size" attribute does not have an explicit units specifier, Firefox does not choose the "px" unit as specified by the SVG specification. An example SVG file is attached along with PNG renderings on Firefox, Opera, and Inkscape.
---
Scalable Vector Graphics (SVG) 1.1 Specification
W3C Recommendation 14 January 2003, edited in place 30 April 2009
Section 10.10 - Font selection properties (pg 245):
For SVG, if a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the <length> as a height value in the current user coordinate system.
Section 7.3 - The initial coordinate system (pg 128):
For the outermost 'svg' element, the SVG user agent determines an initial viewport coordinate system and an initial user coordinate system such that the two coordinates systems are identical. The origin of both coordinate systems is at the origin of the viewport, and one unit in the initial coordinate system equals one "pixel" (i.e., a px unit as defined in [CSS2 lengths]) in the viewport.
---
Reproducible: Always
Steps to Reproduce:
1. Open sample SVG file
2. Compare against PNG examples
Actual Results:
Firefox bleeds the text outside of the box.
Expected Results:
Firefox rendering looks like Opera and Inkscape.
Reporter | ||
Comment 1•15 years ago
|
||
Reporter | ||
Comment 2•15 years ago
|
||
Reporter | ||
Comment 3•15 years ago
|
||
Reporter | ||
Comment 4•15 years ago
|
||
Comment 5•15 years ago
|
||
That applies to font-size="30", not style="font-size:30".
The former form is valid and covered by the SVG specification that you cite. The latter form is CSS and the CSS specification disallows the omission of units.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 6•15 years ago
|
||
I would have to respectfully disagree with closing this bug based only on lack of specification. Every other SVG rendering program, including Inkscape, Adobe Plugin, Emacs, and Opera selects PX as the default unit if not specified. Several programs, including Inkscape and Dia, export SVGs with this assumption. Firefox appears broken when compared to these programs, thus resulting in a poor user experience.
In any case, the above paragraph is immaterial to this bug. The spec text that I originally included applies to both font-size and CSS font-size. That makes sense, since it would be quite confusing if the two methods differed in subtle ways. Below, I have excerpted from the CSS section of the SVG spec. It explicitly supersedes the CSS2 spec for the case of font sizes without unit identifiers.
http://www.w3.org/TR/SVG/text.html
---
'font-size'
Value: <absolute-size> | <relative-size> | <length> | <percentage> | inherit
Initial: medium
Applies to: text content elements
Inherited: yes, the computed value is inherited
Percentages: refer to parent element's font size
Media: visual
Animatable: yes
This property refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. For SVG, if a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the <length> as a height value in the current user coordinate system.
If a <length> is provided with one of the unit identifiers (e.g., 12pt or 10%), then the SVG user agent converts the <length> into a corresponding value in the current user coordinate system by applying the rules described in Units.
Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2-font-size].
---
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 7•15 years ago
|
||
(In reply to comment #6)
> I would have to respectfully disagree with closing this bug based only on lack
> of specification. Every other SVG rendering program, including Inkscape, Adobe
> Plugin, Emacs, and Opera selects PX as the default unit if not specified.
> Several programs, including Inkscape and Dia, export SVGs with this assumption.
> Firefox appears broken when compared to these programs, thus resulting in a
> poor user experience.
Raise bugs on them then so they get fixed :-) Or alternatively use properties as I suggested rather than inline CSS.
The appropriate text is here since you are using inline CSS: http://www.w3.org/TR/CSS2/syndata.html#length-units specifically
The format of a length value (denoted by <length> in this specification) is a <number> (with or without a decimal point) immediately followed by a unit identifier (e.g., px, em, etc.)
No ifs, no buts, units are mandatory exept for the special case of 0.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → INVALID
Comment 8•15 years ago
|
||
(In reply to comment #6)
> ways. Below, I have excerpted from the CSS section of the SVG spec. It
> explicitly supersedes the CSS2 spec for the case of font sizes without unit
> identifiers.
>
The w3c SVG working group accepted long ago that they had no right to do this. CSS syntax is the preserve of the w3c CSS working group and the w3c CSS specification.
Reporter | ||
Comment 9•15 years ago
|
||
At this point, I would respectfully ask that somebody else arbitrate on this bug. Ideally, it should be put up for a vote instead of unilaterally closing it as invalid based on one person's opinion.
With the data available right now, it is reasonable to suggest that fixing this issue will be an improvement to Firefox. If you feel differently, I ask that you provide the following:
1) Documentation that W3C retracted the specific SVG CSS spec section.
2) Examples of programs only export font-size with explicit units.
3) Examples of programs which render the same way as Firefox.
I'm happy to re-evaluate my position if these points are addressed.
I offer that I can even fix this bug myself. However, I cannot justify spending time on it if the Firefox organization won't accept the patch. Given that I'm even alleviating the overhead from your development team, I feel that it is a very small thing to ask that Firefox behave like every other SVG renderer on the market.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 10•15 years ago
|
||
(In reply to comment #9)
> At this point, I would respectfully ask that somebody else arbitrate on this
> bug. Ideally, it should be put up for a vote instead of unilaterally closing
> it as invalid based on one person's opinion.
Please don't reopen this bug. I'm going to dup it to the one where this was originally considered and rejected.
I'm afraid this isn't a democracy.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → DUPLICATE
Comment 11•15 years ago
|
||
(In reply to comment #9)
> At this point, I would respectfully ask that somebody else arbitrate on this
> bug. Ideally, it should be put up for a vote instead of unilaterally closing
> it as invalid based on one person's opinion.
I'm actually giving you the settled opinion of all the people in charge. I am one of them now although I wasn't at the time of bug 311569.
> I offer that I can even fix this bug myself. However, I cannot justify
> spending time on it if the Firefox organization won't accept the patch. Given
> that I'm even alleviating the overhead from your development team, I feel that
> it is a very small thing to ask that Firefox behave like every other SVG
> renderer on the market.
I tried that already as you will see if you read bug 311569.
You need to log in
before you can comment on or make changes to this bug.
Description
•