[NTG-context] ec encoding and tcaron

Vit Zyka vit.zyka at seznam.cz
Sun Aug 14 11:48:16 CEST 2005


Hans Hagen wrote:
> 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

Yes, Hans, it works in utf8. In case of il2 it works too if expansion is 
also done:

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

---

Actually I discovered the source of the problem with \tcaron!
There exists enco-ecm.tex file with some exceptions. And there is

   \definecharacter tcaron     {\buildtextaccent\textcaron t}

If I comment this line, expansion is not needed. I suggest to omit it 
since \tcaron is now present in lm.

But \WORD I do not use (it was only product of my debugging) I use 
pseudo caps and there the problem preserves. Files attached and
   texfont --fontroot=X: --en=ec --ve=public --co=lm --source=auto 
--ca=0.8 lmbx10


> 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, did you think about Petr Olsak's enc-tex? I believe it is much 
straight-forward solution that solve input enco, output to files and 
output to log (utf8 works too). And it should be much quicker than 
macros. I am not sure, but perhaps there is no patch to aleph now...

vit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smallcaps.zip
Type: application/zip
Size: 1863 bytes
Desc: not available
Url : http://www.ntg.nl/pipermail/ntg-context/attachments/20050814/06509ad6/smallcaps.zip


More information about the ntg-context mailing list