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 mpanhuijsen <Ma...@SDLTRIDION.COM> on 2009/01/27 11:59:01 UTC

Japanese characters do not appear in PDF

Hello,

I'm trying to make Japanese characters appear in my (otherwise English)
documentation.

Here's what I've been doing and what the results are:
* I run Windows XP and have installed East Asian language support.
* I have Japanese Unicode fonts such as Arial Unicode MS on my computer.
* I see Japanese characters appear in XHTML output I produce from the same
source.
* The input I offer to FOP has its encoding set to UTF-8.
* I have a FOP configuration file that imports all my system fonts, and I
can use fonts normally. FOP config fragment:

      <fonts>
              <!-- automatically detect operating system installed fonts -->
              <!-- register all the fonts found in a directory -->
	       <directory>C:\WINDOWS\FONTS</directory>	  
               <auto-detect/>
               ....

* I set the font of my Japanese piece of content to font-family="Arial"
(which I guess should include Arial Unicode MS). FOP input fragment:

<fo:block font-size="10pt" font-family="Arial" line-height="12pt"
text-indent="0em" space-before="0.6em" space-after="0.6em">[[JAPANESE
CHARACTERS GO HERE]] (Japanese)</fo:block>

But when I use FOP to generate the PDF, it shows me squares for the Japanese
characters in both Adobe Acrobat and Adobe Reader.

Can anyone tell me what I might be doing wrong?

Thanks,

Mathijs


-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21683276.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Japanese characters do not appear in PDF

Posted by mpanhuijsen <Ma...@SDLTRIDION.COM>.
Sure, here is a fairly minimal PDF showing the problem.

http://www.nabble.com/file/p21722890/Example.pdf Example.pdf 

It's the last page that is interesting.

Thanks for your help,

Mathijs Panhuijsen


Andreas Delmelle-2 wrote:
> 
> On 28 Jan 2009, at 09:33, mpanhuijsen wrote:
> 
>>>> Try specifying font-family="Arial Unicode MS".
>>>> Chances are that you also have a 'basic' Arial font on your system,
>>>> for which the glyphs are limited.
>>>
>>> I did, but the font reverts back to Times New Roman, with the  
>>> Japanese
>>> characters now showing up as # characters. I also tried  
>>> "ArialUnicodeMS"
>>> to no avail.
> 
> Sorry, my bad. Now I suddenly see what you mean by 'square'  
> characters. If the regular Arial font were used by FOP, then you would  
> get the # as well. The fact that you see squares is a sign that FOP is  
> using the correct font (i.e. it finds glyphs for the Japanese  
> characters).
> 
> I'm beginning to wonder whether this is not a Little-vs.-Big-Endian  
> kind of issue, where the bytes are not interpreted in the order they  
> are written. It seems like the viewer application interprets the  
> codepoint values incorrectly (?)
> Either that or the viewer in its turn reverts back to the standard  
> Arial font, which does not have all the glyphs.
> 
> Which reader are you using? (Adobe, GhostScript) Did you try others?
> Can you send us a small PDF, so we can check it?
> 
> Thanks in advance,
> 
> 
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21722890.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Japanese characters do not appear in PDF

Posted by Andreas Delmelle <an...@telenet.be>.
On 28 Jan 2009, at 09:33, mpanhuijsen wrote:

>>> Try specifying font-family="Arial Unicode MS".
>>> Chances are that you also have a 'basic' Arial font on your system,
>>> for which the glyphs are limited.
>>
>> I did, but the font reverts back to Times New Roman, with the  
>> Japanese
>> characters now showing up as # characters. I also tried  
>> "ArialUnicodeMS"
>> to no avail.

Sorry, my bad. Now I suddenly see what you mean by 'square'  
characters. If the regular Arial font were used by FOP, then you would  
get the # as well. The fact that you see squares is a sign that FOP is  
using the correct font (i.e. it finds glyphs for the Japanese  
characters).

