You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Mike Ferrando <mi...@yahoo.com> on 2003/05/01 15:58:20 UTC

RE: Big5 Chinese encoded glyphs in a PDF?

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 <bo...@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 <bo...@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


RE: Big5 Chinese encoded glyphs in a PDF?

Posted by Victor Mote <vi...@outfitr.com>.
Mike Ferrando wrote:

> 1. I see the note about the PFM PFB font files. Sorry.

No apology necessary. Some of this was added/moved recently.

> 2. There is an extra line of syntax in one example that needs to be
> edited.
> java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
>          lib\xercesImpl.jar;lib\xalan.jar
>            org.apache.fop.fonts.apps.TTFReader
>              C:\myfonts\cmr10.ttf C:\myfonts\cmr10.ttf ttfcm.xml
>
> "C:\myfonts\..." is repeated.

I just committed a change to CVS to correct this. It should show up on the
live site in a few days. Thanks for pointing this out.

Victor Mote


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


RE: Big5 Chinese encoded glyphs in a PDF?

Posted by Mike Ferrando <mi...@yahoo.com>.
Victor,
First thanks for your site and your work. I am really excited about
what I have been able to do as a result of the fop site and scripts.
http://xml.apache.org/fop/fonts.html

1. I see the note about the PFM PFB font files. Sorry.

2. There is an extra line of syntax in one example that needs to be
edited.
java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
         lib\xercesImpl.jar;lib\xalan.jar
           org.apache.fop.fonts.apps.TTFReader
             C:\myfonts\cmr10.ttf C:\myfonts\cmr10.ttf ttfcm.xml

"C:\myfonts\..." is repeated.

Thanks,
Mike Ferrando
Washington, DC


--- Victor Mote <vi...@outfitr.com> wrote:
> Mike Ferrando wrote:
> 
> > 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.
> 
> We're working real hard to make sure the Apache site is clear on
> all of it.
> If you can be more specific about what is unclear for the pfm
> fonts, I'll be
> glad to clean it up. Thanks.
> 
> Victor Mote
> 
> 
>
---------------------------------------------------------------------
> 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


RE: Big5 Chinese encoded glyphs in a PDF?

Posted by Victor Mote <vi...@outfitr.com>.
Mike Ferrando wrote:

> 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.

We're working real hard to make sure the Apache site is clear on all of it.
If you can be more specific about what is unclear for the pfm fonts, I'll be
glad to clean it up. Thanks.

Victor Mote


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