GNOME Bugzilla – Bug 337979
text size not rendered correctly
Last modified: 2010-05-17 10:33:07 UTC
wikicommons renders this file http://commons.wikimedia.org/wiki/Image:Eulan.svg incorrectly when compared to firefox. I believe they have 2.14.
I think that the major problem is the "font-size:75%". It looks like we're rendering it at ~75 pixels.
*** Bug 351035 has been marked as a duplicate of this bug. ***
SVN TRUNK seems to render this test case properly. Thanks for the bug report.
The 'now properly rendered' is because someone changed the file under the
WikiCommons URL. The correct link would be now
Compare with Firefox and enjoy.
Created attachment 93771 [details]
I'm attaching the file here, hopefully it won't transmogrify again...
Cofirming bug independently and noting a closely related second bug: "em" doesnt render correctly, as with "%" it is not correectly converted to pixels.
Recheck this is correct too?
Wikimedia bug report + samples:
Symptoms - text given as a percentage (75%, 120%) renders as pixels (75px, 120px). Visually this leads to huge (usually black) rectangles on the image (the snipped view of oversize text), and missing text.
Also applies to line separation as in "dx=" and "dy=".
Confirmed still present in 2.26. Same behavior described above.
Created attachment 158163 [details] [review]
font size should be referred to parent element's font-size if the font size unit is percentage.
Comment on attachment 158163 [details] [review]
This patch causes infinite loop...
Created attachment 158275 [details] [review]
Handle em and ex units and avoid infinite loop.
Comment on attachment 158275 [details] [review]
>- _rsvg_css_normalize_length (&state->font_size, ctx,
>- 'v') * PANGO_SCALE / ctx->dpi_y *
>+ _rsvg_css_normalize_font_size (ctx->state, ctx)
>+ * PANGO_SCALE / ctx->dpi_y *
I don't actually think this direct access to ctx->state is good.
Created attachment 158935 [details] [review]
[PATCH 1/3] RsvgState has its parent state to traverse its ancestors
Here are new patch series to avoid direct access to ctx->state.
Created attachment 158936 [details] [review]
[PATCH 2/3] Follow up fix of RsvgState change.
Created attachment 158937 [details] [review]
[PATCH 3/3] Refer to parent's font-size if font-size unit is %, em and ex.
*** Bug 618838 has been marked as a duplicate of this bug. ***