Page MenuHomePhabricator

Correct rendering of ViewAPC for non-latin characters
Closed, DeclinedPublic

Description

Author: fryedpeach

Description:
Extension:APC doesn't properly generate a statics image in Japanese characters (probably other non-latin characters too). See http://translatewiki.net/wiki/File:ViewAPC.png for example. It is a partial screenshot of Special:ViewAPC (a special page showing APC statics) showing the bottom table titled "Detailed memory usage and fragmentation" ("メモリ使用および断片化の詳細" in Japanese) there. It shows some broken characters after arabic numerals the in statics image. Correctly, they would be "キロバイト" or some other Japanese text. Compare the text message below the image. Please display http://translatewiki.net/wiki/Special:ViewAPC in various language settings.

It will need a sophisticated way for drawing localized texts to images in MediaWiki.

Details

Reference
bz17125

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:25 PM
bzimport set Reference to bz17125.
bzimport added a subscriber: Unknown Object (MLST).

The basic problem is that the text-drawing routine used (imagestring()) only supports 8-bit fonts.

Unicode strings can be drawn with imagestringttf(), but a font file would need to be provided with sufficient coverage for whatever language(s) might be selected.

Best fix is probably to replace the server-side GD drawing with client-side drawing -- let the browser deal with the text -- or export to SVG and then run through the standard SVG transforms, letting whatever font configuration has been set up for SVG still happen there.

Krinkle set Security to None.

According to https://www.mediawiki.org/wiki/Extension:APC , this extension has been archived years ago, hence also declining its open tasks.