Hi Marguerite,

> 
> I did it!

Cool, congratulations!


> 1. pick an open source Chinese font
> 2. create metrics for it using fop-fontmetrics
> 3. edit /etc/fop.xconf as mentioned before. (Chinese has no "italic"
> so you have to bind it to normal)
> 4. edit /usr/share/xml/docbook/stylesheet/suse/common/l10n/zh_cn.xml
> 
> add "WenQuanYi Micro Hei" and "WenQuanYi Micro Hei Mono" to relevant
> tags.

Do we have a package for them?

 
> now: daps --docconfig=DC-opensuse-startup color-pdf
> 
> it works amazing!

Perfect! Many thanks!

If I'm not mistaken, this is the "old approach" to define and use fonts
in FOP. I had the impression that you don't have to create metrics
files anymore. FOP searches all fonts for you.

Could you try to do the same, but without any metrics? I would propose
to read the following link first:

  http://xmlgraphics.apache.org/fop/1.1/fonts.html

Also make sure to use the correct font name in your FO file, otherwise
it won't work. If your Chinese font contains spaces (like the one
above), you need to put them in single quotes. For example, this could
look like this:

  <fo:inline font-family="FreeSerif,'WenQuanYi Micro Hei',serif">...

If the font name is correct, FOP should find them. To avoid guessing,
better install fontforge (a font editor), load the font, and click the
"Element" > "Font Info..." menu item. There you should see the font
name and family name. I think, you need the string in "Family Name",
but I'm not sure.


> And I found a potential bug:
> 
> both zh_cn.xml and zh_tw.xml use a "Chinese" and a "ChineseMono" as
> their fonts.

Ahh, right. This is a mistake.

 
> I don't know if they're alias (I didn't find anything definitions in
> /usr/share/xml for them), but if they are real, it will be a bug.

I think, we can consider it as a bug. :)
This originates from XEP; it allows using alias names and define
the aliases in the XEP configuration file. The advantage of this is,
that you don't have to transform your XML file again and again just to
test another Chinese font. With an alias name, you can just change the
definition.

Unfortunately, this works only for XEP, not FOP. I guess, it was a copy
and paste error.


> Because there's no actual font named "Chinese". Actually Simplified
> Chinese and Tranditional one are totally different in font industry.

Right. 


> And there's also a bug in susedoc:
> 
> Because there's no "FZSongTi" available in openSUSE at all.
 
These are commercial fonts. As I'm not familiar with Chinese and its
typography, could you recommend a good Chinese font? Preferably open
source. :))

 
> Can you confirm these? I'm preparing fixes.

I think your analysis is correct. Maybe you should try the
configuration without the metrics. They should work as well.

Could you send us your fixes? Just to let you know, tomorrow is a
public holiday in Germany and I'm not here for the next 3 weeks.
Probably one of my collegues will take and submit your patches.


Thanks for your efforts, well done!


-- 
Gruß/Regards,
    Thomas Schraitle

----------------------------------------------------------------------
SUSE LINUX Products GmbH     (o<   
Maxfeldstrasse 5             /\\      Documentation Specialist
90409 Nuernberg, Germany    _\_v      http://www.suse.com
http://lizards.opensuse.org/author/thomas-schraitle/
SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, 
Felix Imendörffer, HRB 21284 (AG Nürnberg) 
--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to