I'm beginning to wonder whether this is not a Little-vs.-Big-Endian  
kind of issue, where the bytes are not interpreted in the order they  
are written. It seems like the viewer application interprets the  
codepoint values incorrectly (?)
Either that or the viewer in its turn reverts back to the standard  
Arial font, which does not have all the glyphs.

Which reader are you using? (Adobe, GhostScript) Did you try others?
Can you send us a small PDF, so we can check it?

Thanks in advance,


Andreas

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


Re: Japanese characters do not appear in PDF

Posted by mpanhuijsen <Ma...@SDLTRIDION.COM>.

Hello


Andreas Delmelle-2 wrote:
> 
> On 27 Jan 2009, at 11:59, mpanhuijsen wrote:
> 
> Hi
> 
>> <snip />
> 
> <snip />
>>
> 
>>Try specifying font-family="Arial Unicode MS".
>>Chances are that you also have a 'basic' Arial font on your system,  
>>for which the glyphs are limited.
> 
> I did, but the font reverts back to Times New Roman, with the Japanese
> characters now showing up as # characters. I also tried "ArialUnicodeMS"
> to no avail.
> 
>>Andreas
> 
> Mathijs
> 
> 

-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21701500.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Japanese characters do not appear in PDF

Posted by Andreas Delmelle <an...@telenet.be>.
On 27 Jan 2009, at 11:59, mpanhuijsen wrote:

Hi

> <snip />

>
> * I set the font of my Japanese piece of content to font- 
> family="Arial"
> (which I guess should include Arial Unicode MS). FOP input fragment:

Try specifying font-family="Arial Unicode MS".
Chances are that you also have a 'basic' Arial font on your system,  
for which the glyphs are limited.

In current FOP trunk, it is possible to specify a substitution/mapping  
in the config file(*), which would map "Arial" to "Arial Unicode MS",  
but AFAIK, they're in fact two different fonts...

(*) see: http://xmlgraphics.apache.org/fop/trunk/fonts.html#substitution

HTH!

Andreas

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


RE: Japanese characters do not appear in PDF

Posted by mpanhuijsen <Ma...@SDLTRIDION.COM>.
Hello,

First off, thanks for telling me about Babelpad, I'm downloading it as we
speak.

Secondly, here is the .fo file from which the PDF is generated.
http://www.nabble.com/file/p21724347/Example.fo Example.fo 

If I open this file in Notepad, I see the Japanese characters I expect to
see.

So it seems that FOP is itself the problem. Maybe this is a good time to
point out I'm running version 0.94 of FOP.

Mathijs.




Pascal Sancho wrote:
> 
> Hi,
> 
> After a copy/paste of the 3 japanese characters into babelpad (full
> unicode editor with character analysis), I can read that the 3 caracters
> are all U+FFFF, witch is outside all Unicode scripts for Japanese (see
> [1])
> You should check what characters are actually sent to FOP in the XSL-FO
> file.
> 
> HTH,
> Pascal
> 
> [1] http://www.unicode.org/versions/Unicode4.0.0/ch11.pdf
> 
>> -----Message d'origine-----
>> De : mpanhuijsen [mailto:Mathijs.Panhuijsen@SDLTRIDION.COM] 
>> Envoyé : jeudi 29 janvier 2009 09:51
>> 
>> Sure, here is a fairly minimal PDF showing the problem.
>> http://www.nabble.com/file/p21722890/Example.pdf Example.pdf 
>> It's the last page that is interesting.
>> 
>> Thanks for your help,
>> Mathijs Panhuijsen
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21724347.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Japanese characters do not appear in PDF

Posted by mpanhuijsen <Ma...@SDLTRIDION.COM>.
Upgraded to FOP 0.95, set my Java heap size to 1 GB, and viola [sic], that
did the trick.

Thanks for your help, I'm glad this is over with.

Thanks again,
Mathijs



