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 Moriguchi Akihiro <bl...@gmail.com> on 2009/05/04 13:12:02 UTC

Japanese PDF mojibake

Hello,

I'm just start using fop 0.95 to generate Japanese PDF on Mac OS 10.5.6.
But I can't generate Japanese included PDF.
I now know using configuration file without generating font metrics.
Does I need some font specification on fo file or something?
Or some Mac specific modification?

My cfg.xml is like this.
<renderer mime="application/pdf">
        <fonts>
                <directory recursive="true">/Library/Fonts/</directory>
                <directory recursive="true">/System/Library/Fonts/</directory>
                <directory
recursive="true">/opt/local/share/fonts/</directory>  <- port
installed ttf font and self installed ipa ttf fonts
                <auto-detect/>
        </fonts>
</renderer>

Then I compiled pdf like this.
fop -c ~/.fop/cfg.xml -fo japanese.fo -pdf japanese.pdf

I also tried test-japanese.fo but no good.
http://www.nabble.com/FOP-supports-the-Japanese-characters--td8439175.html#a8439175

Please give some advise.

Akihiro Moriguchi

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


Re: Japanese PDF mojibake

Posted by Moriguchi Akihiro <bl...@gmail.com>.
>>
>> Sorry, cfg2.xml is font embeded config that Vincent suggested.
>
> The XML that Vincent suggested needs to be added to fop.xconf file and
> then fop.xconf file is referenced from command line with -c option.
>
Thanks you very much for your support.
Incorporating cfg2.xml into fop.xconf makes fop work correctly.
Now I can see Japanese on my PDF. Great!

I appreciate all of your help.

Best
Akihiro Moriguchi

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


Re: Japanese PDF mojibake

Posted by Chris Bowditch <bo...@hotmail.com>.
Moriguchi Akihiro wrote:

<snip/>

> Thanks for your support.
> I attached my config cfg.xml and cfg2.xml and system wide config to this post.

Thanks. cfg2.xml is not a valid FOP configuration File.

> 
> 
>>>Same as previous errors.
>>>catch22:manual catch22$ /opt/fop-trunk/fop  -c ~/.fop/cfg2.xml -fo
>>
>>I notice that the config file in use is ~/.fop/cfg2.xml not want you
>>state above. Please check that the font is configured correctly in
>>cfg2.xml and if it appears correct to you then please attach the
>>complete file to the e-mail (not C&P the content)
>>
> 
> Sorry, cfg2.xml is font embeded config that Vincent suggested.

The XML that Vincent suggested needs to be added to fop.xconf file and 
then fop.xconf file is referenced from command line with -c option.

> 
> I also tried to generate font metric file with TTFReader but I
> couldn't for some errors.
> Does that matters to generate PDF?

It is not necessary to generate the Font metrics in v0.95 and later.

<snip/>

Thanks,

Chris



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


Re: Japanese PDF mojibake

Posted by Moriguchi Akihiro <bl...@gmail.com>.
>> My config is default /opt/fop-trunk/conf/fop.xconf and local
>> ~/.fop/cfg.conf which pasted on previous post.
>
> Vincent wanted you to attach the file to the e-mail. All we have seen in
> previous e-mails is part of the contents of this file C&P. We need to
> see the entire file, so please attach it.

Thanks for your support.
I attached my config cfg.xml and cfg2.xml and system wide config to this post.

>> Same as previous errors.
>> catch22:manual catch22$ /opt/fop-trunk/fop  -c ~/.fop/cfg2.xml -fo
>
> I notice that the config file in use is ~/.fop/cfg2.xml not want you
> state above. Please check that the font is configured correctly in
> cfg2.xml and if it appears correct to you then please attach the
> complete file to the e-mail (not C&P the content)
>
Sorry, cfg2.xml is font embeded config that Vincent suggested.

I also tried to generate font metric file with TTFReader but I
couldn't for some errors.
Does that matters to generate PDF?

Best regards,
Akihiro Moriguchi

Re: Japanese PDF mojibake

Posted by Chris Bowditch <bo...@hotmail.com>.
Moriguchi Akihiro wrote:

> Hello,

Hi,

<snip/>

>>Since we always miss the most obvious, maybe you can double-check the
>>following points:
>>- are you sure you use the right configuration file?
> 
> My config is default /opt/fop-trunk/conf/fop.xconf and local
> ~/.fop/cfg.conf which pasted on previous post.

Vincent wanted you to attach the file to the e-mail. All we have seen in 
previous e-mails is part of the contents of this file C&P. We need to 
see the entire file, so please attach it.

> 
> 
>>- are you sure the font is at the right place, and that it is accessible
>>  (read rights enabled for the file and the directory)?
> 
> I checked the file and directory and confirmed granted read permission on them.
> 
> 
>>If you’re stuck you can try manually configuring the font and see how it
>>goes:
>>    <font embed-url="file:///the/path/to/ipag.ttf">
>>      <font-triplet name="IPAGothic" style="normal" weight="normal"/>
>>    </font>
> 
> Same as previous errors.
> catch22:manual catch22$ /opt/fop-trunk/fop  -c ~/.fop/cfg2.xml -fo

I notice that the config file in use is ~/.fop/cfg2.xml not want you 
state above. Please check that the font is configured correctly in 
cfg2.xml and if it appears correct to you then please attach the 
complete file to the e-mail (not C&P the content)

> japanese2.fo -pdf japanese2.pdf
> May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
> WARNING: Font "IPAGothic,normal,400" not found. Substituting with
> "any,normal,400".
> May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
> WARNING: Glyph "?" (0x65e5) not available in font "Times-Roman".
> May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
> WARNING: Glyph "?" (0x672c) not available in font "Times-Roman".
> May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
> WARNING: Glyph "?" (0x8a9e) not available in font "Times-Roman".
> May 5, 2009 9:18:55 PM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
> SEVERE: Couldn't find hyphenation pattern ja

