W3C home > Mailing lists > Public > www-svg@w3.org > March 2009

Re: How to display a SVG with Chinese text element on mobile phone?

From: Helder Magalh„es <helder.magalhaes@gmail.com>
Date: Mon, 16 Mar 2009 13:50:44 +0000
Message-ID: <2a1ddf8a0903160650y45053437l9d41570d5a229b6e@mail.gmail.com>
To: wangkaiyu <kingble__w@163.com>
Cc: Robin Berjon <robin@berjon.com>, www-svg@w3.org
Hi wangkaiyu,

> Is the file in the correct encoding? If it's not then the Chinese characters
> are likely to show up wrong

Taking Robin's suggestion, I'm attaching a file, based on yours, with
the proper XML namespace declaration and the UTF-8 encoding hint. I've
quickly tested and seems to work as expected in Firefox 3.0.7, Opera
9.64 and Safari 4 (Public beta). ASV 6 (Developer release) only seems
to work if a font with Unicode support is specified (see suggestion
below and/or attachment).

Also, Robin's suggestion of using a SVG font would surely help. If
implementation supports it, I'd suggest that as the best idea. If not,
other things which may be happening (and possible workarounds):
 * Cause: parser may not be compatible with non-ANSI characters
(although the rendering engine may). Workaround: use XML notation [1]
("&#x1234;") for non-ASCII characters;
 * Cause: default font doesn't support Unicode characters. Workaround:
find a font which does and use the "font-family" [2] to force its
usage (the file attached makes use of this). Note that this is pretty
tied to a particular set of devices, as available font names will
vary.

If the suggestions don't put you in the right track, please consider
providing more information. You may also try SVG Developers group [3]
instead, as it's a lot more aimed at general SVG support and questions
then this mailing list. ;-)

Hope this helps,
 Helder Magalh„es

[1] http://www.w3.org/TR/unicode-xml/#Notation
[2] http://www.w3.org/TR/SVG11/text.html#FontFamilyProperty
[3] http://tech.groups.yahoo.com/group/svg-developers/


ChineseCharacters.svg
(image/svg+xml attachment: ChineseCharacters.svg)

Received on Monday, 16 March 2009 13:51:24 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:41 GMT