Page MenuHomePhabricator

librsvg misinterpret quoted font family names that contain whitespaces
Closed, ResolvedPublic

Description

File:Meta SVG fonts.svg

When specifying a font family with whitespaces it is recommended to escaping this in quotes, but the SVG rendering engine couldn't interpret this.

https://www.w3.org/TR/SVG/text.html#FontFamilyProperty
http://www.w3.org/TR/CSS2/fonts.html#font-family-prop

(Here the attached file source without quotes [[:file:Meta_SVG_fonts.svg]], one with CSS and one with SVG own property)

Update
Reopened (2017-05-20) as the upstream fix included in librsvg 2.40.10. was only for the CSS property.


Version: unspecified
Severity: normal
See Also:
https://gitlab.gnome.org/GNOME/librsvg/issues/319
T25643: Allow alternative declaration of SVG fonts (font-family="'FontName-Bold'" in addition to: font-family="Font name" font-weight="bold")

Attached:

CSS property fixed
SVG attribute not fixed

Details

Reference
bz62987

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:56 AM
bzimport set Reference to bz62987.
bzimport added a subscriber: Unknown Object (MLST).
Menner set Security to None.
Aklapper subscribed.

Fixed in upstream librsvg; patch will be included in librsvg 2.40.10.

Aklapper changed the task status from Open to Stalled.Aug 9 2015, 3:53 PM

Fix included in version 2.40.10 which got released now. Now need to backport or need to wait for the distribution used on Wikimedia servers to provide that version....

That bug is fixed on the new jessie image scaler using 2.4.16 (tested locally, it's not yet pooled into the set of active scalers in production).
I have scaled 20140308165757_Test.svg on the new and the present image scalers and put the results at https://people.wikimedia.org/~jmm/svg/ :

whitespace-new.png : Result with new librsvg
whitespace-old.png : Result with old librsvg

The image scalers are now using 2.40.16 containing th upstream fix.

Anyway the disfunction is still present if not CSS but on SVG attribute font-family.

@Perhelion: Does that mean https://bugzilla.gnome.org/show_bug.cgi?id=739329 should be reopened? If not, would you please file a separate task?

@Perhelion: Does that mean https://bugzilla.gnome.org/show_bug.cgi?id=739329 should be reopened? If not, would you please file a separate task?

@Aklapper: Yes the bug upstream should be reopened, I commented there.

Merged from T184369

If you use (quote and double-quote)

font-family="'font name'"

instead of

font-family="font name"

or

font-family='font name'

Wiki-Parser don't notice the correct font.
By default Inkscape adds ' ' if the font name has a space like in "Liberation Serif" or "DejaVu Sans" like style="font-family:'Bitstream Charter'"
Scour changes it to: font-family="'Bitstream Charter'" which doesn't help.

BugReport-Example:
T184369.svg (filelink)
Rendered by Wiki-Parser:

T184369.svg.png (210×1 px, 51 KB)

Converted by Inkscape:
MediaWiki_SVG_font_list_serif.png (210×1 px, 109 KB)

Examples:

@Aklapper : I merged it here, because this was the first time reported, but I think T184369 pointed it out more clearly, was easier to understand, faster to see, included a rendered example,... Should descriptions be updated, if they can be improved? (I think in bugreports it is unimportant who repots it, it is important that you can see the problem in few seconds and the description should be understandable by laypersons on Commons. Since I did here too many mistakes the last days, would you do that for me or/and explain?

Gnome closed issue 319 on 23 August 2018 with commit https://gitlab.gnome.org/GNOME/librsvg/commit/3d84acca9c11482cb0d2f75d379086be21bd4c91

So bug is presumably fixed in Rust-version of librsvg but MW blocked on installing Rust version.

JoKalliauer changed the task status from Open to Stalled.Jun 30 2021, 3:04 PM
JoKalliauer moved this task from Backlog to update librsvg on the Wikimedia-SVG-rendering board.
JoKalliauer claimed this task.

it seems to be fixed