[XeTeX] Roman Numerals as stylistic alternatives

mskala at ansuz.sooke.bc.ca mskala at ansuz.sooke.bc.ca
Sun Jun 19 22:06:43 CEST 2011


On Sun, 19 Jun 2011, enrico.gregorio at univr.it wrote:
> What the OP wants is that "CXV" is stored as a unique glyph representing 115.
> Maybe this can be done by reserving, say, five thousand slots in Unicode to
> contain the numbers from 1 to 5000 in Roman form that are built from the basic

If you do it with OpenType glyph substitution, I don't think you need
quite that many glyphs, nor any code point assignments at all.  Instead
you'd have perhaps 5000 *substitution rules* mapping Arabic digits onto
variants of the few Roman numeric letters.

For example, you might have a rule that says:

  sub one one five by one.c one.x five.v;

In each of those names the part before the dot is the code point that will
be seen by copy-and-paste, and the part after the dot is what the glyph
actually looks like.

For sequences of Arabic digits that are longer than their Roman
equivalents (like "10" -> "X") you could create some invisible glyphs, as
in:

  sub two zero zero zero by two.invisible zero.invisible zero.m zero.m;

For sequences of Arabic digits that are shorter than their Roman
equivalents it might be necessary to create a few "ligature" glyphs
containing more than one Roman numeric letter:

  sub eight by eight.viii;

But I don't think there would be so many of those as to render it
completely unthinkable.  I'm imagining (to handle 1 through 5000) maybe an
average of 20 variants for each of the 10 Arabic digits, total 200 glyphs.

Please note that I'm not saying this is a desirable feature; only that
someone who wanted to create it probably could, without the implementation
becoming completely ridiculous.
-- 
Matthew Skala
mskala at ansuz.sooke.bc.ca                 People before principles.
http://ansuz.sooke.bc.ca/


More information about the XeTeX mailing list