On Tue, Mar 17, 2009 at 11:27 PM, Hans Hagen <pragma@wxs.nl> wrote:
Alan Stone wrote:
Ahoi,

Following a previous discussion, I've been advised to "try to avoid
\switchtobodyfont and use \definedfont or \definefont instead".

what is better depends on the situation

- for a structured document using \switchtobodyfont is ok

- for special layout elements (headers, title pages, keywords) \definefont might be handier (esp when funny sizes are used)

- when using \definefont it can be handy to use the symbolic names (Serif, SansBold etc) and sizes (sa 1.2) because that makes redefinition easier


(1) What's the difference between \definefont and \definedfont ?

\definefont defines a macro that represents a font, and \definedfont just switches to a font (the forst one is more efficient when you switch often)


(2) In the underneath example...

(2a) how to implement \define(d)font for font switching ?

(2b) how to define \myFontHook ?

Thanks,
Alan

\usemodule[t-lettrine]

\usetypescriptfile[tps_arial]
\usetypescript[arial]

... just look how gyre typefaces are defined

\setupbodyfont[myFont,\myFontSize]

just \setupbodyfont[myFont,12pt]

and an occasional \definefont[BigFont][SerifBold sa 3.5] which gives you  \BigFont
 
Which low level command allows to fill in \definefont[SomeFont][SomeSynonym sa SomeScale] with SomeSynonym=Sans(X)/Serif(X) (X)=Bold/Italic, i.e. regardless of the synonym's name (defined in the typescript)?
 
\setuphead[chapter][style={\switchtobodyfont[myOtherFont,\myOtherFontSize]}]

it depends on what can occur in a title, if there's math and monospaced and whatever being used mixed, then best use a typeface (apart from the one time definition it's quite fast to switch a typeface)
Alan