Andreas Delmelle-2 wrote:
> 
> On 29 Jan 2009, at 18:46, mpanhuijsen wrote:
> 
> Hi Mathijs
> 
>> I tried the following:
>>
>> -Change every reference to my default font from Verdana into  
>> ARIALUNI (the
>> name of the .ttf file).
>> -Create a dir c:\myfonts\ and copy ARIALUNI.ttf and ARIALUNI.xml  
>> (generated
>> metric font file) into it
>> -Remove autodetect from my fop config file.
>> -Added the following fragment:
> 
> Can you try again with FOP 0.95 (using the setup as mentioned in your  
> initial post), and see if the issue persists?
> 
> Looking at your FO file, the correct characters/codepoints are used  
> there, so that cannot be the problem.
> 
>>          <font-triplet name="ARIALUNI" style="normal"  
>> weight="normal"/>
>>
>>
>> And still I'm seeing the Serif font and no Japanese characters.
> 
> Yes, now you get the # character again, which means FOP cannot find  
> the glyphs for the characters in the used font. This means that  
> ARIALUNI.ttf is not properly registered. You should at least see a  
> warning about FOP falling back to Serif during processing.
> 
> The reason could be that <font-triplet /> alone is not enough. Did you  
> forget to paste a piece of the config-file? (the surrounding   
> element?)
> 
> Another thing to look out for (if you have used FOP 0.20.5 in the  
> past) is that font-configuration should be specified in the config- 
> file for each renderer separately. See the example fop.xconf in the  
> distribution.
> 
> Try running FOP with debug output enabled (-d). This should tell you  
> more about the font-files that are parsed.
> 
> 
> Regards
> 
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21751949.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Japanese characters do not appear in PDF

Posted by Andreas Delmelle <an...@telenet.be>.
On 29 Jan 2009, at 18:46, mpanhuijsen wrote:

Hi Mathijs

> I tried the following:
>
> -Change every reference to my default font from Verdana into  
> ARIALUNI (the
> name of the .ttf file).
> -Create a dir c:\myfonts\ and copy ARIALUNI.ttf and ARIALUNI.xml  
> (generated
> metric font file) into it
> -Remove autodetect from my fop config file.
> -Added the following fragment:

Can you try again with FOP 0.95 (using the setup as mentioned in your  
initial post), and see if the issue persists?

Looking at your FO file, the correct characters/codepoints are used  
there, so that cannot be the problem.

>          <font-triplet name="ARIALUNI" style="normal"  
> weight="normal"/>
>
>
> And still I'm seeing the Serif font and no Japanese characters.

Yes, now you get the # character again, which means FOP cannot find  
the glyphs for the characters in the used font. This means that  
ARIALUNI.ttf is not properly registered. You should at least see a  
warning about FOP falling back to Serif during processing.

The reason could be that <font-triplet /> alone is not enough. Did you  
forget to paste a piece of the config-file? (the surrounding <font />  
element?)

Another thing to look out for (if you have used FOP 0.20.5 in the  
past) is that font-configuration should be specified in the config- 
file for each renderer separately. See the example fop.xconf in the  
distribution.

Try running FOP with debug output enabled (-d). This should tell you  
more about the font-files that are parsed.


Regards

Andreas

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


RE: Japanese characters do not appear in PDF

Posted by mpanhuijsen <Ma...@SDLTRIDION.COM>.
Hello,

I tried the following:

-Change every reference to my default font from Verdana into ARIALUNI (the
name of the .ttf file).
-Create a dir c:\myfonts\ and copy ARIALUNI.ttf and ARIALUNI.xml (generated
metric font file) into it
-Remove autodetect from my fop config file.
-Added the following fragment:

       
          <font-triplet name="ARIALUNI" style="normal" weight="normal"/>
        

And still I'm seeing the Serif font and no Japanese characters.

If you have further suggestions, I would really like to hear them.

I'm including the .fo and .pdf files (note that Verdana still occurs once or
twice, these are 'hardcoded' instances).

http://www.nabble.com/file/p21731969/Example.fo Example.fo 
http://www.nabble.com/file/p21731969/Example.pdf Example.pdf 

Thanks,
Mathijs


