Re: [NTG-context] finishing a module

2005-01-25 Thread h h extern
Thomas A.Schmitz wrote:
Oh dear, thanks so much! This does it, and I'm so impressed what you  
-)
\define\crux   {{\Gf \char 43}}
depending on how you use this, you can consider making those symbols
an other option is
  \define\crux{\getglyph{\getvariable{Greek}{font}}{43}}
or so (untested); such glyphs also scale well.
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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-24 Thread Thomas A . Schmitz
Oh dear, thanks so much! This does it, and I'm so impressed what you  
can do in five minutes - absolutely amazing! Plus, it's mindboggling to  
see that all of this can be achieved within ConTeXt, without recourse  
to low level stuff. One day, when life is less hectic than now, I'll  
write you a long letter describing my admiration for you, Hans.  
Sometimes I feel like we Context-users are like the Apple people in the  
TeX world, and you're our Steve Jobs. Everything is so much more  
powerful, elegant, sleek, esthetic, you name it...

Well, whatever, I will try and finish my work on this stuff and then I  
would love to share it with anbody who might be interested.

Thanks, and all best
Thomas
On Jan 24, 2005, at 7:03 PM, Hans Hagen wrote:
Thomas A.Schmitz wrote:
If anybody can spare five minutes, I append what I have got so far;   
maybe I'm overlooking something obvious. Sorry for the lengthy post  
and  for taking your time!
hm, this is a ll i can do in five minutes:
- just use the fontname remapper instead of processaction and  
intermediate vars
- use getvariables instead of interface specific getparameters
- end the par inside the start/stopgreek
- no low level hacking needed

\starttext
\setvariables[Greek][scale=1,font=Kadmos]
\definefontsynonym[Oxonia]  [greeoxon]
\definefontsynonym[Ibycus]  [fibr]
\definefontsynonym[Bosporos][bosporos]
\definefontsynonym[Gentium] [gentiumgr]
\definefontsynonym[Kadmos]  [kadmo]
\definefontsynonym[Leipzig] [grbl]
\definefontsynonym[Teubner] [teubnerc]
% \definefont[Gf][\getvariable{Greek}{font} sa  
\getvariable{Greek}{scale}]

\definebodyfont
  [4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,
   14pt,14.4pt,16pt,18pt,20pt,22pt]
  [rm]
  [Gf=\getvariable{Greek}{font} sa \getvariable{Greek}{scale}]
