After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337979 - text size not rendered correctly
text size not rendered correctly
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
: 351035 618838 (view as bug list)
Depends on:
Blocks: 403546
 
 
Reported: 2006-04-10 17:23 UTC by Ralf Stephan
Modified: 2010-05-17 10:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample file (9.90 KB, image/svg+xml)
2007-08-16 08:33 UTC, Emmanuel Pacaud
  Details
Fix (3.12 KB, patch)
2010-04-08 03:41 UTC, Hiroyuki Ikezoe
needs-work Details | Review
Fix v2 (3.31 KB, patch)
2010-04-09 11:35 UTC, Hiroyuki Ikezoe
needs-work Details | Review
[PATCH 1/3] RsvgState has its parent state to traverse its ancestors (7.91 KB, patch)
2010-04-17 04:36 UTC, Hiroyuki Ikezoe
committed Details | Review
[PATCH 2/3] Follow up fix of RsvgState change. (20.12 KB, patch)
2010-04-17 04:37 UTC, Hiroyuki Ikezoe
committed Details | Review
[PATCH 3/3] Refer to parent's font-size if font-size unit is %, em and ex. (3.22 KB, patch)
2010-04-17 04:37 UTC, Hiroyuki Ikezoe
committed Details | Review

Description Ralf Stephan 2006-04-10 17:23:08 UTC
wikicommons renders this file http://commons.wikimedia.org/wiki/Image:Eulan.svg incorrectly when compared to firefox. I believe they have 2.14.
Comment 1 Dominic Lachowicz 2006-04-23 02:11:33 UTC
I think that the major problem is the "font-size:75%". It looks like we're rendering it at ~75 pixels.
Comment 2 Dominic Lachowicz 2006-08-23 13:08:01 UTC
*** Bug 351035 has been marked as a duplicate of this bug. ***
Comment 3 Dominic Lachowicz 2007-07-20 17:46:53 UTC
SVN TRUNK seems to render this test case properly. Thanks for the bug report.
Comment 4 Ralf Stephan 2007-08-16 06:53:33 UTC
The 'now properly rendered' is because someone changed the file under the
WikiCommons URL. The correct link would be now
http://upload.wikimedia.org/wikipedia/commons/archive/5/55/20070517184336%21Eulan.svg

Compare with Firefox and enjoy.
Comment 5 Emmanuel Pacaud 2007-08-16 08:33:26 UTC
Created attachment 93771 [details]
Sample file

I'm attaching the file here, hopefully it won't transmogrify again...
Comment 6 FT2 2008-03-26 04:03:25 UTC
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:
https://bugzilla.wikimedia.org/show_bug.cgi?id=13494
Comment 7 FT2 2008-03-26 04:07:26 UTC
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=".
Comment 8 Scott Tincman 2010-04-07 19:40:16 UTC
Confirmed still present in 2.26. Same behavior described above.
Comment 9 Hiroyuki Ikezoe 2010-04-08 03:41:03 UTC
Created attachment 158163 [details] [review]
Fix

font size should be referred to parent element's font-size if the font size unit is percentage.
Comment 10 Hiroyuki Ikezoe 2010-04-08 11:44:27 UTC
Comment on attachment 158163 [details] [review]
Fix

This patch causes infinite loop...
Comment 11 Hiroyuki Ikezoe 2010-04-09 11:35:59 UTC
Created attachment 158275 [details] [review]
Fix v2

Handle em and ex units and avoid infinite loop.
Comment 12 Hiroyuki Ikezoe 2010-04-17 04:34:30 UTC
Comment on attachment 158275 [details] [review]
Fix v2

>-                                     _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 *
>                                      72);

I don't actually think this direct access to ctx->state is good.
Comment 13 Hiroyuki Ikezoe 2010-04-17 04:36:30 UTC
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.
Comment 14 Hiroyuki Ikezoe 2010-04-17 04:37:04 UTC
Created attachment 158936 [details] [review]
[PATCH 2/3] Follow up fix of RsvgState change.
Comment 15 Hiroyuki Ikezoe 2010-04-17 04:37:43 UTC
Created attachment 158937 [details] [review]
[PATCH 3/3] Refer to parent's font-size if font-size unit is %, em and ex.
Comment 17 Hiroyuki Ikezoe 2010-05-17 10:33:07 UTC
*** Bug 618838 has been marked as a duplicate of this bug. ***