[luatex] on some special glyph nodes

Paul Isambert zappathustra at free.fr
Sat Mar 23 16:24:05 CET 2013

Stephan Hennig <mailing_list at arcor.de> a écrit:
> Hi,
> some of the ASCII characters are ambiguous in their meaning, e.g.,
> APOSTROPHE (0x27) or HYPHEN-MINUS (0x2d).  AFAIK, Unicode standard
> recommends to convert such code points to their most useful unambiguous
> interpretation, e.g., APOSTROPHE 0x27 => RIGHT SINGLE QUOTATION MARK
> 0x2019.  In output, if existent, 0x27 should then be rendered as a
> vertical line instead of an apostrophe.
> In node lists, that is after the above mentioned conversion, under what
> circumstances can glyph nodes still happen to represent ambiguous code
> points?  Is there some input for LuaTeX that generates such glyphs other
> than via node list manipulation?
> Additionally, Unicode standard contains many code points representing
> various forms of spaces, such as SPACE, NON-BREAKING SPACE, THIN SPACE
> etc.  AFAIK, traditional TeX doesn't make use of spacing characters, but
> always does absolute positioning of black ink in output.
> In node lists, under what circumstances can glyph nodes represent
> spacing characters?

I'm not sure I've understood the questions properly, but I'll make a
tentative answer anyway.

As far as I can tell, there are three places in LuaTeX where such
substitutions can take place:

1. When manipulating the input lines fed to TeX, in either
   open_read_file or process_input_buffer. There characters can be
   easily converted, and 0x27 can be turned to 0x2d.

2. When TeX processes tokens; for instance, a non-breaking space
   character can be made active and \let to (the usual definition of)
   "~" (e.g. so the source looks as little TeXish as possible).

3. Directly on nodes, which is the OpenType way to implement things:
   thus a node with character 0x27 will be turned into a node with
   character 0x2d; the font system (e.g. luaotfload) normally does
   that. TFM fonts are simpler yet: the right quotation mark is
   (generally) in position 0x27, there's no need for a substitution
   (you can implement that too with OTF fonts). In my opinion, this is
   probably the best place, for such substitutions as the apostrophe
   at least, since it can be font-dependent (and you may want some
   fonts, e.g. for code, to keep the real apostrophe).

Another way, not related to TeX, is to input the relevant characters
directly. With a good editor, it is simple to input a quotation mark
when typing an apostrophe (which isn't readily available on a keyboard).

I hope it helps,

More information about the luatex mailing list