\def\enablegreek
  {\language[greek]%
   \catcode`~=\other
   \catcode`|=\other
   \catcode`'=\other}
\def\startgreek{\par\begingroup\Gf\enablegreek}
\def\stopgreek {\par\endgroup}
\def\localgreek{\groupedcommand{\Gf\enablegreek}\donothing}
\define\sampi  {{\Gf \char 34}}
\define\digamma{{\Gf \char 35}}
\define\stigma {{\Gf \char 36}}
\define\koppa  {{\Gf \char 37}}
\define\lunars {{\Gf \char  1}}
\define\lunarS {{\Gf \char 13}}
\define\brcl   {{\Gf \char  8}}
\define\brcr   {{\Gf \char  9}}
\define\hbrl   {{\Gf \char123}}
\define\hbrr   {{\Gf \char125}}
\define\crux   {{\Gf \char 43}}
I have no greek, so: \definefontsynonym[kadmo][cmvtt10] \crux
\stoptext

Thanks everybody!
Thomas
%module t-greek providing method for Greek input in ConTeXt
\unprotect
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]%Font,Scale
\xdef\MyScale{\GGScale}%
\processaction[\GGFont]
   [  Oxonia=>\gdef\MyFont{greeoxon },%this switches from the  
"logical"  name of the font to the actual tfm
  Ibycus=>\gdef\MyFont{fibr },
Bosporos=>\gdef\MyFont{Bosporos },
 Gentium=>\gdef\MyFont{gentiumgr },
  Kadmos=>\gdef\MyFont{kadmo },
 Leipzig=>\gdef\MyFont{grbl },
 Teubner=>\gdef\MyFont{Teubnerc }]%
}
\protect
%\definefont[Gf][kadmo ] %When given the name of the tfm in clear,  
this  works
%\definefont[Gf][\MyFont]%This does not work, and I have no clue why
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14. 
4p t,16pt,18pt,20pt,22pt][rm][Gf=\MyFont sa \MyScale] %This DOES  
work, and  I can't see what's the fundamental difference to the  
preceding line.
\def\enablegreek{\language[greek]\catcode`~=\other\catcode`|=\other\ca 
tc ode`'=\other}%this was provided by Giuseppe
\def\startgreek{\par\begingroup\Gf\enablegreek}
\let\stopgreek\endgroup
\def\localgreek{\groupedcommand{\Gf\enablegreek}{}}
\define\sampi{{\Gf \char34}}%and this by Taco
\define\digamma{{\Gf \char35}}
\define\stigma{{\Gf \char36}}
\define\koppa{{\Gf \char37}}
\define\lunars{{\Gf \char1}}
\define\lunarS{{\Gf \char13}}
\define\brcl{{\Gf \char8}}
\define\brcr{{\Gf \char9}}
\define\hbrl{{\Gf \char123}}
\define\hbrr{{\Gf \char125}}
\define\crux{{\Gf \char43}}
On Jan 23, 2005, at 10:24 PM, h h extern wrote:
Thomas A.Schmitz wrote:
I spent some (too much) time today improving my Greek module. For  
the   time being, two questions remain; I'm confident that they're  
not too   difficult for the experts; any help would be appreciated.

what exactly do you want to achieve, if it's only some font  
following  the sizes and styyles ...

\definefontsynonym [Funny][cmr10]
\definefontsynonym [FunnyBold][cmbx10]
\definefontsynonym [FunnyItalic]  [cmti10]
% \definefontsynonym [FunnySlanted] [...]
% \definefontsynonym [FunnyBoldItalic]  [...]
% \definefontsynonym [FunnyBoldSlanted] [...]
\def\MyFunnyFont{\symbolicfont{Funny}}
test {\MyFunnyFont test} test
test {\it \MyFunnyFont test} test
test {\bf \MyFunnyFont test} test
-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.prag

Re: [NTG-context] finishing a module

2005-01-24 Thread Hans Hagen
Thomas A.Schmitz wrote:
If anybody can spare five minutes, I append what I have got so far;  
maybe I'm overlooking something obvious. Sorry for the lengthy post and  
for taking your time!
hm, this is a ll i can do in five minutes:
- just use the fontname remapper instead of processaction and intermediate vars
- use getvariables instead of interface specific getparameters
- end the par inside the start/stopgreek
- no low level hacking needed
\starttext
\setvariables[Greek][scale=1,font=Kadmos]
\definefontsynonym[Oxonia]  [greeoxon]
\definefontsynonym[Ibycus]  [fibr]
\definefontsynonym[Bosporos][bosporos]
\definefontsynonym[Gentium] [gentiumgr]
\definefontsynonym[Kadmos]  [kadmo]
\definefontsynonym[Leipzig] [grbl]
\definefontsynonym[Teubner] [teubnerc]
% \definefont[Gf][\getvariable{Greek}{font} sa \getvariable{Greek}{scale}]
\definebodyfont
  [4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,
   14pt,14.4pt,16pt,18pt,20pt,22pt]
  [rm]
  [Gf=\getvariable{Greek}{font} sa \getvariable{Greek}{scale}]
\def\enablegreek
  {\language[greek]%
   \catcode`~=\other
   \catcode`|=\other
   \catcode`'=\other}
\def\startgreek{\par\begingroup\Gf\enablegreek}
\def\stopgreek {\par\endgroup}
\def\localgreek{\groupedcommand{\Gf\enablegreek}\donothing}
\define\sampi  {{\Gf \char 34}}
\define\digamma{{\Gf \char 35}}
\define\stigma {{\Gf \char 36}}
\define\koppa  {{\Gf \char 37}}
\define\lunars {{\Gf \char  1}}
\define\lunarS {{\Gf \char 13}}
\define\brcl   {{\Gf \char  8}}
\define\brcr   {{\Gf \char  9}}
\define\hbrl   {{\Gf \char123}}
\define\hbrr   {{\Gf \char125}}
\define\crux   {{\Gf \char 43}}
I have no greek, so: \definefontsynonym[kadmo][cmvtt10] \crux
\stoptext

Thanks everybody!
Thomas
%module t-greek providing method for Greek input in ConTeXt
\unprotect
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]%Font,Scale
\xdef\MyScale{\GGScale}%
\processaction[\GGFont]
   [  Oxonia=>\gdef\MyFont{greeoxon },%this switches from the "logical"  
name of the font to the actual tfm
  Ibycus=>\gdef\MyFont{fibr },
Bosporos=>\gdef\MyFont{Bosporos },
 Gentium=>\gdef\MyFont{gentiumgr },
  Kadmos=>\gdef\MyFont{kadmo },
 Leipzig=>\gdef\MyFont{grbl },
 Teubner=>\gdef\MyFont{Teubnerc }]%
}

\protect
%\definefont[Gf][kadmo ] %When given the name of the tfm in clear, this  
works

%\definefont[Gf][\MyFont]%This does not work, and I have no clue why
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4p 
t,16pt,18pt,20pt,22pt][rm][Gf=\MyFont sa \MyScale] %This DOES work, and  
I can't see what's the fundamental difference to the preceding line.

\def\enablegreek{\language[greek]\catcode`~=\other\catcode`|=\other\catc 
ode`'=\other}%this was provided by Giuseppe

\def\startgreek{\par\begingroup\Gf\enablegreek}
\let\stopgreek\endgroup
\def\localgreek{\groupedcommand{\Gf\enablegreek}{}}
\define\sampi{{\Gf \char34}}%and this by Taco
\define\digamma{{\Gf \char35}}
\define\stigma{{\Gf \char36}}
\define\koppa{{\Gf \char37}}
\define\lunars{{\Gf \char1}}
\define\lunarS{{\Gf \char13}}
\define\brcl{{\Gf \char8}}
\define\brcr{{\Gf \char9}}
\define\hbrl{{\Gf \char123}}
\define\hbrr{{\Gf \char125}}
\define\crux{{\Gf \char43}}
On Jan 23, 2005, at 10:24 PM, h h extern wrote:
Thomas A.Schmitz wrote:
I spent some (too much) time today improving my Greek module. For 
the   time being, two questions remain; I'm confident that they're 
not too   difficult for the experts; any help would be appreciated.

what exactly do you want to achieve, if it's only some font following  
the sizes and styyles ...

\definefontsynonym [Funny][cmr10]
\definefontsynonym [FunnyBold][cmbx10]
\definefontsynonym [FunnyItalic]  [cmti10]
% \definefontsynonym [FunnySlanted] [...]
% \definefontsynonym [FunnyBoldItalic]  [...]
% \definefontsynonym [FunnyBoldSlanted] [...]
\def\MyFunnyFont{\symbolicfont{Funny}}
test {\MyFunnyFont test} test
test {\it \MyFunnyFont test} test
test {\bf \MyFunnyFont test} test
-
  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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


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

Re: [NTG-context] finishing a module

2005-01-24 Thread Thomas A . Schmitz
On Jan 24, 2005, at 6:50 PM, Hans Hagen wrote:
i cannot fond those fonts; can they downloaded?

Well, that's the point of creating this module: fibr, greeoxon, and 
grbl can be downloaded on CTAN (in the packages "Teubner," "psgreek," 
and "Ibycus" for LaTeX). Bosporos and kadmo were Greek fonts for 
Macintosh that I bought about 15 years ago; they were distributed by a 
company that doesn't exist anymore. I created the tfm etc. for my 
personal use (not sure about copyright stuff; if I make the module + 
fonts publicly available, I might have to leave them out). gentium is a 
unicode font that can be downloaded as a ttf from 
http://scripts.sil.org for free; I just created the tfm. Teubnerc is an 
old Greek font that I digitalized myself; it hasn't been used for about 
100 years, so according to German copyright law, it is pretty much in 
the public domain. This module would be an effort at some sort of 
Uber-package for all kinds of Greek fonts bundled into one thingy.

On Jan 24, 2005, at 6:50 PM, Hans Hagen wrote:
you need at least to initialize
  \setupgreek[Font=Leipzig,Scale=1]
OK, did that, but doesn't make a difference.
Thanks
Thomas
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-24 Thread Hans Hagen
Thomas A.Schmitz wrote:
If anybody can spare five minutes, I append what I have got so far;  
maybe I'm overlooking something obvious. Sorry for the lengthy post and  
for taking your time!
i cannot fond those fonts; can they downloaded?
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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-24 Thread Hans Hagen
Thomas A.Schmitz wrote:
you need at least to initialize
  \setupgreek[Font=Leipzig,Scale=1]
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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-24 Thread Thomas A . Schmitz
Thanks for your help and interest. OK, what I want to achieve is:  
setting up a collection of fonts for ancient (i.e. polytonic) Greek.  
These fonts need to be mixed into normal text, and there needs to be a  
simple way of switching to them. For the time being, I want to use the  
"babel"-encoding for writing Greek, so I need to make a couple of  
catcode changes (babel uses ~ and | for accents) [I guess if I can make  
this work, I will then try and see if I can cook something up  that  
will actually take unicode characters and transform them into something  
palatable for TeX, taking Adam's work as a model). I also need to  
create commands to access a couple of special symbols like koppa, sampi  
and braces for critical editions.

What I have: the fonts (there's 7 of them) in TeX-readable format (tfm  
+ pfb)
With the help of Giuseppe and several others, I have cooked up a macro  
that will switch to those fonts and do the catcode changes etc. Thus  
far, they had to be invoked with an \input for every single font.

Problems:
Depending on the Latin font used for the main document, the Greek font  
needs to be scaled or it will look ugly (too small, too big in  
comparison). Hence my attempt to use Context's "sa" construct.
I want to simplify things by writing a single module that will give  
access to all  the fonts by providing a unified way of choosing one of  
them.
My idea was having a module that would provide a new command  
\setupgreek that would take two arguments: Name of the font suitable  
for users, scaling factor.
E. g. \setupgreek[Oxonia][1.08] This module would then provide two  
commands for writing Greek, \localgreek{...} and \startgreek ...  
\stopgreek + commands for accessing the symbols.

Problems so far: my module defines the Greek font as a body font. As  
far as I can see, this will only work for predefined sizes [4pt,5pt  
etc.]. When a user sepcifies an unusual font size for his main document  
or when TeX calculates a weird size (e.g. in footnotes, Alan Bowens's  
problem last week), the font isn't defined anymore, and the macro for  
writing Greek doesn't work. \definefont doesn't appear to have this  
problem, but it works only if I give the name of the font "manually," I  
couldn't make it accept an internal macro (Taco was very helpful  
yesterday, but I couldn't make it work).

If anybody can spare five minutes, I append what I have got so far;  
maybe I'm overlooking something obvious. Sorry for the lengthy post and  
for taking your time!

Thanks everybody!
Thomas
%module t-greek providing method for Greek input in ConTeXt
\unprotect
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]%Font,Scale
\xdef\MyScale{\GGScale}%
\processaction[\GGFont]
   [  Oxonia=>\gdef\MyFont{greeoxon },%this switches from the "logical"  
name of the font to the actual tfm
  Ibycus=>\gdef\MyFont{fibr },
Bosporos=>\gdef\MyFont{Bosporos },
 Gentium=>\gdef\MyFont{gentiumgr },
  Kadmos=>\gdef\MyFont{kadmo },
 Leipzig=>\gdef\MyFont{grbl },
 Teubner=>\gdef\MyFont{Teubnerc }]%
}

\protect
%\definefont[Gf][kadmo ] %When given the name of the tfm in clear, this  
works

%\definefont[Gf][\MyFont]%This does not work, and I have no clue why
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4p 
t,16pt,18pt,20pt,22pt][rm][Gf=\MyFont sa \MyScale] %This DOES work, and  
I can't see what's the fundamental difference to the preceding line.

