ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* inheriting size characteristics
@ 2005-04-19 16:04 Idris Samawi Hamid
  2005-04-21 16:53 ` Adam Lindsay
  0 siblings, 1 reply; 4+ messages in thread
From: Idris Samawi Hamid @ 2005-04-19 16:04 UTC (permalink / raw)


Dear fellow knights,

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.

What am I missing?

Thnx in advance
Idris

======================type-lmtest===================
\definestyle[smallcapssemibold,semiboldsmallcaps][\scsb][]

\starttypescript[serif]                 [lm][default]
  \definefontsynonym [LM]               [texnansi-lmr12]
  \definefontsynonym [LMBold]           [texnansi-lmr12]
  \definefontsynonym [LMSemiboldCaps]   [texnansi-lmr12]
\stoptypescript

\starttypescript[serif]                 [lm] [name]
  \definefontsynonym [Serif]            [LM]
  \definefontsynonym [SerifBold]        [LMBold]
  \definefontsynonym [SerifSemiboldCaps][LMSemiboldCaps]
\stoptypescript

\starttypescript[serif] [lm] [size]
  \definebodyfont [20.7pt,24.9pt,17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt]
  [rm]
  [tf=Serif             sa 1,
   bf=SerifBold         sa 1,
   scsb=SerifSemiboldCaps         sa 1,
   scsba=SerifSemiboldCaps        sa a,
   scsbb=SerifSemiboldCaps        sa b,
   scsbc=SerifSemiboldCaps        sa c,
   scsbd=SerifSemiboldCaps        sa d]
\stoptypescript

\starttypescript[LMtest]
  \definebodyfontenvironment
  [lmtest]
  [default]
  [interlinespace=2.8ex]

  \definetypeface [lmtest]
  [rm] [serif] [lm] [lm] [encoding]
\stoptypescript
====================================================

====================test-lm.tex=====================
% output=pdf interface=en

  \usetypescriptfile[type-lmtest]
  \usetypescript[LMtest]
  \setupbodyfont[lmtest]

\starttext

\tfc    This is a test of Minion~Pro Opticals. 123467689

\bf     This is a test of Minion~Pro Opticals. 123467689

\scsb   This is a test of Minion~Pro Opticals. 123467689

\stoptext
====================================================

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

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

* Re: inheriting size characteristics
  2005-04-19 16:04 inheriting size characteristics Idris Samawi Hamid
@ 2005-04-21 16:53 ` Adam Lindsay
  2005-04-22  8:19   ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Lindsay @ 2005-04-21 16:53 UTC (permalink / raw)


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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: inheriting size characteristics
  2005-04-21 16:53 ` Adam Lindsay
@ 2005-04-22  8:19   ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2005-04-22  8:19 UTC (permalink / raw)


Adam Lindsay wrote:

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

indeed the two chars is a limitation (i may be able to get around it but it will 
probably involve some magic, late nights, headaches, etc)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

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

* inheriting size characteristics
@ 2005-04-19 16:08 Idris Samawi Hamid
  0 siblings, 0 replies; 4+ messages in thread
From: Idris Samawi Hamid @ 2005-04-19 16:08 UTC (permalink / raw)


An error, but does not affect the problem (forgot the `=default'):

\definetypeface [lmtest]
[rm] [serif] [lm] [lm] [encoding=default]

Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

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

end of thread, other threads:[~2005-04-22  8:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-19 16:04 inheriting size characteristics Idris Samawi Hamid
2005-04-21 16:53 ` Adam Lindsay
2005-04-22  8:19   ` Hans Hagen
2005-04-19 16:08 Idris Samawi Hamid

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