ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Adam Lindsay" <atl@comp.lancs.ac.uk>
Subject: unicode and out-of-box usability
Date: Fri, 2 Jan 2004 17:59:13 +0000	[thread overview]
Message-ID: <20040102175913.3787@smtp.btinternet.com> (raw)

Hi, folks,

I've been struggling through, trying to learn Unicode in ConTeXt. It's
been instructive, at least. (Hope to make a MyWay about it...)
There are a few weird things that made it difficult to learn, and I was
wondering if someone could help explain why things are the way they are.

In unic-ini:
\chardef\utfunihashmode=0 % 1 = enabled 

Actually, if I understand things correctly, '1' means "disabled", which
is what I preferred, having not yet created any unicode vectors. So the
internal documentation there seems wrong, and I would argue the default
case (0) makes it harder for beginners.


More confusingly, in font-uni:
\def\enableunicodefont#1%
  {\definefontsynonym[\s!Unicode][\getvalue{\??uc#1\c!file}]%
   \def\unicodescale             {\getvalue{\??uc#1\c!schaal}}%
   \def\unicodeheight            {\getvalue{\??uc#1\c!hoogte}}%
   \def\unicodedepth             {\getvalue{\??uc#1\c!diepte}}%
   \def\unicodedigits            {\getvalue{\??uc#1\c!conversie}}%
   \def\handleunicodeglyph       {\getvalue{\??uc#1\c!commando}}%
%%%%%%%%%%% NEXT LINE
   \enableregime[unicode]% the following \relax's are realy needed
   \doifvalue{\??uc#1\c!interlinie}\v!ja\setupinterlinespace\relax
   \getvalue{\??uc#1\c!commandos}\relax}

The \enableregime[unicode] runs in direct opposition with the
\enableregime[utf] that normally goes at the start of (some of my)
documents. As it stands, with the regime hard-coded, users have to put an
\enableregime[utf] *after* the font declaration. That's awkward.


The last proposed change/complaint is back in unic-ini, and came from my
attempts to match the main body font with the unicode font. 

\def\utfunifontglyph#1%
  {\xdef\unidiv{\number\utfdiv{#1}}%
   \xdef\unimod{\number\utfmod{#1}}%
   \ifnum#1<\utf@i
%%%% \unicodeasciicharacter\unimod
     \char\unimod % \unicodeascii\unimod
   \else\ifcsname\@@univector\unidiv\endcsname
     \csname\doutfunihash{\unidiv}{#1}\endcsname
   \else % so, these can be different fonts !
     \unicodeglyph\unidiv\unimod % no \uchar (yet)
   \fi\fi}

Basically, I'd like to use the \unicodeasciicharacter hook with this
definition:

\def\unicodeasciicharacter{\uchar{0}}

(I'm not certain the above is release-quality code, but I've been testing
it with a stripped down \utfunifontglyph that should be functionally
equivalent.)

Working with the unicode code makes me appreciate that it's really
powerful part of ConTeXt. Thanks, Hans!

gelukkig nieuwjaar,
adam
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay                      atl@comp.lancs.ac.uk
 Computing Dept, Lancaster University   +44(0)1524/594.537
 Lancaster, LA1 4YR, UK             Fax:+44(0)1524/593.608
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

             reply	other threads:[~2004-01-02 17:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-02 17:59 Adam Lindsay [this message]
2004-01-03 22:38 ` Hans Hagen
2004-01-05 13:43   ` Adam Lindsay
2004-01-05 14:23   ` My Way: Unicode Symbols Adam Lindsay
2004-01-05 19:20     ` Adam Lindsay
2004-01-05 20:12     ` Hans Hagen
2004-01-06 12:22       ` Adam Lindsay
2004-01-06 14:01         ` Hans Hagen
2004-01-07 15:26           ` Adam Lindsay
2004-01-11 11:30       ` Adam Lindsay

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=20040102175913.3787@smtp.btinternet.com \
    --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).