\def\enablegreek{\language[greek]\catcode`~=\other\catcode`|=\other\catc 
ode`'=\other}%this was provided by Giuseppe

\def\startgreek{\par\begingroup\Gf\enablegreek}
\let\stopgreek\endgroup
\def\localgreek{\groupedcommand{\Gf\enablegreek}{}}
\define\sampi{{\Gf \char34}}%and this by Taco
\define\digamma{{\Gf \char35}}
\define\stigma{{\Gf \char36}}
\define\koppa{{\Gf \char37}}
\define\lunars{{\Gf \char1}}
\define\lunarS{{\Gf \char13}}
\define\brcl{{\Gf \char8}}
\define\brcr{{\Gf \char9}}
\define\hbrl{{\Gf \char123}}
\define\hbrr{{\Gf \char125}}
\define\crux{{\Gf \char43}}
On Jan 23, 2005, at 10:24 PM, h h extern wrote:
Thomas A.Schmitz wrote:
I spent some (too much) time today improving my Greek module. For the  
 time being, two questions remain; I'm confident that they're not too  
 difficult for the experts; any help would be appreciated.
what exactly do you want to achieve, if it's only some font following  
the sizes and styyles ...

\definefontsynonym [Funny][cmr10]
\definefontsynonym [FunnyBold][cmbx10]
\definefontsynonym [FunnyItalic]  [cmti10]
% \definefontsynonym [FunnySlanted] [...]
% \definefontsynonym [FunnyBoldItalic]  [...]
% \definefontsynonym [FunnyBoldSlanted] [...]
\def\MyFunnyFont{\symbolicfont{Funny}}
test {\MyFunnyFont test} test
test {\it \MyFunnyFont test} test
test {\bf \MyFunnyFont test} test
-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Has

Re: [NTG-context] finishing a module

2005-01-24 Thread h h extern
Thomas A.Schmitz wrote:
I spent some (too much) time today improving my Greek module. For the  
time being, two questions remain; I'm confident that they're not too  
difficult for the experts; any help would be appreciated.
what exactly do you want to achieve, if it's only some font following the sizes 
and styyles ...

\definefontsynonym [Funny][cmr10]
\definefontsynonym [FunnyBold][cmbx10]
\definefontsynonym [FunnyItalic]  [cmti10]
% \definefontsynonym [FunnySlanted] [...]
% \definefontsynonym [FunnyBoldItalic]  [...]
% \definefontsynonym [FunnyBoldSlanted] [...]
\def\MyFunnyFont{\symbolicfont{Funny}}
test {\MyFunnyFont test} test
test {\it \MyFunnyFont test} test
test {\bf \MyFunnyFont test} test
-
  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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-23 Thread Taco Hoekwater
Thomas A.Schmitz wrote:
the macro \MyFont would always expand to "somefont ". But it doesn't 
seem to do so in
It should (at least until someone calls \xdef\MyFont again).
\definefont[Gf][\MyFont]
I still get the error message. 
The problem is not the \MyFont \def, but in the \definefont, that is why
I thought that \expanded{\definefont[Gf][\MyFont]} should work.
And, AFAICS, it does work fine here.
Greetings, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-23 Thread Thomas A . Schmitz
Taco, I feel bad taking your time, but still no go. For clarity's sake, 
I leave aside the scaling for the time being. I thought that after

unprotect
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]%Font,Scale
\xdef\MyScale{\GGScale}%
\processaction[\GGFont]
   [  SomeFont=>\xdef\MyFont{somefont }]%
}
\protect
the macro \MyFont would always expand to "somefont ". But it doesn't 
seem to do so in

\definefont[Gf][\MyFont]
I still get the error message. When I assign it "manually"
\definefont[Gf][somefont ]
it works. I tried every combination of \expanded, \xdef or \edef, but 
it doesn't seem to work (while it does work in \definebodyfont). So it 
must be something within ConTeXt that doesn't let it expand, and I 
don't see how I could escape this problem. The \definebodyfont is a 
workaround for now, but it has the problem that I have to give precise 
font dimensions, which might fail in certain circumstances.

Thanks again
Thomas
On Jan 23, 2005, at 3:06 PM, Taco Hoekwater wrote:
Thomas A.Schmitz wrote:
This, however, will not work:
\definefont[Gf][\MyFont sa \MyScale]

It looks like \MyFont doesn't get expanded when the \definefont 
command  is read, but this is an area of TeX that I find especially 
opaque...
I see. You need
\expanded{\definefont[Gf][\MyFont sa \MyScale]}
Or you could \xdef the MyScale (instead of \edef), making it global.
Greetings, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-23 Thread Taco Hoekwater
Thomas A.Schmitz wrote:
This, however, will not work:
\definefont[Gf][\MyFont sa \MyScale]

It looks like \MyFont doesn't get expanded when the \definefont command  
is read, but this is an area of TeX that I find especially opaque...
I see. You need
\expanded{\definefont[Gf][\MyFont sa \MyScale]}
Or you could \xdef the MyScale (instead of \edef), making it global.
Greetings, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-23 Thread Thomas A . Schmitz
Taco, thanks so much! I really appreciate the wonderful ConTeXt  
community without whose help I would never have been able to even get  
started.

On Jan 23, 2005, at 10:33 AM, Taco Hoekwater wrote:
This, however, will not work:
\definefont[Gf][\MyFont sa \MyScale]
Both work for me. Unless I misunderstood what it is supposed to do.
\Gf is later used in the macros to define the Greek font. When defined  
with the \definebodyfont alternative, this works; when I try the  
\definefont, I get this error message:

! Undefined control sequence.
 ...else \getvalue {MyFont} sa \MyScale
  \@@@instring
\expanded ...\long \xdef \@@expanded {\noexpand #1
  }\@@expanded
\p!doifinstringelse ...{\pp!doifinstringelse #2#1}
  @@\war
\dodoifinstringelse ...tringelse \@@@instring {#1}
  [EMAIL PROTECTED]  
\firstoftwoarguments ...

\dodefinefont ...2][#3]->\doifinstringelse { }{#2}
   {\ifthirdargument  
\unexpa...

   \par
l.19

?
It looks like \MyFont doesn't get expanded when the \definefont command  
is read, but this is an area of TeX that I find especially opaque...
Rude, but effective:
  \define\koppa {{\Gf \char37}}
Yes, this works and is just what I want. Great!
Greetings, Taco
--
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]
  \edef\MyScale{\GGScale}%
  \processaction[\GGFont]
   [  SomeFont1=>\def\MyFont{cmbx10},
  SomeFont2=>\def\MyFont{cmtt10}]%
}
\setupgreek[Scale=5,Font=SomeFont1]
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4 
pt,16pt,18pt,20pt,22pt][rm][rm=\getvalue{MyFont} sa \MyScale]

\definefont[Gf][\getvalue{MyFont} sa \MyScale]
\starttext
Beo {\switchtobodyfont[20pt]Beolarge} Beo {\Gf Beolarge}
\stoptext
Thanks a lot, Taco!
Best
Thomas
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] finishing a module

2005-01-23 Thread Taco Hoekwater
Thomas A.Schmitz wrote:
I spent some (too much) time today improving my Greek module. For the  
time being, two questions remain; I'm confident that they're not too  
difficult for the experts; any help would be appreciated.
See below for my (adjusted) input file, I hope it helps.
(The space after "somefont" looks ugly, but I haven't figured out how  
to get rid of it; TeX will always complain if I delete it.)
Using \getvalue{MyFont} instead of \MyFont will allow you to remove
the space from the definition, but that may not be what you want,
because it is more cumbersome. If that is the case, just leave the
space there.
1. After this definition, this will work:
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4p 
t,16pt,18pt,20pt,22pt][rm][Gf=\MyFont sa \MyScale]

This, however, will not work:
\definefont[Gf][\MyFont sa \MyScale]
Both work for me. Unless I misunderstood what it is supposed to do.
2. In my module, I define some special symbols:
\define\koppa{\getglyph{\MyFont}{\char37}}
Rude, but effective:
  \define\koppa {{\Gf \char37}}
Greetings, Taco
--
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]
  \edef\MyScale{\GGScale}%
  \processaction[\GGFont]
   [  SomeFont1=>\def\MyFont{cmbx10},
  SomeFont2=>\def\MyFont{cmtt10}]%
}
\setupgreek[Scale=5,Font=SomeFont1]
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4pt,16pt,18pt,20pt,22pt][rm][rm=\getvalue{MyFont} 
sa \MyScale]

\definefont[Gf][\getvalue{MyFont} sa \MyScale]
\starttext
Beo {\switchtobodyfont[20pt]Beolarge} Beo {\Gf Beolarge}
\stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] finishing a module

2005-01-22 Thread Thomas A . Schmitz
I spent some (too much) time today improving my Greek module. For the  
time being, two questions remain; I'm confident that they're not too  
difficult for the experts; any help would be appreciated.

I've succesfully defined my fonts and scale like so:
\def\setupgreek#1[#2]{%
  \getparameters[GG][Scale=,Font=,#2]
\edef\MyScale{\GGScale}%
\processaction[\GGFont]
   [  SomeFont1=>\def\MyFont{somefont },
  SomeFont2=>\def\MyFont{someotherfont }]%
}
\protect
(The space after "somefont" looks ugly, but I haven't figured out how  
to get rid of it; TeX will always complain if I delete it.)

1. After this definition, this will work:
\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4p 
t,16pt,18pt,20pt,22pt][rm][Gf=\MyFont sa \MyScale]

This, however, will not work:
\definefont[Gf][\MyFont sa \MyScale]
and I don't see why. Can anybody explain? I see that the \definefont...  
takes care of the annoying problem with font sizes, so I would prefer  
that way.

2. In my module, I define some special symbols:
\define\koppa{\getglyph{\MyFont}{\char37}}
Is there a way to give the same scaling factor here as in the  
definition of \Gf? I tried
\define\koppa{\getglyph{\MyFont scaled }{\char37}}
as a first attempt which kind of works but gives me the letters "at" in  
the pdf in front of the symbol.

Best
Thomas
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context