Page MenuHomePhabricator

librsvg misinterpret quoted font family names that contain whitespaces
Open, NormalPublic

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

StatusAssignedTask
OpenNone
StalledNone
OpenNone
ResolvedMoritzMuehlenhoff
ResolvedKrenair
Resolved AlexMonk-WMF
Resolvedfgiunchedi
Resolved AlexMonk-WMF
ResolvedKrenair
Resolvedfgiunchedi
ResolvedKrenair
DeclinedNone
Resolvedmobrovac
ResolvedKrinkle
ResolvedKartikMistry
ResolvedKartikMistry
Resolvedbd808
InvalidNone
DeclinedNone
Resolved dduvall
Resolved dduvall

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:56 AM
bzimport set Reference to bz62987.
bzimport added a subscriber: Unknown Object (MLST).
Menner updated the task description. (Show Details)May 15 2015, 9:07 AM
Menner set Security to None.
Aklapper added a subscriber: Aklapper.

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

MoritzMuehlenhoff closed this task as Resolved.Jul 7 2016, 1:51 PM

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 reopened this task as Open.May 20 2017, 11:28 AM

@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.

Perhelion updated the task description. (Show Details)May 21 2017, 6:55 AM
Perhelion updated the task description. (Show Details)May 21 2017, 6:58 AM
MoritzMuehlenhoff removed MoritzMuehlenhoff as the assignee of this task.Jul 17 2017, 8:56 AM

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:


Converted by Inkscape:

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?

Aklapper updated the task description. (Show Details)Jul 18 2018, 10:19 PM
Aklapper removed a subscriber: wikibugs-l-list.
Niridya updated the task description. (Show Details)Jul 19 2018, 12:06 PM
Aklapper updated the task description. (Show Details)Aug 4 2018, 8:22 AM
Glrx updated the task description. (Show Details)Aug 4 2018, 2:02 PM
Liuxinyu970226 added a subscriber: Liuxinyu970226.
Glrx added a comment.Oct 30 2018, 4:39 PM

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.