xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Ferrando <mikeferra...@yahoo.com>
Subject RE: Big5 Chinese encoded glyphs in a PDF?
Date Thu, 01 May 2003 13:58:20 GMT
Richard,
Ok, I didn't understand that you only wanted them to appear
correctly. The apache site is actually clearer on this than on the
pfm fonts. I have changed the syntax appropriately below for the ttf
embeding.

In this case, Arial has different ttf files for font-style and
font-weight attributes. You will have to generate the each arial font
that you need depending on these attributes in your document. You
will find an example commented out in your userconfig.xml file.
However, I would suggest that you change the value of <font-triplet
name=""> to "Special" so that you don't have to state the different
font family in every instance (bold, italic, bold-italic, etc.) in
your fo code.

Mike F.

===FONT:===
TTF file: arial.ttf

===Create XML file:===
C:\fop>java -cp
build\fop.jar;lib\avalon-framework-cvs-20020806.jar;lib\xml-apis.jar;lib
\xercesImpl-2.2.1.jar;lib\xalan-2.4.1.jar
org.apache.fop.fonts.apps.TTFReader c:\windows\fonts\arial.ttf
arial.xml
 
[the fonts folder could also be located in c:\winnt\fonts]

==Add to userconfig.xml==
<font metrics-file="arial.xml" kerning="yes"
embed-file="c:\windows\fonts\arial.ttf">
  <font-triplet name="Special" style="normal" weight="normal"/>
</font>
<font metrics-file="arialbd.xml" kerning="yes"
embed-file="c:\windows\fonts\arialbd.ttf">
  <font-triplet name="Special" style="normal" weight="bold"/>
</font>


===Change Font-Family value:===
<fo:root font-family="Special">

===Add -c conf\userconfig.xml to Command line:
C:\fop>fop -c conf\userconfig.xml -fo fo-file.fo -pdf pdf-file.pdf


--- Richard Bolen <bolen@GretagMacbeth.com> wrote:
> Are you saying that MingLiU.ttf on Windows XP will not work? 
> That's
> what I'm using currently.  I'm don't care about cut and paste in
> the
> PDF, I just want the correct chinese characters to display in the
> document.  I think I'm embedding everything OK but something is
> happening to my resource bundle data when converting to a PDF.  
> 
> The funny thing is that displaying the data in a webpage works but
> not
> in a pdf.
> 
> Rich
> 
> >>>
> 
> 
> 
> Richard,
> You need to find some pfm/pfb fonts to render your characters into
> PDF
> using FOP. Like the ttf and ttc fonts you will need to create a
> metrics
> file from the pfm font file and then point the font to the pdf file
> in
> your userconfig.xml. (code below)
> 
> It is possible that you might have to *buy* the fonts if you cannot
> get
> them locally or on the web.
> 
> I just figured this out myself, getting the fonts to embed not just
> the
> glyphs but the encoding as well so you can cut and paste from the
> PDF
> document.
> 
> You will notice how the <font> points the embed-file to the PFB
> file not
> the PFM file. Unlike the ttf and ttc files, the file converted to
> xml is
> different than the file you point your embed-file to in the
> userconfig.xml. This had me really stumped for a while.
> 
> Mike F.
> 
> ===FONT:===
> PFM file: p052024l.pfm
> PFB file: p052024l.pdb
> 
> ===Create XML file:===
> C:\fop>java -cp
>
build\fop.jar;lib\avalon-framework-cvs-20020806.jar;lib\xml-apis.jar;lib
> \xercesImpl-2.2.1.jar;lib\xalan-2.4.1.jar
> org.apache.fop.fonts.apps.PFMReader p052024l.pfm p052024l.xml
> 
> ==Add to userconfig.xml==
> <font metrics-file="p052024l.xml" kerning="yes"
> embed-file="p052024l.pfb">
>   <font-triplet name="Special" style="normal" weight="normal"/>
>   <font-triplet name="Special" style="normal" weight="bold"/>
>   <font-triplet name="Special" style="italic" weight="normal"/>
>   <font-triplet name="Special" style="italic" weight="bold"/>
> </font>
> 
> ===Change Font-Family value:===
> <fo:root font-family="Special">
> 
> ===Add -c conf\userconfig.xml to Command line:
> C:\fop>fop -c conf\userconfig.xml -fo fo-file.fo -pdf pdf-file.pdf
> 
> 
> --- Richard Bolen <bolen@GretagMacbeth.com> wrote:
> > I've got a java resource bundle for Traditional Chinese (Taiwan)
> that 
> > is encoded as Big5.  Some of the strings defined in the resource
> end
> > up in
> > a PDF document that is created using FOP.  The same strings are
> > also
> > displayed via a webbrowser as html.  The issue is that the
> strings
> > display properly in the browser using the Traditional Chinese
> > (Big5)
> > encoding but display as garbage in the PDF.
> > 
> > I've tried embedding about 10 different chinese fonts in the PDF
> but
> > nothing has worked.  Does anyone know where I could get a good
> Big5
> > Traditional Chinese font? (or why the characters would display as
> > garbage?)
> > 
> > I'm using UTF-8 as my encoding for my XSL files.  I've seen some
> posts
> > referring to using Big5 as the encoding and 'passing' that to the
> > fo
> > renderer.  How is that done?
> > 
> > Thanks,
> > Rich
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: fop-user-help@xml.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message