This thread may be reduntant,but I felt may be
useful for newbies..
This thread will give you some tips on supporting
multiple language/fonts.

1.Create a Language resource XML. Lang.xml
<?xml version="1.0" encoding="UTF-8"?>
      <text>Hello World! Cooperate</text>
      <text>Hallo Welt!coopére</text>
2.Locate font.
  For english u don't need to find extra fonts unless
u need more style.
  For other languages,u need to find either a truetype
or type1 font
  For example for Arabic u can use the truetype
(Iqraa.ttf)font downloadble at 
  Store this in your system say at C:\myfonts\ or
  Note:You have to explicitly tell to FOP to use
particular font for rendering other language
datas,otherwise a ? mark appear.
3.Now read the document at docs\html-docs\fonts.html
in your FOP installation carefully.
  This document will tell how to add,embedd a new true
type font.
   For example:
    a.java org.apache.fop.fonts.apps.TTFReader
C:\myfonts\Iqraa.ttf Iqraa.xml
    b.Change your userconfig.xml file 
    <font metrics-file="Iqraa.xml" kerning="yes"
      <font-triplet name="Iqraa" style="normal"
    c.run fop with option -c
4.Now In ur XSL file,try to import particular language
data and store it in a XSL  variable
  For example the below code will store the fr\text
data in a variable called message.
  <xsl:variable name="message"
  <xsl:variable name="font"
5.Now use this in fo:block
  like this <fo:block
Thats it.
  1.With some xsl tricks u can make everything dynamic
without hardcoding any part.
  for example arabic font starts at rightend can be
made dynamic by supplying some tags in Lang.xml

Now the question is UNICODE.Use XMLSPY to edit ur
Lang.xml,for example for japanese version of
Hello world go to http://www.babylon.com/ copy and
paste the japanese word into ur Lang.xml,
XMLSPY will take care of encoding.Sorry for this temp
solution,just to avoid finding each and every unicode
eqvt of other language literals.Any drawbacks?

Please comment if i have made some mistake or hard



http://briefcase.yahoo.com.au - Yahoo! Briefcase
- Save your important files online for easy access!

Reply via email to