ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \=i
Date: Thu, 03 Jun 2004 13:31:49 +0200	[thread overview]
Message-ID: <6.1.1.1.2.20040603133129.01d29ec0@server-1> (raw)
In-Reply-To: <20040602204521.19379@smtp.btinternet.com>

At 21:45 02/06/2004, you wrote:

>I'd prefer (at least a variant) that does it based on fontstyle as well:
>
>\unprotect
>
>\definesystemvariable{sx}
>
>\def\definestylecollection
>    {\dotripleargument\dodefinestylecollection}
>
>\def\dodefinestylecollection[#1][#2][#3][#4]%
>    {\unexpanded\setvalue{#1}{\styleinstance[#1]}%
>     \setvalue{\??sx#1:#2:#3}{#4}}
>
>\unexpanded\def\styleinstance[#1]%
>    {\executeifdefined{\??sx#1:\fontstyle:\fontalternative}{\getvalue{\?
>?sx#1:\fontstyle:\s!default}}}
>
>\protect
>\definestylecollection[caps][ss][default][\sc]
>\definestylecollection[caps][ss][bf][\bc]
>\definestylecollection[caps][ss][bi][\bc]
>\definestylecollection[caps][ss][bs][\bc]

% \definestylecollection[mine]

% \definestyleinstance[mine][default][sorry]
% \definestyleinstance[mine][tt][bs][ttbs:\rm\sl]
% \definestyleinstance[mine][tt][bf][ttbf:\rm\sl]
% \definestyleinstance[mine][bf][\sl]
% \definestyleinstance[mine][sl][\tt]

% {\bf test \mine test \sl test \mine test \bs oeps \mine oeps {\tt test 
\mine \bf test}}

\definesystemvariable{sx}

\def\definestylecollection
   {\dosingleargument\dodefinestylecollection}

\def\dodefinestylecollection[#1]%
   {\iffirstargument
      \unexpanded\setvalue{#1}{\styleinstance[#1]}%
      \def\docommand##1%
        {\def\dodocommand####1{\letbeundefined{\??sx##1:####1:\commalistelement}}%
         \processcommacommand[\alternativelist,\s!default]\dodocommand}%
      \processcommacommand[\stylelist,\s!default]\docommand
    \fi}

\def\definestyleinstance
   {\doquadrupleargument\dodefinestyleinstance}

\def\dodefinestyleinstance[#1][#2][#3][#4]% [name] [rm|ss|tt|..] 
[sl|bf|...] [whatever]
   {\iffirstargument
      \doifundefined{#1}{\definestylecollection[#1]}%
    \fi
    \iffourthargument
      \setvalue{\??sx#1:#2:#3}{#4}%
    \else\ifthirdargument
      \setvalue{\??sx#1::#2}{#3}%
    \else\ifsecondargument
      \letvalue{\??sx#1::#2}\empty
    \fi\fi\fi}

\unexpanded\def\styleinstance[#1]% will be faster
   {%\begingroup\expanded{\infofont[#1:\fontstyle:\fontalternative]}\endgroup
    \executeifdefined{\??sx#1:\fontstyle:\fontalternative}%
   {\executeifdefined{\??sx#1:\fontstyle:\s!default}%
   {\executeifdefined{\??sx#1::\fontalternative}
   {\getvalue        {\??sx#1::\s!default}}}}}

      reply	other threads:[~2004-06-03 11:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 23:50 \=i Idris Samawi Hamid
2004-05-21 10:28 ` \=i Hans Hagen
2004-05-21 15:58   ` \=i Idris Samawi Hamid
2004-05-24 18:42   ` \=i Idris Samawi Hamid
2004-05-26 19:33     ` \=i Idris Samawi Hamid
2004-05-27 10:31       ` Re[2]: \=i Giuseppe Bilotta
2004-05-27 19:11         ` Idris Samawi Hamid
2004-05-27 21:47         ` Hans Hagen
2004-05-29  3:24           ` Idris Samawi Hamid
2004-06-01 19:04             ` Hans Hagen
2004-06-02 19:45               ` \=i Adam Lindsay
2004-06-03 11:31                 ` Hans Hagen [this message]

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=6.1.1.1.2.20040603133129.01d29ec0@server-1 \
    --to=pragma@wxs.nl \
    --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).