|
From: | Yves Forkl |
Subject: | Re: Formatting DocBookXML with Lout / Latin-1 and Latin-2 |
Date: | Fri, 18 Apr 2008 12:27:55 +0200 |
User-agent: | Thunderbird 1.5.0.14ubu (X11/20080306) |
Michael Piotrowski <address@hidden> writes:
By switching between the Latin 1-encoded and the Latin 2-encoded fonts you can mix Latin 1 and Latin 2 characters in a single document, no problem. You could extend this to, say, Cyrillic as well. You probably shouldn't use a single byte to represent two different characters, e.g., assuming your initial font is Times (i.e., Latin 1-encoded): { TimesCE Base } @Font { £ód¼ } Fænø and write this instead: { TimesCE Base } @Font { address@hidden address@hidden address@hidden zacute} } Fænø
Hi,that is fine for the "Base" face, but getting italics is a bit more tricky as soon as you are generating Lout code from XML rather than keying it in. Say I have the above Polish city name in an emphasis element like this:
<para><emphasis>The city of Łódź is in Poland.</emphasis></para>
By just replacing the special characters as shown above this would leave me with something like
@PP address@hidden {The city of { TimesCE Base } @Font { address@hidden address@hidden address@hidden zacute} } is in Poland.} }
which of course does not work, the correct code being, I suppose,@PP address@hidden {The city of} { TimesCE Slope } @Font { address@hidden address@hidden address@hidden zacute} } @I {is in Poland.} }
Generating this Lout code from the above XML sample, however, requires analyzing the contents of each text node and conditionally transforming its substrings, to split up the @I object as needed. That is very hard to do, especially in XSLT 1. Even with the string-matching functionality of XSLT 2 it would be quite a lot of work.
If all of the Latin-2 words were wrapped into an element of their own (a preprocessor could be used to do this kind of post-tagging), this would at least simplify the transformation, as it would allow to focus on that element (and its neighbouring text nodes).
Some ideas on this problem? Yves
[Prev in Thread] | Current Thread | [Next in Thread] |