xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Meyer <rme...@hotmail.co.uk>
Subject RE: Chinese PDFs and non embedded fonts
Date Fri, 20 Apr 2012 15:37:47 GMT

Hello again,

Thanks for confirming. I have just run a simple test on my machine using a similar character
set on FOP 1.0 and mine did render correctly.

At this stage, the only thing I can think of is Java is unable to see the font. I have created
a small Java program (with source included) which will list the installed fonts. 

Can you therefore try the following to confirm the font is listed:

1) Extract the files
2) You can recompile it if you like, but I have included the *.class file in the zip
2) In a command line navigate to the extracted bin folder and type "java program"
3) Check that the SimSun is listed amongst the displayed fonts.

My apologies if I am telling you things you already know how to do.

If it is not listed then it might be worth checking that the font has been correctly installed.
Alternatives may be that the JVM hasn't picked up the font for some reason.

I am going to be away on holiday for a week from now, but am sure if you are still having
problems someone else will be able to help.


Robert Meyer

From: jean-philippe.courson@cognitran.com
Subject: Re: Chinese PDFs and non embedded fonts
Date: Fri, 20 Apr 2012 15:24:30 +0100
To: fop-users@xmlgraphics.apache.org

Hi Robert,
Thanks for your answer.
Yes it is:
    <renderer mime="application/pdf">      <filterList>
        <value>flate</value>      </filterList>      <fonts>     
  <auto-detect/>      </fonts>
Best Regards,JP
On 20 Apr 2012, at 15:15, Robert Meyer wrote:Hello,

Can you just confirm that when using the referenced-fonts method, the <auto-detect />
line is within a <fonts> tag pair in the renderer?

If it is not, then that may be why it is refusing the find the font you are referencing.

Best Regards,

Robert Meyer

> From: jean-philippe.courson@cognitran.com
> Subject: Chinese PDFs and non embedded fonts
> Date: Fri, 20 Apr 2012 12:55:59 +0100
> To: fop-users@xmlgraphics.apache.org
> Hi,
> I am trying to produce chinese PDFs not embedding fonts. I am using the SimSun font.

> When embedding the font, everything is fine. However, when trying to reference the font,
FOP produced an invalid PDF, despite the Simsun font being installed on the machines were
the PDF is produced and opened.
> I tried both auto-configuring the fonts and the old style, metric based manual font configuration:
> 1) Auto-configured fonts:
> <fonts>
> <referenced-fonts>
> <match font-family=".*"/>
> </referenced-fonts>
> </fonts> 
> <renderers>
> <renderer mime="application/pdf">
> ...
> <auto-detect/>
> The produced PDF shows # characters for every chinese symbol. 
> 2) Manually configured fonts:
> <renderers>
> <renderer mime="application/pdf">
> ...
> <fonts>
> <font metrics-url="file:///Users/jumal/Downloads/fop-1.0/SimSun.xml" kerning="yes">
> <font-triplet name="SimSun" style="normal" weight="normal"/>
> <font-triplet name="SimSun" style="normal" weight="bold"/>
> <font-triplet name="SimSun" style="italic" weight="normal"/>
> <font-triplet name="SimSun" style="italic" weight="bold"/>
> </font> 
> a) Metric file generated with the default options: 
> java -cp ... org.apache.fop.fonts.apps.TTFReader SimSun.ttf SimSun.xml
> The produced PDF can not be opened by Acrobat Reader which gives the following error
message: "Cannot find or create the font 'SimSun'. Some characters may not display or print
> b) Metric file generated with the -enc ansi options: 
> java -cp ... org.apache.fop.fonts.apps.TTFReader -enc ansi SimSun.ttf SimSun.xml
> The produced PDF shows # characters for every chinese symbol. 
> Having a look at http://xmlgraphics.apache.org/fop/trunk/fonts.html#truetype-metrics,
and in particular:
> TTFReader [options]:
> ...
> • -enc ansi Creates a WinAnsi-encoded font metrics file. Without this option, a CID-keyed
font metrics file is created. The table below summarises the differences between these two
encoding options as currently used within FOP. Please note that this information only applies
to TrueType fonts and TrueType collections:
> Issue WinAnsi	 CID-keyed
> Usable Character Set Limited to WinAnsi character set, which is roughly equivalent to
iso-8889-1.	Limited only by the characters in the font itself.
> Embedding the Font Optional. Mandatory. Not embedding the font produces invalid PDF documents.
> it looks like you need to use the -enc ansi to be able to reference a font. Does this
mean that have to use WinAnsi (windows-1252) encoding for the input XML files? 
> If it is the case, that would mean to produce for example chinese PDFs, you would have
to embed the font, as windows-1252 cannot be used to encode chinese symbols.
> Am I missing something or the only way to produce chinese PDF is to embed the font with
the font licensing costs it implies?
> Cheers,
> JP
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
View raw message