[XeTeX] New feature request for XeTeX
Ross Moore
ross at maths.mq.edu.au
Mon Jul 26 03:28:16 CEST 2004
Hi Jonathan,
Here's an idea that, if implemented in XeTeX, could help enormously
with legacy documents and existing (La)TeX methods for use of
specialised fonts and font-encodings.
What I have in mind could be called a "font mapping",
or "encoding mapping".
This would be applied on output, whenever a particular font-variant
is being used, both when obtaining the size of a sequence of
letters/glyphs and in the final output.
Here's the motivation for this request:
Currently when a (La)TeX user needs to typeset special symbols:
(e.g. music, chemical-symbols, electrical, phonetic, foreign languages,
indeed even mathematics).
One technique is to use a special purpose font that has the desired
symbols encoded, which can then be called using ordinary letters.
This works fine for the typesetting, but the resulting PDF document must
include a copy of this special font, at least for the characters used.
Even then, there can be big problems: the font may not render in
standard
PDF readers, and these portions are not searchable in any sensible way.
However, most of the symbols now are included within Unicode, and fonts
do exist with these symbols as glyphs or combinations of glyphs.
What I want to do is to be able to continue to use the old TeX sources,
but to end up with the Unicode code-points in the output, with the font
having been switched to something standard.
(e.g. "Lucida Grande", "Hoefler Text", or Code2000, or Code2001 even)
Here's an example, from tipaman.tex documentation for tipa.sty.
tipa implements the IPA phonetic representations of spoken sounds;
the kind of thing that we see in dictionaries. It uses a T3-encoded
font which replaces all uppercase letters with special phonetic symbols.
So a word expressed in the source as:
A. \textipa{[""Ekspl@"neIS at n]} % (hear "explanation")
could also be encoded in the source as:
B. [\textscstress\textepsilon kspl\textschwa
\textprimstress ne\textsci\textesh\textschwa n]
Observe that all uppercase letters have been replaced by macros.
I can (and now have done so) define appropriate expansions for all
of the macros, to get the appropriate Unicode code-points.
That's a job doable using LaTeX and some TeX macro-programming.
This copes with input of type B., but not of type A.
(Note that a pre-processor could be used to convert type A. input
into that of type B. This has been the approach used in many
of the foreign-language settings. But that's messy in that it
requires an extra piece of software to be available and compiled
on all computing platforms.)
Having a font-mapping available, there is an obvious way forward,
that would alleviate completely the need for pre-processors, and
be easier for a user to configure for his/her own needs.
The \textipa command would cause the mapping to be applied to the
result (*after* macro-expansions) of the usual processing of its
argument.
Currently \textipa sets the font encoding to T3 for its processing,
and switches font to have the correct metrics available.
With XeTeX, the change would be to an AAT font; but there needs
to be an appropriate mapping either:
(i) of 7-bit characters directly to Unicode points;
or
(ii) of 7-bit characters to (La)TeX macros, and further processing
to get the Unicode points.
The latter would be more flexible, I think -- though perhaps harder
to integrate seamlessly into TeX's workflow.
As for mathematics, this would make it *much, much easier* to get
consistent styles for mathematics in a document using an AAT text-font.
This is because there are already code-points for slanted/italiced
math-characters, math symbols, extension-brackets, fraktur, etc.
Appropriate font-mappings for cmmi, cmsy, cmex would be easy to write.
(Even some super/subscripts can be supported without changing
font-size!)
If the font is sufficiently rich, then you will automatically
have access to a consistent style.
(Of course there may be some spacing issues to sort out, but that
should be a relatively minor problem.)
Another advantage is that many fonts could (eventually) be completely
removed from a TeX distribution, as neither the glyphs nor their
metrics would be needed. Now isn't that a space-saver !!
Cheers,
Ross
------------------------------------------------------------------------
Ross Moore ross at maths.mq.edu.au
Mathematics Department office: E7A-419
Macquarie University tel: +61 +2 9850 8955
Sydney, Australia fax: +61 +2 9850 8114
------------------------------------------------------------------------
More information about the XeTeX
mailing list