ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* again: new module mechanism
@ 2006-04-10  9:13 Thomas A. Schmitz
  2006-04-10  9:45 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas A. Schmitz @ 2006-04-10  9:13 UTC (permalink / raw)


All, and esp. Hans, Taco,

I'm still experimenting with the new moduleparameter mechanism. One  
thing I can't get to work is using it in a \definefont. Here's my  
minimal example:

\startmodule[mymod]

\unprotect

\setupmodule[font=Times]

\definefontsynonym[Times][ec-TimesNewRoman] % valid name

\definefont[myfont][\currentmoduleparameter{font}]

\message{The myfont is \currentmoduleparameter{font}}

\protect
\stopmodule
\endinput

\usemodule[mymod][font=Times]

\starttext

Hello world!

\myfont and hello again

\purefontname\font

\stoptext

In the log file, I get:

(./t-mymod.tex The myfont is Times)

So the definefont should work (if I define \definefont[myfont] 
[Times], I get the expected output), but the file fails to compile,  
with this error:

! Missing \endcsname inserted.
<to be read again>
                    \@@md:unknown:font
\truefontname #1->\ifcsname \??ff \fontclass #1
                                                \endcsname \@EA  
\truefontname...

\donoparsefontspec ...\truefontname \somefontname
                                                   }\ifx \fontfile \s! 
unknown...

\dododefinefont ...e \fontbody \parsefontspec {#2}
                                                   \rawfontidentifier  
\let \l...

\redodefinefont #1#2#3->\dododefinefont {#1}{#2}
                                                 \doifsetupselse {#3}  
{\setup...
l.7 \myfont
             and hello again
?
Process aborted

What am I missing?

Best

Thomas

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

* Re: again: new module mechanism
  2006-04-10  9:13 again: new module mechanism Thomas A. Schmitz
@ 2006-04-10  9:45 ` Taco Hoekwater
  2006-04-10 10:39   ` Thomas A. Schmitz
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2006-04-10  9:45 UTC (permalink / raw)




Thomas A. Schmitz wrote:
> All, and esp. Hans, Taco,
> 
> I'm still experimenting with the new moduleparameter mechanism. One  
> thing I can't get to work is using it in a \definefont. Here's my  
> minimal example:
> 
> \startmodule[mymod]
> 
> \unprotect
> 
> \setupmodule[font=Times]
> 
> \definefontsynonym[Times][ec-TimesNewRoman] % valid name
> 
> \definefont[myfont][\currentmoduleparameter{font}]

Hi Thomas,

   \expanded {\definefont[myfont][\currentmoduleparameter{font}]}

\definefont needs expanded arguments

Cheers, Taco

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

* Re: again: new module mechanism
  2006-04-10  9:45 ` Taco Hoekwater
@ 2006-04-10 10:39   ` Thomas A. Schmitz
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas A. Schmitz @ 2006-04-10 10:39 UTC (permalink / raw)



On Apr 10, 2006, at 11:45 AM, Taco Hoekwater wrote:

>
> Hi Thomas,
>
>    \expanded {\definefont[myfont][\currentmoduleparameter{font}]}
>
> \definefont needs expanded arguments
>
> Cheers, Taco

Taco,

wonderful, that does it! I really need to learn more about TeX  
digestion and expansion...

Grateful

Thomas

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

end of thread, other threads:[~2006-04-10 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-10  9:13 again: new module mechanism Thomas A. Schmitz
2006-04-10  9:45 ` Taco Hoekwater
2006-04-10 10:39   ` Thomas A. Schmitz

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