[NTG-context] mode dependend character handling
Mojca Miklavec
mojca.miklavec.lists at gmail.com
Sat Jan 14 20:35:57 CET 2006
Henning Hraban Ramm wrote:
> Mojca's proposal:
>
> > \startmode[swiss]
> > \definecharacter ssharp {ss}
> > \stopmode
>
> unfortunately doesn't work, at least not with utf regime and ec
> encoding.
Since Taco's proposal is OK, you don't need this, but I'll reply
anyway. The problem is caused by "wrong order" of commands. If you
load ec encoding AFTER this command, your new definition of ssharp
will be overridden by the encoding definition again.
Compare:
\enableregime[utf] % may be whatever, no influence
\startmode[swiss]
\definecharacter ssharp {ss}
\stopmode
\usetypescript[modern][ec] % or texnansi
\setupbodyfont[modern]
\starttext
Maß Bier! % fails (prints ß)
\stoptext
with:
\usetypescript[modern][ec] % or texnansi
\setupbodyfont[modern]
\startmode[swiss]
\definecharacter ssharp {ss}
\stopmode
\starttext
Maß Bier! % prints ss
\stoptext
(Since ec encoding is the default one on my system, I had to use
texnansi in order to make the example fail.)
If you use a slightly longer variant
\startencoding[ec]
\startmode[swiss]
\definecharacter ssharp {ss}
\stopmode
\stopencoding
than the order of commands doesn't matter any more (but then the
automatic conversion will only work for the ec encoding).
But now my question for Taco: why does your example work in both
cases? Does \def have a higher priority than \definecharacter?
Thanks,
Mojca
More information about the ntg-context
mailing list