ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Adam Lindsay" <atl@comp.lancs.ac.uk>
Subject: Re: inheriting size characteristics
Date: Thu, 21 Apr 2005 17:53:30 +0100	[thread overview]
Message-ID: <20050421175330.20070@mail.comp.lancs.ac.uk> (raw)
In-Reply-To: <4272C946@webmail.colostate.edu>

Idris Samawi Hamid said this at Tue, 19 Apr 2005 10:04:28 -0600:

>Given predefined switches like \tf and \bf, one inherits the size 
>characteristics of the one already declared. But for user-defined switches 
>this does not work. The following minimal files (typescript and test) is
>a bit 
>long, but it accurately illustrates the problem and uses the default
>fonts. My 
>user-defined switch works, but does not inherit from, e.g., \tfc. But \bf
>does 
>inherit.

Idris,

I don't have time to really delve into the implementation details, but it
looks like the difference is that ConTeXt isn't so responsive with user-
defined alternatives with more than two characters. Compare the stripped
down version with your own. Your \scsb has been changed to \SB, effectively. 

Note the tricks that can happen behind the scenes: \SBc isn't defined,
but still \SB gets scaled at `c'. \SBb is defined as scaled to something
different, and the switch picks up that fact. In short, there's a lot of
subtle, tricky stuff going on behind the scenes that I don't understand fully:


%D The in-file typescript requires a recent beta!
\starttypescript[serif]                 [lm][default]
  \definefontsynonym [LM]               [texnansi-lmr12]
  \definefontsynonym [LMBold]           [texnansi-lmbx12]
  \definefontsynonym [LMSemiboldCaps]   [texnansi-lmro12]
\stoptypescript

\starttypescript[serif] [lm] [size]
  \definebodyfont [12pt]
  [rm]
  [tf=LM             sa 1,
   bf= LMBold         sa 1,
   SB= LMSemiboldCaps        sa 1,
   SBa=LMSemiboldCaps        sa a,
   SBb=LMSemiboldCaps        sa d, % !!!
%  SBc=LMSemiboldCaps        sa c, % !!!
   SBd=LMSemiboldCaps        sa d]
\stoptypescript

  \definetypeface [lmtest] [rm] [serif] [lm] [lm] 

  \setupbodyfont[lmtest,12pt]

\starttext

\tfc    This is a test of stacking font commands. 123467689

\bf     This is a test of stacking font commands. 123467689

\SB     This is a test of stacking font commands. 123467689

\textrule
\tfb    This is a test of stacking font commands. 123467689

\SB     This picks up the unusual size implicitly. 123467689

\bf     This is a test of stacking font commands. 123467689
\stoptext


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  reply	other threads:[~2005-04-21 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19 16:04 Idris Samawi Hamid
2005-04-21 16:53 ` Adam Lindsay [this message]
2005-04-22  8:19   ` Hans Hagen
2005-04-19 16:08 Idris Samawi Hamid

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=20050421175330.20070@mail.comp.lancs.ac.uk \
    --to=atl@comp.lancs.ac.uk \
    --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).