[luatex] hyphenating ancient Greek

Reinhard Kotucha reinhard.kotucha at web.de
Sun Jun 13 15:29:08 CEST 2010


On 12 June 2010 Robin Fairbairns wrote:

 > Reinhard Kotucha <reinhard.kotucha at web.de> wrote:
 > 
 > > It would be much more convenient if case folding wouldn't depend on
 > > the language, i.e. the Turkish "i" had a separate code point.
 > 
 > interesting the difference in attitude as between different languages.
 > for example, the glyph capital A appears in english, greek and russian
 > -- three different alphabets --- with the same sound (to first order).
 > 
 > yet a significantly different pair of glyphs (i in english and turkish)
 > apparently occupy the same code point.  (unfortunately, in the russian-
 > greek-english i speak from some knowledge of all three languages, but i
 > know no turkish at all, beyond its typographic issues and what spam in
 > turkish looks like...).
 > 
 > > However, I think it's solvable.
 > 
 > it would be interesting to know how.

I suppose that the data will be stored in a Lua table (associative
array).  Values in tables are not restricted to strings or numbers.
They can also be functions or other tables.

  uccode = {} -- create a table

  uccode[0x0061] = 0x0041  -- a
  uccode[0x0062] = 0x0042  -- b
  uccode[0x0063] = 0x0043  -- c
  ...
  uccode[0x0069] = { default = 0x0049, turkish = 0x0130 } -- i
  ...

When TeX's uccode array is initialized (yes, I think TeX can't use
this table directly), the default value is used if the type of a table
entry is a table instead of a number.  If you switch from English to
Turkish, you have to change TeX's \uccode and restore it afterwards
(at the same time you switch between hyphenation patterns).

This is _one_ approach.  Others are thinkable but this one might work
without changing the TeX engine too much.  The only requirement is
that TeX's \uccode array can have more than 256 entries, but I suppose
this is already the case in LuaTeX.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the luatex mailing list