[NTG-context] disabling onum in url

Pablo Rodríguez oinos at web.de
Sun Oct 2 19:53:13 CEST 2011


On 10/02/2011 06:40 PM, Philipp Gesang wrote:
> Well, in my previous example, rather use:
> 
>   \definefontfeature[url][onum=no,smcp=yes]
> 
> and come back with a complete example if it doesn’t help.

Philipp, I'm afraid it doesn't work. Sample file:

\definefontfeature[default][default][onum=yes]
\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]

%%% First, define the switch for text figures:
\definefontfeature[url][onum=no,smcp=yes]

%%% Best use context’s default url commands:
\useURL[aurl][http://www.pragma-ade.com/download-1.htm]

%%% It comes with a proper setup for everything.
\setupurl[style={\tf\addff{url}}]

%%% If you must use the “href” macro, disable the font feature locally.
\define[1]\href{%
  \begingroup
    \addff{url}%
    \goto{\hyphenatedurl{#1}}[url(#1)]%
  \endgroup%
}

\starttext

42
%%% With the internal command:
\from[aurl]
42
%%% Your way:
\href{0123456789abcdef}
42

> (Btw, looks like you consider setting the default font style to
> small caps. Is this really what you intended?)

No, I was only checking the “feature”. It seems that if an OT feature is
enabled as default, you cannot disable it for urls (at least, this is
what I get).

>> After having to write the second url, I began to think it was
>> unnecessarily complex.
> 
> Fwiw I think that \useURL fits the context style best as it
> separates the declaration of an element from its use in the
> document.

Sorry, but I'm afraid I don't see your point. Would you think the same
for titles or emphasized text?

Imagine a whole book in one document. If you have more than 100 urls, it
would be inconvenient to have to go to the document preamble and back to
the body text only to add an url.

But I guess it might be a question of habits.

Many thanks for your help again,


Pablo
-- 
http://www.ousia.tk


More information about the ntg-context mailing list