Thanks,

Chris



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


Re: Japanese PDF mojibake

Posted by Moriguchi Akihiro <bl...@gmail.com>.
Hello,

> I’ve just managed to produce a working PDF file using your sample FO
> file and the IPAGothic font, so FOP (both 0.95 and Trunk) is definitely
> able to handle that font.
Thanks for your confirmation.

> Since we always miss the most obvious, maybe you can double-check the
> following points:
> - are you sure you use the right configuration file?
My config is default /opt/fop-trunk/conf/fop.xconf and local
~/.fop/cfg.conf which pasted on previous post.

> - are you sure the font is at the right place, and that it is accessible
>   (read rights enabled for the file and the directory)?
I checked the file and directory and confirmed granted read permission on them.

> If you’re stuck you can try manually configuring the font and see how it
> goes:
>     <font embed-url="file:///the/path/to/ipag.ttf">
>       <font-triplet name="IPAGothic" style="normal" weight="normal"/>
>     </font>
Same as previous errors.
catch22:manual catch22$ /opt/fop-trunk/fop  -c ~/.fop/cfg2.xml -fo
japanese2.fo -pdf japanese2.pdf
May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "IPAGothic,normal,400" not found. Substituting with
"any,normal,400".
May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0x65e5) not available in font "Times-Roman".
May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0x672c) not available in font "Times-Roman".
May 5, 2009 9:18:55 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0x8a9e) not available in font "Times-Roman".
May 5, 2009 9:18:55 PM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
SEVERE: Couldn't find hyphenation pattern ja

Best regards,
Akihiro Moriguchi

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


Re: Japanese PDF mojibake

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi,

I’ve just managed to produce a working PDF file using your sample FO
file and the IPAGothic font, so FOP (both 0.95 and Trunk) is definitely
able to handle that font.
Since we always miss the most obvious, maybe you can double-check the
following points:
- are you sure you use the right configuration file?
- are you sure the font is at the right place, and that it is accessible
  (read rights enabled for the file and the directory)?

If you’re stuck you can try manually configuring the font and see how it
goes:
    <font embed-url="file:///the/path/to/ipag.ttf">
      <font-triplet name="IPAGothic" style="normal" weight="normal"/>
    </font>

You may want to attach your complete configuration file so that we can
have a look.


HTH,
Vincent


Moriguchi Akihiro wrote:
> Good morning all,
> 
>> I'm just start using fop 0.95 to generate Japanese PDF on Mac OS 10.5.6.
>> But I can't generate Japanese included PDF.
>> I now know using configuration file without generating font metrics.
>> Does I need some font specification on fo file or something?
>> Or some Mac specific modification?
>>
> I have a little progress.
> 
> I got following errors.
> catch22:manual catch22$ fop -c ~/.fop/cfg.xml -fo japanese2.fo -pdf
> japanese2.pdf
> May 5, 2009 10:05:44 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
> WARNING: Font 'IPAGothic,normal,400' not found. Substituting with
> 'any,normal,400'.
> May 5, 2009 10:05:44 AM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
> SEVERE: Couldn't find hyphenation pattern ja
> 
> I think IPAGothic font doesn't correctly identified by fop but I don't
> know how to do.
> I changed my config to following.
>  <renderer mime="application/pdf">
>          <fonts>
>                  <directory
> recursive="true">/opt/local/share/fonts/mixfont/fonts</directory>
>                  <auto-detect/>
>          </fonts>
> </renderer>
> 
> The directory /opt/local/share/fonts/mixfont/fonts is the place
> ipag.ttf reside which downloaded from
> http://mix-mplus-ipa.sourceforge.jp/download.html and unpucked and
> copyed to the place.
> 
> And I changed my font-family and font-weight of my fo file I attached
> with this mail into "IPAGothic" and "normal."
> 
> I also used svn version but got same warning.
> 
> My fo file is generated by xsltproc from a XML edited by XXE.


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


Re: Japanese PDF mojibake

Posted by Moriguchi Akihiro <bl...@gmail.com>.
Good morning all,

> I'm just start using fop 0.95 to generate Japanese PDF on Mac OS 10.5.6.
> But I can't generate Japanese included PDF.
> I now know using configuration file without generating font metrics.
> Does I need some font specification on fo file or something?
> Or some Mac specific modification?
>
I have a little progress.

I got following errors.
catch22:manual catch22$ fop -c ~/.fop/cfg.xml -fo japanese2.fo -pdf
japanese2.pdf
May 5, 2009 10:05:44 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'IPAGothic,normal,400' not found. Substituting with
'any,normal,400'.
May 5, 2009 10:05:44 AM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
SEVERE: Couldn't find hyphenation pattern ja

I think IPAGothic font doesn't correctly identified by fop but I don't
know how to do.
I changed my config to following.
 <renderer mime="application/pdf">
         <fonts>
                 <directory
recursive="true">/opt/local/share/fonts/mixfont/fonts</directory>
                 <auto-detect/>
         </fonts>
</renderer>

The directory /opt/local/share/fonts/mixfont/fonts is the place
ipag.ttf reside which downloaded from
http://mix-mplus-ipa.sourceforge.jp/download.html and unpucked and
copyed to the place.

And I changed my font-family and font-weight of my fo file I attached
with this mail into "IPAGothic" and "normal."

I also used svn version but got same warning.

My fo file is generated by xsltproc from a XML edited by XXE.