Page MenuHomePhabricator

Chinese text in SVG files misplaced and clustered
Open, LowPublic

Description

Author: winstonyin

Description:
Centre-aligned Chinese texts are misplaced, and tb-rl vertical Chinese text is completely clustered into one blob. The former problem is not seen with Latin script texts. SVG files generated using AI or Inkscape have this issue.

Examples:
Problematic Chinese version:
https://commons.wikimedia.org/wiki/File:History_of_the_Universe-zh-hant.svg
English version, no problem (note the vertical text is rotated, not tb-rl):
https://commons.wikimedia.org/wiki/File:History_of_the_Universe.svg
latin caracters no problem
https://commons.wikimedia.org/wiki/File:SFR_Yugoslavia_autoput_sr.svg

Partly addressed by https://bugzilla.gnome.org/show_bug.cgi?id=664533

https://gitlab.gnome.org/GNOME/librsvg/issues/364 "Top-to-bottom text is rendered incorrectly"


Version: wmf-deployment
Severity: normal

Details

Reference
bz63236

Event Timeline

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz63236.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Mar 28 2014, 7:57 PM

Thanks for taking the time to report this! Might need fixing in librsvg which is used for this, but not maintained by Wikimedia maintainers.

Menner updated the task description. (Show Details)Oct 17 2015, 7:12 AM

@Shizhao, per your action, is this also happened on zhwiki?

If yes, a screenshot would be much helpful

@Shizhao: I don't see anything specific about Wikimedia Commons in this task. Hence removing the Commons tag. If there is, please elaborate.

JoKalliauer updated the task description. (Show Details)Jun 21 2018, 9:22 PM
JoKalliauer added a subscriber: JoKalliauer.
Glrx updated the task description. (Show Details)Oct 24 2018, 9:05 PM

The following image is also problematic in the Commons:
https://commons.wikimedia.org/wiki/File:2014%E5%A4%A7%E8%BF%9E%E7%BB%B4%E5%9F%BA%E4%BA%BA%E6%98%A5%E5%AD%A3%E8%80%83%E5%AF%9F%E5%9B%A2%E6%B5%B7%E6%8A%A5%E7%AB%96%E7%89%88.svg
Later I saw GIMP repositery closed a bug recently for similar problem
https://gitlab.gnome.org/GNOME/gimp/issues/2518
In this bug, an user reported WenQuanYi Zen Hei font makes Chinese characters overlapped into one piece if he converted to vertical text layout, then the developer pointed that this font has broken vertical metrics, so they closed it. If we are using this font too, I suggest we should replace it by other approciate font such as Source Han Sans.

The following image is also problematic in the Commons:

For non-Chinese speakers, any chance to explain / show how the image should look in order to not be problematic?

For the records, the SVG file at https://commons.wikimedia.org/wiki/File:2014大连维基人春季考察团海报竖版.svg defines font-family="'FZYXJW--GB1-0'".

Great_Brightstar added a comment.EditedDec 5 2018, 1:39 PM

For non-Chinese speakers, any chance to explain / show how the image should look in order to not be problematic?

OK, in this image you'll see how this image should looks like:
https://commons.wikimedia.org/wiki/File:2014%E5%A4%A7%E8%BF%9E%E7%BB%B4%E5%9F%BA%E4%BA%BA%E6%98%A5%E5%AD%A3%E8%80%83%E5%AF%9F%E5%9B%A2%E6%B5%B7%E6%8A%A5%E7%AB%96.png
The font-family properties refered a non-free font made by Founder Technology (because the font name has "FZ" prefix, which stand for Chinese 方正 Fangzheng), which shouldn't be appeared.

Ah, thanks! I did not compare well, because this is how it looks when I open that image in inkscape-0.92.3-5 using librsvg2-2.44.8-1:

Ah, thanks! I did not compare well, because this is how it looks when I open that image in inkscape-0.92.3-5 using librsvg2-2.44.8-1:

In Inkscape 0.92.3 (2405546, 2018-03-11) on Windows 10 it looks like:


with the command:
inkscape 2014大连维基人春季考察团海报竖.svg --export-png=2014大连维基人春季考察团海报竖.png

@Aklapper : Does Inkscape use librsvg?
@RazrFalcon Said Inkscape has it's own rendering backend.
https://phabricator.wikimedia.org/T40010#4443804

@Aklapper, @JoKalliauer, which fonts you have been used?

@Great_Brightstar :
I used the current (02:11, 21. Mär. 2014 idenical to first) svg:
https://upload.wikimedia.org/wikipedia/commons/archive/5/5a/20140321020128%212014%E5%A4%A7%E8%BF%9E%E7%BB%B4%E5%9F%BA%E4%BA%BA%E6%98%A5%E5%AD%A3%E8%80%83%E5%AF%9F%E5%9B%A2%E6%B5%B7%E6%8A%A5%E7%AB%96%E7%89%88.svg

The svg uses: font-family="'FZYXJW--GB1-0'"
I don't know which fallbackfont inkscape used, and I don't know how to find out (except of trying and comparing resulsts).

@Aklapper : Does Inkscape use librsvg?

Uh! librsvg is not listed as a dependency of inkscape. I never realized that! Thanks a lot!
Alright, so with librsvg2-2.44.8-1 (that is a newer version which is NOT yet on Wikimedia servers, see https://phabricator.wikimedia.org/T193352 ):

Great_Brightstar added a comment.EditedDec 5 2018, 6:11 PM

I don't know which fallbackfont inkscape used, and I don't know how to find out (except of trying and comparing resulsts).

The most simple way to find out is opening %windir%/Fonts directly, where will show you the preview of fonts, then pick up which fonts could be used.

@Aklapper : Does Inkscape use librsvg?

Uh! librsvg is not listed as a dependency of inkscape. I never realized that! Thanks a lot!
Alright, so with librsvg2-2.44.8-1 (that is a newer version which is NOT yet on Wikimedia servers, see https://phabricator.wikimedia.org/T193352 ):

The vertical text layout looks still not so good, it would be nice if librsvg has some entries to configure the fonts.