[NTG-context] composing commands

Hans Hagen j.hagen at xs4all.nl
Mon Feb 8 10:53:01 CET 2021


On 2/6/2021 11:41 PM, T. Kurt Bond wrote:

> I think that it would be useful.  I use Unicode characters extensively 
> in my ConTeXt input, but only because I edit it in Emacs and can set up 
> keymaps that map to the Unicode characters in a way that I can actually 
> remember.  I think that this would add an easily remembered way for 
> people to add combining characters to their documents.  Sometimes a 
> slightly more verbose way to do something is helpful when it is more 
> easily remembered.  (Honestly, I can't remember the hex codes for any 
> Unicode characters after you get out of the range that maps to plain ASCII
I anyway uprgade this mechanism. First of all, the short commands will 
be equivalents to more verbose ones.

\withgrave       {a} == \\`{a}
\withacute       {a} == \\'{a}
\withcircumflex  {a} == \\^{a}
\withtilde       {a} == \\~{a}
\withmacron      {a} == \\={a}
\withbreve       {e} == \\u{e}
\withdot         {c} == \\.{c}
\withdieresis    {e} == \\"{e}
\withring        {u} == \\r{u}
\withhungarumlaut{u} == \\H{u}
\withcaron       {e} == \\v{e}
\withcedilla     {e} == \\c{e}
\withogonek      {e} == \\k{e}

Did I miss one?

Then we can deprecate the short ones (keep them a low profile, with 
permission to overload). After all, I don't expect someone who needs 
lots of them to use these commands, so more verbose is better then. Aas 
I already mentioned, in bib files they are treated differently already.

The low level helper is \chr, that can be used as

\chr {à} \chr {á} \chr {ä}
\chr {`a} \chr {'a} \chr {"a}
\chr {a acute} \chr {a grave} \chr {a umlaut}
\chr {aacute}  \chr {agrave}  \chr {aumlaut}

(I can add more of the verbose, like {cyrillic a} if really needed. It 
means that we can declare \eacute etc also depricated (these verbose 
names date from \MKII, encoding neutral labels, utf handling, remapping 
to backend encodings etc but we don't need that and I'm not sure if 
anyone ever used those long names. Again, depricated, not removed (yet).)

Then there is the question what to do with \AE and \ij and such ... 
these were used to enforce specific ligatures into a file assuming that 
f ont has them but nowadays that's the job of a font handler (script 
language control). We can keep them but assume them legacy. They 
normally don't belong in input. (Being Dutch I actually never used \IJ 
or \ij).

Now, we can assume that when your languages needs characters with 
accents that you use a font that has them. In MKIV and LMTX one can
enable a checker

\enabletrackers[fonts.missing]
\enabletrackers[fonts.missing=replace]
\enabletrackers[fonts.missing=remove]

but in LMTX it's upgraded with more clever replacements (Jano will 
document that + more about checking missing stuff in the wiki).

So, in LMTX we have more options (maybe I'll backport that to MKIV)

\checkmissingcharacters   \enabletrackers[fonts.missing]
\removemissingcharacters  \enabletrackers[fonts.missing=remove]
\replacemissingcharacters \enabletrackers[fonts.missing=replace]
\handlemissingcharacters  \enabletrackers[fonts.missing={decompose,replace}]

the last one will inject decomposed characters into the list when font 
lacks the real thing. The replacements visualize similar to MKIV but 
adapt to the style.

Hans

(no upload yet)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list