Pascal Sancho wrote:
> 
> Ah, you use FOP 0.94...
> The bug cited in my previous mail only occurs with FOP 0.95.
> 
> What you get here is related to a font substitution (Arial is expected,
> but Times is used, see the word just after the Japanese characters).
> 
> Check if you have correctly configured FOP to use Arial Unicode.
> Note 1: I have yet experimented some bugs with FOP 0.94, using the
> auto-detection new feature.
> If this is the case, you should explicitely register each font-file (see
> [1]).
> 
> Note 2: FOP can only use Arial Unicode MS in its Roman version (since this
> is the unique file).
> If you plan to change either font-weight or font-style in combination with
> that font, a font-substituion can occur. You should prevent this by
> explicitely set both font-weight and font-style to 'normal'.
> 
> Pascal
> 
> [1] http://xmlgraphics.apache.org/fop/0.94/fonts.html#register
> 
>> -----Message d'origine-----
>> De : mpanhuijsen [mailto:Mathijs.Panhuijsen@SDLTRIDION.COM] 
>> Envoyé : jeudi 29 janvier 2009 16:14
>> À : fop-users@xmlgraphics.apache.org
>> Objet : RE: Japanese characters do not appear in PDF
>> 
>> 
>> I'm sorry, I sent you the wrong .fo file.
>> Here is the correct .fo file:
>> http://www.nabble.com/file/p21728799/Example.fo Example.fo 
>> and its accompanying PDF:
>> http://www.nabble.com/file/p21728799/Example.pdf Example.pdf 
>> 
>> Could you check these, too?
>> 
>> Thanks,
>> 
>> Mathijs
>> 
>> 
>> Pascal Sancho wrote:
>> > 
>> > Back to list:
>> > 
>> > I've done further tests with your FO.
>> > Your problem has 2 causes:
>> > 1/ The used font (Verdana) doesn't contain the needed 
>> Japanese glyphes
>> > 2/ There is a bug in FOP 0.95 (fixed is TRUNK) but I don't remember
>> > precisely what was wrong (This 1 of Jeremias Maerki's domains)
>> > 
>> > Then, you have 2 things to do:
>> > 1/ required: find a font that contains needed glyphes 
>> ([Arial Unicode MS]
>> > works fine, and I've googled other fonts at [1])
>> > 2/ optional: If you can, build and use the latest FOP Trunk.
>> > 
>> > [1] www.wazu.jp/gallery/Fonts_Japanese.html
>> > 
>> > HTH,
>> > Pascal
>> > 
>> >> -----Message d'origine-----
>> >> De : mpanhuijsen [mailto:Mathijs.Panhuijsen@SDLTRIDION.COM] 
>> >> Envoyé : jeudi 29 janvier 2009 11:34
>> >> 
>> >> 
>> >> Hello,
>> >> 
>> >> First off, thanks for telling me about Babelpad, I'm 
>> >> downloading it as we
>> >> speak.
>> >> 
>> >> Secondly, here is the .fo file from which the PDF is generated.
>> >> http://www.nabble.com/file/p21724347/Example.fo Example.fo 
>> >> 
>> >> If I open this file in Notepad, I see the Japanese characters 
>> >> I expect to
>> >> see.
>> >> 
>> >> So it seems that FOP is itself the problem. Maybe this is a 
>> >> good time to
>> >> point out I'm running version 0.94 of FOP.
>> >> 
>> >> Mathijs.
>> >> 
>> >> 
>> >> 
>> >> 
>> >> Pascal Sancho wrote:
>> >> > 
>> >> > Hi,
>> >> > 
>> >> > After a copy/paste of the 3 japanese characters into 
>> babelpad (full
>> >> > unicode editor with character analysis), I can read that 
>> >> the 3 caracters
>> >> > are all U+FFFF, witch is outside all Unicode scripts for 
>> >> Japanese (see
>> >> > [1])
>> >> > You should check what characters are actually sent to FOP 
>> >> in the XSL-FO
>> >> > file.
>> >> > 
>> >> > HTH,
>> >> > Pascal
>> >> > 
>> >> > [1] http://www.unicode.org/versions/Unicode4.0.0/ch11.pdf
>> >> > 
>> >> >> -----Message d'origine-----
>> >> >> De : mpanhuijsen [mailto:Mathijs.Panhuijsen@SDLTRIDION.COM] 
>> >> >> Envoyé : jeudi 29 janvier 2009 09:51
>> >> >> 
>> >> >> Sure, here is a fairly minimal PDF showing the problem.
>> >> >> http://www.nabble.com/file/p21722890/Example.pdf Example.pdf 
>> >> >> It's the last page that is interesting.
>> >> >> 
>> >> >> Thanks for your help,
>> >> >> Mathijs Panhuijsen
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21731969.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: Japanese characters do not appear in PDF

Posted by mpanhuijsen <Ma...@SDLTRIDION.COM>.
I'm sorry, I sent you the wrong .fo file.
Here is the correct .fo file:
http://www.nabble.com/file/p21728799/Example.fo Example.fo 
and its accompanying PDF:
http://www.nabble.com/file/p21728799/Example.pdf Example.pdf 

Could you check these, too?

Thanks,

Mathijs


Pascal Sancho wrote:
> 
> Back to list:
> 
> I've done further tests with your FO.
> Your problem has 2 causes:
> 1/ The used font (Verdana) doesn't contain the needed Japanese glyphes
> 2/ There is a bug in FOP 0.95 (fixed is TRUNK) but I don't remember
> precisely what was wrong (This 1 of Jeremias Maerki's domains)
> 
> Then, you have 2 things to do:
> 1/ required: find a font that contains needed glyphes ([Arial Unicode MS]
> works fine, and I've googled other fonts at [1])
> 2/ optional: If you can, build and use the latest FOP Trunk.
> 
> [1] www.wazu.jp/gallery/Fonts_Japanese.html
> 
> HTH,
> Pascal
> 
>> -----Message d'origine-----
>> De : mpanhuijsen [mailto:Mathijs.Panhuijsen@SDLTRIDION.COM] 
>> Envoyé : jeudi 29 janvier 2009 11:34
>> 
>> 
>> Hello,
>> 
>> First off, thanks for telling me about Babelpad, I'm 
>> downloading it as we
>> speak.
>> 
>> Secondly, here is the .fo file from which the PDF is generated.
>> http://www.nabble.com/file/p21724347/Example.fo Example.fo 
>> 
>> If I open this file in Notepad, I see the Japanese characters 
>> I expect to
>> see.
>> 
>> So it seems that FOP is itself the problem. Maybe this is a 
>> good time to
>> point out I'm running version 0.94 of FOP.
>> 
>> Mathijs.
>> 
>> 
>> 
>> 
>> Pascal Sancho wrote:
>> > 
>> > Hi,
>> > 
>> > After a copy/paste of the 3 japanese characters into babelpad (full
>> > unicode editor with character analysis), I can read that 
>> the 3 caracters
>> > are all U+FFFF, witch is outside all Unicode scripts for 
>> Japanese (see
>> > [1])
>> > You should check what characters are actually sent to FOP 
>> in the XSL-FO
>> > file.
>> > 
>> > HTH,
>> > Pascal
>> > 
>> > [1] http://www.unicode.org/versions/Unicode4.0.0/ch11.pdf
>> > 
>> >> -----Message d'origine-----
>> >> De : mpanhuijsen [mailto:Mathijs.Panhuijsen@SDLTRIDION.COM] 
>> >> Envoyé : jeudi 29 janvier 2009 09:51
>> >> 
>> >> Sure, here is a fairly minimal PDF showing the problem.
>> >> http://www.nabble.com/file/p21722890/Example.pdf Example.pdf 
>> >> It's the last page that is interesting.
>> >> 
>> >> Thanks for your help,
>> >> Mathijs Panhuijsen
>> > 
>> > 
>> > 
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> > For additional commands, e-mail: 
>> fop-users-help@xmlgraphics.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF
>> -tp21683276p21724347.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Japanese-characters-do-not-appear-in-PDF-tp21683276p21728799.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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