Wednesday, March 28, 2007

Displaying multilingual text in SVG using Firefox

In Khem's tree editor, SVG is used for displaying tree in Firefox. Firefox 2.x on Windows XP can display English text and Thai text in SVG correctly. But when I try to use Firefox 2.x on Mac OS X, Thai, Bengari and Chinese text became a box as shown below. firefox screenshot
(using this following code) <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"> <text x="50" y="50" font-size="16" fill="blue" > Wikipedia 維基百科 วิกิพีเดีย উইকিপিডিয়া </text> </svg>
Thus, I try to assign a font family to the text as the following code:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"> <text x="50" y="50" font-family="Garuda" font-size="16" fill="blue" > Wikipedia 維基百科 วิกิพีเดีย উইকিপিডিয়া </text> </svg>
It works. Firefox can display Thai text correctly. However, Firefox still cannot display Bangari text and Chinese text. As shown below. firefox screenshot I try to use other font families, i.e. Times, Sans and Helvetica but only English text can be displayed.

5 comments:

apirak said...

ตอนเด็กๆ เคยศึกษา svg แล้วทำเอกสารเอาไว้ เผื่อใครอยากสานต่อ ลองเข้าไปดูนะครับ

http://homepage.mac.com/apirak/bank/mydoc/svg/index.html

veer said...

thx :-)

apirak said...

ลองแบบนี้่ดู

http://www.thaimacdev.com/downloads/thai.svg

veer said...

ก็ยังไม่ออกอยู่ดีครับ
ทั้ง GNU/Linux และ Mac OS X

Shane said...

Thanks for the tip

Creative Commons License
This workis licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.