Abel & Andreas

Thank you both very much for your advice and recommendations - all
extremely helpful. 

I haven't looked into XSLT 2.0 yet, we are currently using Xalan and
XSLT 1.0, though I'd be interested in the migration path from Xalan to
Saxon (that's for another list I reckon...)

I'm sure that one of the suggestions will do the trick. Bitstream
Cyberbit may well be 'good enough'.

I was unaware of the font-selection feature, looking forward to this
being implemented :-)

Many thanks again,

Andy



-----Original Message-----
From: Abel Braaksma [mailto:[EMAIL PROTECTED] 
Sent: 19 October 2007 00:00
To: [email protected]
Subject: Re: Chinese characters in Times New Roman?

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/charm
ap.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]


________________________________________________________________________
This e-mail and its attachments are confidential. If you are not the intended 
recipient of this e-mail message, please telephone or e-mail us immediately, 
delete this message from your system and do not read, copy, distribute, 
disclose or otherwise use this e-mail message and any attachments. 

Although RI3K believes this e-mail and any attachments to be free of any virus 
or other defect which may affect your computer, it is the responsibility of the 
recipient to ensure that it is virus free and RI3K does not accept any 
responsibility for any loss or damage in any way from its use.

RI3K Limited is a company registered in England no: 3909745.  Registered office 
10, Ely Place, London, EC1N 6RY.   VAT registration no: 769 0192 07

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

Reply via email to