ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* new trickery
@ 2013-03-14 23:39 Hans Hagen
  2013-03-15  2:08 ` Idris Samawi Hamid ادريس   سماوي حامد
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2013-03-14 23:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

There is a new experimental feature and (at least for now) it's also 
called \feature (maybe not the best name).

Many fonts have language dependent features. There are also features 
that one only wants to enable in small text snippets. For this we have 
\addff etc but these don't accumulate. The next example demonstrates an 
accumulator.

\setupbodyfont[pagella]

\starttext

% When the (again experimental) setup for 'font' is used, the
% features will also adapt themselves to the language. I'm
% still considering on how to deal with the main language.

% \definefontfeature[nl][language=nld,script=latn]
\setuplanguages[font=auto]
% \setuplanguage [default][font=auto]
% \setuplanguage [nl][font=auto]

% We need to make a nice set of 'simple' switchers.

\definefontfeature[f:smallcaps][smcp=yes]
\definefontfeature[f:nocaps]   [smcp=no]
\definefontfeature[f:oldstyle] [onum=yes]
\definefontfeature[f:newstyle] [onum=no]

% watch how features accumulate

\startTEXpage[offset=10pt]
     fijn fietsen 123
     \feature{f:oldstyle}
     fijn fietsen 123
     \feature{f:smallcaps}
     fijn fietsen 123
     \feature{f:oldstyle}
     fijn fietsen 123
     \start
     \nl % \feature{nl}
     fijn fietsen 123
     \de
     fijn fietsen 123
     \stop
     fijn fietsen 123
     \feature{f:newstyle}
     fijn fietsen 123
     \feature{f:nocaps}
     fijn fietsen 123
\stopTEXpage

% watch how lm has contextual lookups for ligatures
% that depend on the language

\startTEXpage[offset=10pt]
     \definedfont[lmroman10-regular*default]
     fijn fietsen
     \nl
     fijn fietsen
     \de
     fijn fietsen
\stopTEXpage

\stoptext

This mechanism is (just as \addff cum suis) somewhat slower but as long 
as it's used grouped, performance is quite ok.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-15 18:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-14 23:39 new trickery Hans Hagen
2013-03-15  2:08 ` Idris Samawi Hamid ادريس   سماوي حامد
2013-03-15  4:18   ` Idris Samawi Hamid ادريس   سماوي حامد
2013-03-15  8:35     ` Hans Hagen
2013-03-15 17:16       ` Jonathan Barchi
2013-03-15 18:29         ` Hans Hagen
2013-03-15 11:07     ` Hans Hagen
2013-03-15 18:11       ` Idris Samawi Hamid ادريس   سماوي حامد
2013-03-15 18:29         ` Hans Hagen
2013-03-15 18:30         ` Hans Hagen
2013-03-15  8:31   ` Hans Hagen

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).