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 andyrobb <an...@intersystems.com> on 2009/12/09 01:57:01 UTC

FOP and Chinese TTF fonts

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

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.

Thanks
Andy
-- 
View this message in context: http://old.nabble.com/FOP-and-Chinese-TTF-fonts-tp26703510p26703510.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: FOP and Chinese TTF fonts

Posted by Vincent Hennebert <vh...@gmail.com>.
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-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org