ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Adam Lindsay" <atl@comp.lancs.ac.uk>
Subject: Re: (Con)TeX(t), Unicode and accented characters
Date: Tue, 21 Dec 2004 10:01:24 +0000	[thread overview]
Message-ID: <20041221100124.1568@news.comp.lancs.ac.uk> (raw)
In-Reply-To: <47395.62.251.0.62.1103615800.squirrel@62.251.0.62>

r.ermers@hccnet.nl said this at Tue, 21 Dec 2004 08:56:40 +0100:

>In Latex the combination \"{a} can mean two things:
>1. in most fonts: show the charachter on the a given numerical position,
>which means that there is one character ä.
>
>2. in some other fonts \"{a} means: combine " with a and make an ä. This
>means that " is combined with the character on the numerical position of
>a. TeX does this very well and thus construes very acceptable diacritical
>signs like \"{q}, \d{o}, \v{o}, which do not exist in regular fonts.

Robert,

That's a helpful explanation. I'll try to expand on that in the ConTeXt
case, just in case people are curious or are led into thinking it's just
the same:

In ConTeXt, the combination \"{a} means one thing: \adiaeresis (see enco-
acc). This \adiaeresis can mean one of two things, depending on the encoding:
1. Numerical position, or
2. The fallback case (defined in enco-def), where a diaeresis/umlaut is
placed atop an 'a' glyph. Hyphenation implications as Hans described.

The interesting/helpful thing about ConTeXt is that internally, that
glyph is given a consistent name, no matter how it is input or output.
So, if you type ä in your given input regime, and that encoding is
properly set, that numerical ä (e.g., character #228 in the windows
regime) is mapped to \adiaeresis.

Wanna know what happens in UTF-8? Here's my 'simplified' explanation:
In a UTF-8 bytestream, that character "ä" is signified by two bytes:
0xC3, 0xA4. That first byte triggers a conversion of both bytes into two
different bytes, the actual Unicode number, 0x00 0xE4 (or: 0, 228).
ConTeXt then looks into internal hashes set up (in this case, the unic-
000 vector), looks at the 228th element, and sees that it's \adiaeresis.
Things then proceed as normal. :)

(It's also interesting to note that for PostScript and TrueType fonts,
that number > name > number (glyph) mapping happens yet again in the
driver. But all that is outside of TeX proper, so to say any more would
be confusing.)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

      reply	other threads:[~2004-12-21 10:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-20 20:02 Mojca Miklavec
2004-12-20 20:52 ` Hans Hagen
2004-12-20 21:35   ` Mojca Miklavec
2004-12-20 22:16   ` VnPenguin
2004-12-21  7:56 ` r.ermers
2004-12-21 10:01   ` Adam Lindsay [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041221100124.1568@news.comp.lancs.ac.uk \
    --to=atl@comp.lancs.ac.uk \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).