ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* RE: Defining new font switches (solved?)
@ 2005-04-08 21:43 Idris Samawi Hamid
  2005-04-08 23:09 ` Adam Lindsay
  0 siblings, 1 reply; 3+ messages in thread
From: Idris Samawi Hamid @ 2005-04-08 21:43 UTC (permalink / raw)


Ok, I think I have come closer to understanding the \definestyle problem.  The 
problem (bug?) is in  \definetypeface. Consider the following test typescript:

==============type-testlm.tex===============
\definestyle [mvmystyle] [\mv] []

\starttypescript [serif] [mystyle] [name]

  \definefontsynonym [MySerif]     [cmcsc10]

  \definefontsynonym [Serif]       [MySerif]

\stoptypescript

\starttypescript [serif] [mystyle] [size]

  \definebodyfont
    [20.7pt,17.3pt,14.4pt,12pt,11pt,10pt,
     9pt,8pt,7pt,6pt,5pt,4pt]
    [rm]
    [tf=Serif sa 1,
     mv=Serif sa 1]

\stoptypescript

\starttypescript [MYTest]

  \definebodyfontenvironment
    [mytest]
    [default]
    [interlinespace=2.8ex]

  \definetypeface [mytest] [rm] [serif] [mystyle]
  %[mystyle] [encoding=default]

\stoptypescript
==============================================

Now consider the following test file:

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

\usetypescriptfile[type-testlm]
\usetypescript[MYTest]
\setupbodyfont[mytest,12pt]

\starttext

{\tf This is a test.}

{\normal This is a test.}

{\mv This is a test.}

{\mvmystyle This is a test.}

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

Consider the  \definetypeface line. If we leave the comment in place, then the 
\tf switch will work (and give us small caps) while the \mv switch will give 
an undefined control sequence. If we uncomment the last two options in  
\definetypeface, then \mv will also work.

Why do predefined switches like \tf work with 4 options while user-defined 
style options fail? Is this a bug or feature (seems inconsistent)?

Thnx in advance as always, and happy weekend
Idris

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

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

* Re: Defining new font switches (solved?)
  2005-04-08 21:43 Defining new font switches (solved?) Idris Samawi Hamid
@ 2005-04-08 23:09 ` Adam Lindsay
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Lindsay @ 2005-04-08 23:09 UTC (permalink / raw)


Idris Samawi Hamid said this at Fri, 8 Apr 2005 15:43:49 -0600:

>  \definetypeface [mytest] [rm] [serif] [mystyle]
>  %[mystyle] [encoding=default]

>Consider the  \definetypeface line. If we leave the comment in place,
>then the 
>\tf switch will work (and give us small caps) while the \mv switch will give 
>an undefined control sequence. If we uncomment the last two options in  
>\definetypeface, then \mv will also work.

this is absolutely consistent!
The second mystyle argument, the one that you commented out, is the
argument for the "size" typescripts. As you only define the mv
alternative in [serif] [mystyle] [size], that makes perfect sense. 

For further details, look at the definition in type-ini, which reduces
down to:
\def\definetypeface[#1][#2][#3][#4][#5][#6]
 {\usetypescript[#3,map][#4][name,default,\typefaceencoding,special]
  \usetypescript[#3][#5][size]}

In the commented out version, there's no #5, so it defaults to the
[serif] [default] [size] typescript. There's no \mv definition there, so
ConTeXt complains. When you correctly tell ConTeXt where to look, all is
right with the world.
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 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] 3+ messages in thread

* RE: Defining new font switches (solved?)
@ 2005-04-09  2:07 Idris Samawi Hamid
  0 siblings, 0 replies; 3+ messages in thread
From: Idris Samawi Hamid @ 2005-04-09  2:07 UTC (permalink / raw)


Hi Adam,

Thank you very much for explaining this. After some more research, I actually 
finally figured it out a few hours ago (including the examination of 
type-ini), but felt embarrased at bothering the list yet again about it;-)

At least I'm "back in business" once again:-) Hopefully my hours of struggling 
with things like this will pay off in the end...

Thnx again, Adam and 
my best to all
Idris

>===== Original Message From "Adam Lindsay" <atl@comp.lancs.ac.uk> =====
>Idris Samawi Hamid said this at Fri, 8 Apr 2005 15:43:49 -0600:
>
>>  \definetypeface [mytest] [rm] [serif] [mystyle]
>>  %[mystyle] [encoding=default]
>
>>Consider the  \definetypeface line. If we leave the comment in place,
>>then the
>>\tf switch will work (and give us small caps) while the \mv switch will give
>>an undefined control sequence. If we uncomment the last two options in
>>\definetypeface, then \mv will also work.
>
>this is absolutely consistent!
>The second mystyle argument, the one that you commented out, is the
>argument for the "size" typescripts. As you only define the mv
>alternative in [serif] [mystyle] [size], that makes perfect sense.
>
>For further details, look at the definition in type-ini, which reduces
>down to:
>\def\definetypeface[#1][#2][#3][#4][#5][#6]
> {\usetypescript[#3,map][#4][name,default,\typefaceencoding,special]
>  \usetypescript[#3][#5][size]}
>
>In the commented out version, there's no #5, so it defaults to the
>[serif] [default] [size] typescript. There's no \mv definition there, so
>ConTeXt complains. When you correctly tell ConTeXt where to look, all is
>right with the world.

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

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

end of thread, other threads:[~2005-04-09  2:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08 21:43 Defining new font switches (solved?) Idris Samawi Hamid
2005-04-08 23:09 ` Adam Lindsay
2005-04-09  2:07 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).