Andreas L Delmelle wrote:

OK, what you would benefit from is an implementation for font-selection. If this were properly implemented, what you would need to do would come down to:

<fo:page-sequence font-family="Times New Roman, Arial Unicode">
...

That way, all characters that are unavailable in the Times font (the Chinese text) would be rendered in Arial Unicode.

Unfortunately, in the above scenario, FOP currently still only uses Times for all text. While the font-list is properly parsed, and so in principle both fonts are available, the layoutengine does not yet make any effort switch to a different font in the middle of a FO... :(

It is possible to filter your FO in a second pas through an XSLT processor. Though possible but hard in XSLT 1.0, it is trivial in XSLT 2.0 to create a simple stylesheet that processes all text nodes and wraps the chinese characters in a span. I understand this is nothing more than a workaround while the font-selection strategy is not yet implemented. For instance, in 2.0, you could write:

<xsl:analyze-string regex="[\p{{IsCJKUnifiedIdeographs}}]+" select="text()">
   <xsl:matching-substring>
<fo:inline font-family="Arial Unicode"><xsl:copy-of select="." /></fo:inline>
   </xsl:matching-substring>
   <xsl:non-matching-substring>
       <xsl:copy-of select="." />
   </xsl:non-matching-substring>
</xsl:analyze-string>

when applied correctly, this won't introduce extra spacing. You probably need more than only the CJK Ideographs, for instance, the Yi symbols, the Radicals, perhaps Hiragana and Katakana (but that would be Japan) and the CJK symbols and punctuation. Depending on your demands, you need to include:

IsKangxiRadicals
IsCJKSymbolsandPunctuation
IsCJKRadicalsSupplement
IsHiragana
etc. I peeked; you can, too: http://www.w3.org/TR/xmlschema-2/#dt-ccesblock, they all work with XSLT 2.0 compliant processors.

Alternative typefaces, pick one that's closest to your feel of being Times: http://en.wikipedia.org/wiki/Unicode_typefaces#Comparison_of_fonts, which is a very nice overview. You can see for instance that your pick is probably one of Arial. Bitstream Cyberbit, GNU Unifont, Code2000, New Gulim or Y.OzFontN. The only serif font in that list is the (free for non-commercial use) Bitstream font. Here're the ideographs: http://www.myfonts.com/fonts/bitstream/cyberbit/bitstream-cyberbit/charmap.html?vid=30750&cpselect=UNI71. It is not Times, surely, but it is serif. If you like it enough, you don't need to apply a filter.

HTH,
Cheers,
-- Abel Braaksma





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to