Re: FOP and Chinese TTF fonts

2009-12-10 Thread Vincent Hennebert
Hi Andy,

andyrobb wrote:
 I'm trying to setup chinese simhei ttf font on our FOP server - version .95.
 
 I have the font installed in windows fonts folder, and I have font
 autodetect enabled in the fop.xconf folder. 
 
 I can see fop can detect arial ttf font in the same folder, but it doesn't
 detect the simhei font.

Maybe it does, but under a different name to what you expect. IIC FOP
reads the name stored in the font file; that usually has nothing to do
with the name of the file itself, and sometimes neither with the common
name used to refer to the font (e.g., ‘MS Arial’ while everyone would
say Arial). Try and open the font with a font editing program and figure
out what its name is.


 The only way I have been able to get this working is
 to generate a metric file for the simhei font and add this to the fop config
 file.
 
 I have read extensively the fop docs, faq, and forums on this issue, and
 there seems to be a lot of conflicting information, hence my post. What I'd
 simply like to know is:
 
 Will FOP 0.95 auto detect a chinese TTF font when it's installed in windows
 (and linux)? If so, any ideas why this fails on my setup when other fonts
 are auto-detected?

In my experience font auto-detection is not 100% reliable.


 Does FOP 0.95 require a metrics file for a chinese TTF file? If not (as the
 docs suggest), can anyone provide some sample config file entries, for a
 simhei.ttf file installed in the windows fonts folder, that works? I have
 been unable to get this to work any other way.

The fallback usually is to manually configure the font, and you usually
don’t need to generate the XML font metrics. For example:
font embed-url=path/to/my/font.ttf
  font-triplet name=ChineseFont style=normal weight=normal/
/font
That way you can choose whatever font family name you fancy to refer to
that font.


 Thanks
 Andy

HTH,
Vincent

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



Re: Rendering accessible PDF from Java

2009-12-10 Thread Simon Pepping
You can look in org.apache.fop.cli.CommandLineOptions.parseOptions()
and its caller parse() to see what the command line does with the
option. The relevant lines here are probably:

this.renderingOptions.put(Accessibility.ACCESSIBILITY, Boolean.TRUE);
foUserAgent.getRendererOptions().putAll(renderingOptions);

which is something which you can do in your own code as well.

Simon

On Wed, Dec 09, 2009 at 09:59:51AM -0700, Gregory Buchenberger wrote:
 I am working on a Java desktop app that uses FOP trunk. Using the
 command line I can run FOP with the -a option to render an accessible
 (tagged) PDF. How do I set the option in Java? I've looked at the
 methods of FopFactory and FOUserAgent, but can't find one. Any help
 would be greatly appreciated.

-- 
Simon Pepping
home page: http://www.leverkruid.eu

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