Last modified: 2014-11-20 04:16:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22825, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20825 - Change default font for EasyTimeline on zh projects to something that actually has glyphs for Chinese characters
Change default font for EasyTimeline on zh projects to something that actuall...
Status: NEW
Product: Wikimedia
Classification: Unclassified
Site requests (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n, shell
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-26 16:08 UTC by Jimmy Xu
Modified: 2014-11-20 04:16 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jimmy Xu 2009-09-26 16:08:04 UTC
All Chinese characters in the time line would be shown as "□". Seems the "FreeSan.ttf" doesn't contain full UTF-8 character set. Maybe change the font to "ArialMSUnicode.ttf" or something would solve this.

Regards.
Comment 1 Bawolff (Brian Wolff) 2011-02-04 19:32:33 UTC
as of r62018, easy time line supports specifying alternate fonts in LocalSettings.php. Changing to a shell request.

The relevant setting is something like:
$wgTimelineSettings->fontFile = "fontFile.ttf"

probably would also want to update:
$wgTimelineSettings->epochTimestamp = '20081209214953';
to something more recent (Currently specified as above in CommonSettins.php)

fontFile.ttf must be in the path specified by $GDFONTPATH environment variable. (Which i believe for wikimedia is /usr/local/apache/common/fonts .)

As for which fontFile, presumably we already have at least one chinese font installed for the svg renders(?)

See also bug 21497


It might also be interesting idea to change the default font for all wikis to be DejaVu Sans, since that supports significantly more characters than FreeSans afaik, however that might break pre-existing timelines on enwikipedia if they depend on letters to be specific sizes. Should be done with care in any case.
Comment 2 JeLuF 2011-02-10 16:52:08 UTC
Is there a nice *free* font with Chinese characters available? Unfortunately, ArialMSUnicode is non-free.
Comment 3 Bawolff (Brian Wolff) 2011-02-10 19:11:32 UTC
According to [[meta:Svg_fonts]], there should be some at http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/
Comment 4 Mark A. Hershberger 2011-04-04 22:39:35 UTC
Giving to pdhanda who will research good fonts to use and update the config.
Comment 5 Sam Reed (reedy) 2011-07-17 19:27:24 UTC
-shell till a font has been suggested that we can use
Comment 6 Liangent 2011-11-06 04:47:20 UTC
Have a look at http://wenq.org/enindex.cgi
Comment 7 Liangent 2011-11-12 17:21:02 UTC
+shell as WQY fonts are proposed.

WenQuanYi Zenhei is available at
* http://downloads.sourceforge.net/wqy/wqy-zenhei-0.8.38-1.tar.gz or
* http://packages.ubuntu.com/oneiric/ttf-wqy-zenhei

I didn't post Microhei because we're not using Droid fonts for ASCII characters.
Comment 8 Sam Reed (reedy) 2013-05-16 21:26:23 UTC
(In reply to comment #7)
> +shell as WQY fonts are proposed.
> 
> WenQuanYi Zenhei is available at
> * http://downloads.sourceforge.net/wqy/wqy-zenhei-0.8.38-1.tar.gz or
> * http://packages.ubuntu.com/oneiric/ttf-wqy-zenhei
> 
> I didn't post Microhei because we're not using Droid fonts for ASCII
> characters.

http://packages.ubuntu.com/precise/ttf-wqy-zenhei
Comment 9 Sam Reed (reedy) 2013-05-16 21:28:39 UTC
ttf-wqy-zenhei is already installed on the cluster...
Comment 10 Gerrit Notification Bot 2013-05-16 21:33:10 UTC
Related URL: https://gerrit.wikimedia.org/r/64205 (Gerrit Change I3c03bf9b2352a4e577f94ad92d2d38021cf12968)
Comment 11 Liangent 2013-05-17 01:27:45 UTC
(In reply to comment #10)
> Related URL: https://gerrit.wikimedia.org/r/64205 (Gerrit Change
> I3c03bf9b2352a4e577f94ad92d2d38021cf12968)

Sadly this caused all characters in timelines missing, including ASCII characters.
Comment 12 Liangent 2013-05-17 01:31:01 UTC
Are TTC files supported there, or do we need to get TTF files and put them in the configuration file?
Comment 13 Andre Klapper 2013-08-14 16:03:13 UTC
(In reply to comment #11 by Liangent)
> Sadly this caused all characters in timelines missing, including ASCII
> characters.

Liangent: Where could I see this problem? Any testcase?
Comment 14 Liangent 2013-08-14 16:07:45 UTC
(In reply to comment #13)
> (In reply to comment #11 by Liangent)
> > Sadly this caused all characters in timelines missing, including ASCII
> > characters.
> 
> Liangent: Where could I see this problem? Any testcase?

You can paste any EasyTimeline code to a zhwiki page and see it broken (unless that specific EasyTimeline code has been used on zhwiki and got cached. In this case just modify it a bit).
Comment 15 Bawolff (Brian Wolff) 2013-08-14 16:39:43 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > Related URL: https://gerrit.wikimedia.org/r/64205 (Gerrit Change
> > I3c03bf9b2352a4e577f94ad92d2d38021cf12968)
> 
> Sadly this caused all characters in timelines missing, including ASCII
> characters.

This typically means a font file was specified that didn't exist.
Comment 16 Roy Tam 2013-09-22 09:45:20 UTC
I suppose the font(wqy-zenhei.ttc) is broken/missing/unsupported in zhwiki?
Hints from Timeline error message:
Timeline error. Command line was: '/usr/bin/perl' '/usr/local/apache/common-local/php-1.22wmf17/extensions/timeline/EasyTimeline.pl' -i '/tmp/timeline_c6499ee685fd-1' -m -P '/usr/bin/ploticus' -T '/tmp' -A '/wiki/$1' -f 'wqy-zenhei.ttc'
Comment 17 Bawolff (Brian Wolff) 2013-09-22 15:43:28 UTC
(In reply to comment #16)
> I suppose the font(wqy-zenhei.ttc) is broken/missing/unsupported in zhwiki?
> Hints from Timeline error message:
> Timeline error. Command line was: '/usr/bin/perl'
> '/usr/local/apache/common-local/php-1.22wmf17/extensions/timeline/
> EasyTimeline.pl'
> -i '/tmp/timeline_c6499ee685fd-1' -m -P '/usr/bin/ploticus' -T '/tmp' -A
> '/wiki/$1' -f 'wqy-zenhei.ttc'

If there's an error message, more likely means its not font error. Usually font errors just mean timeline with no text on it. Do you have a link to a page with the error.
Comment 18 Roy Tam 2013-09-22 22:28:31 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > I suppose the font(wqy-zenhei.ttc) is broken/missing/unsupported in zhwiki?
> > Hints from Timeline error message:
> > Timeline error. Command line was: '/usr/bin/perl'
> > '/usr/local/apache/common-local/php-1.22wmf17/extensions/timeline/
> > EasyTimeline.pl'
> > -i '/tmp/timeline_c6499ee685fd-1' -m -P '/usr/bin/ploticus' -T '/tmp' -A
> > '/wiki/$1' -f 'wqy-zenhei.ttc'
> 
> If there's an error message, more likely means its not font error. Usually
> font
> errors just mean timeline with no text on it. Do you have a link to a page
> with
> the error.

I tried to make EasyTimeline to show an error in preview, so there is no page that contains such timeline error.

But font error is still exists in various pages like:
https://zh.wikipedia.org/wiki/2013%E5%B9%B4%E5%A4%AA%E5%B9%B3%E6%B4%8B%E9%A2%B1%E9%A2%A8%E5%AD%A3#.E9.A2.A8.E6.9A.B4.E6.99.82.E9.96.93.E8.A1.A8
https://zh.wikipedia.org/wiki/2013%E5%B9%B4%E5%A4%A7%E8%A5%BF%E6%B4%8B%E9%A2%B6%E9%A2%A8%E5%AD%A3#.E9.A2.A8.E6.9A.B4.E6.99.82.E9.96.93.E8.A1.A8
Comment 19 Antoine "hashar" Musso (WMF) 2014-05-14 12:33:17 UTC
We need the font to be copied to whatever GDFONTPATH is set to.  gd (which ploticus uses internally), needs all font files to be in the same directory.  See also https://bugzilla.wikimedia.org/show_bug.cgi?id=37968
Comment 20 Liangent 2014-05-14 13:03:40 UTC
ottomata and hashar helpfully provided the list of fonts available in GDFONTPATH, at https://gist.github.com/ottomata/be2e8f786a3e8d1bcd78 and http://paste.openstack.org/show/80352/ .

A quick evaluation of potential fonts with Chinese characters, identified by size, follows (using equivalent terms in Chinese typography):

unifont-5.1.20080907.ttf: 宋体([[GNU Unifont]])
kochi-mincho.ttf: 宋体(日文)
kochi-gothic.ttf: 黑体(日文)
gkai00mp.ttf: 文鼎PL简中楷
gbsn00lp.ttf: 文鼎PL简报宋
bsmi00lp.ttf: 文鼎PL细上海宋
bkai00mp.ttf: 文鼎PL中楷
(see [[zh:文鼎#捐獻]] for the last four fonts)
Comment 21 Liangent 2014-05-14 13:08:15 UTC
(and see [[Kochi font]] for those Japanese fonts)

I'm submitting a patch to use unifont-5.1.20080907.ttf. This seems like a language-neutural font.
Comment 22 Gerrit Notification Bot 2014-05-14 13:11:00 UTC
Change 133228 had a related patch set uploaded by Liangent:
Set unifont-5.1.20080907.ttf for timeline on ZH projects

https://gerrit.wikimedia.org/r/133228
Comment 23 Gerrit Notification Bot 2014-06-05 18:16:23 UTC
Change 133228 merged by jenkins-bot:
Set unifont-5.1.20080907.ttf for timeline on ZH projects

https://gerrit.wikimedia.org/r/133228
Comment 24 Liangent 2014-06-06 01:06:11 UTC
No luck :( it still appears not working.
Comment 25 Roy Tam 2014-06-06 02:03:04 UTC
(In reply to Liangent from comment #24)
> No luck :( it still appears not working.

I just wonder if that setting is really used?
If it is used, even English chart will use Unifont, which is dual-spaced font.
But instead, FreeSans is still being used from my observation.
Comment 26 Bawolff (Brian Wolff) 2014-06-06 02:48:27 UTC
(In reply to Roy Tam from comment #25)
> (In reply to Liangent from comment #24)
> > No luck :( it still appears not working.
> 
> I just wonder if that setting is really used?
> If it is used, even English chart will use Unifont, which is dual-spaced
> font.
> But instead, FreeSans is still being used from my observation.

The setting only applies to zh projects. It will also only apply to new timelines (where the timeline code has never previously been entered into the wiki)
Comment 27 Roy Tam 2014-06-06 02:49:42 UTC
(In reply to Bawolff (Brian Wolff) from comment #26)
> (In reply to Roy Tam from comment #25)
> > (In reply to Liangent from comment #24)
> > > No luck :( it still appears not working.
> > 
> > I just wonder if that setting is really used?
> > If it is used, even English chart will use Unifont, which is dual-spaced
> > font.
> > But instead, FreeSans is still being used from my observation.
> 
> The setting only applies to zh projects. It will also only apply to new
> timelines (where the timeline code has never previously been entered into
> the wiki)

So preview of timeline is not generated every time I press preview button in edit page?
Comment 28 Andre Klapper 2014-11-15 12:14:23 UTC
No patches left to review here; resetting status.
Comment 29 cYd1PQBLIaA96pBn 2014-11-20 04:16:12 UTC
The Chinese Wikipedia still has trouble with its timeline font, but I can use wqy-zenhei.ttc without problems. The font should be under the GDFONTPATH directory (or change GDFONTPATH). I am not using MediaWiki; I run the PHP file directly, which can be downloaded from
http://www.mediawiki.org/w/index.php?title=Extension:EasyTimeline/installation&oldid=1249585#Download_PHP.2FPERL_scripts

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links