[NTG-context] ec encoding and tcaron

Hans Hagen pragma at wxs.nl
Sat Aug 13 23:31:42 CEST 2005


Vit Zyka wrote:

> let allowed me some pessimism. I am working on our 
> 40-years-scout-group-bulletin intensively for more then a month. I 
> have to solve many many technical problems instead on focusing on the 
> design. The Bulletin is rather complex but many problems are 'simple'. 
> I start to doubt if ConTeXt (and that is why TeX generally) is good 
> tool for such typsetting. Detective debugging is good fun but if time 
> is going, no results, and the list of todo technical unwanted features 
> is increasing...

(btw, magazines can be doen quite well with columnsets) 

Here is a patched WORD (core-fnt):

\chardef\uppercasemode\plusone % 0=ignore 1=normal 2=expand

\unexpanded\def\WORD#1%
  {\bgroup
   \the\everyuppercase
   \let\smallcapped\firstofoneargument
   \let\WORD\firstofoneargument
   \let\dochar\rawcharacter
   \ifcase\uppercasemode
     #1%
   \or % No expansion here, otherwise \getvalue problems! Default!!!
    %\edef\next{#1}% keep this to prevent roll back
    %\uppercase\expandafter{\next}% keep this to prevent roll back
     \uppercase{#1}%
   \or
     \expanded{\uppercase{#1}}% needed when in utf8
   \fi
   \egroup}

And here a patched \definecharacter (enco-ini)

\def\numcharacter#1{\char#1 }
\let\dochar\numcharacter

\def\definecharacter#1 #2 %
  {\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
   \doifnumberelse{\string#2}
     {\setevalue{\characterprefix\characterencoding\string#1}%
        {\dochar{#2}}%
      \doautosetregime{#1}{#2}}
     {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}

% goes on top of enco-utf 

\prependtoks
  \doif\currentregime{utf}{\chardef\uppercasemode\plustwo}%
\to\everyuppercase


% \input enco-ini-new.tex

% \startmapping [ec]
%   \defineuppercasecom \something \nothing 
% \stopmapping

\input enco-ec.tex % needed when no new format 

\starttext

\enableregime[utf] \usetypescript[modern][ec] \setupbodyfont[10pt,rm]

ť Ť \ccaron

\WORD{ť Ť \ccaron}

\stoptext

I didn't test this with latin input; the trick is to let the named glyphs expand to a raw character which then can be uppercased by tex. quite dirty. It is dangerous to do this always because in the case of written/reread data we cannot output raw characters since they would eb regimes again (this time in the wrong way). 

Hans 


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



More information about the ntg-context mailing list