ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: "Idris Samawi Hamid ادريس سماوي حامد" <ishamid@colostate.edu>
Subject: Re: new trickery
Date: Fri, 15 Mar 2013 19:29:41 +0100	[thread overview]
Message-ID: <51436895.4020801@wxs.nl> (raw)
In-Reply-To: <CAFBQp-u-ArXCSeAu6OhcevFgekq6i6c106DuPf0aXABPnWf6nQ@mail.gmail.com>

On 3/15/2013 6:16 PM, Jonathan Barchi wrote:
> On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen <pragma@wxs.nl> wrote:
>> On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:
>>>
>>> On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
>>> حامد <ishamid@colostate.edu> wrote:
>>>
>>>> To round it off I guess we need a replacement for \subfs as well.
>>>
>>>
>>> Hmm, it seems that \subfs functionality is built in through the same
>>> mechanism. Will study this some more...
>>
>>
>> yes, but there in successive calls the last one counts
>>
>> \addff{x} \addff{y} \addff{z}  -> z is used on top of the current font's set
>>
>> \feature{x} \feature{y} \feature{y} -> all are used on top
>>
>> we might end up with replacing \addff etc by one mechanisms
>>
>> \feature{+someset} : add
>> \feature{-someset} : subtract
>> \feature{=someset} : replace
>>
>
> I like this proposal for its use of only a single command with the
> add/remove/reset in the args. If \feature ends up being too generic,
> maybe \fontfeature or \fontfeatureset instead?
>
> To keep things more in-line with current ConTeXt syntax, you could do
> something like the following:
>
> \feature{add=foo}
> \feature{subtract=bar}    (or sub, remove, etc.)
> \feature{reset,add=baz}
>
> Which would also allow, e.g.,
>
> \feature{add=bar,remove=baz}

I'd like to avoid parsing as much as possible here as these are state 
changers. So, I made:

\addfeature     [f:mine] \feature[more][f:mine] \feature[+]      [f:mine]
\subtractfeature[f:mine] \feature[less][f:mine] \feature[-]      [f:mine]
\replacefeature [f:mine] \feature[new] [f:mine] \feature[=]      [f:mine]
\revivefeature  [f:mine] \feature[old] [f:mine] \feature[default][f:mine]
\resetfeature            \feature[reset]

so there are several ways to achieve the same (and one can use {} 
instead of [])

> similar to how we're used to using key:value pairs in so many
> arguments, and being able to combine them in one function call.

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
___________________________________________________________________________________

  reply	other threads:[~2013-03-15 18:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 23:39 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 [this message]
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

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=51436895.4020801@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ishamid@colostate.edu \
    --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).