From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/3365 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: setting size of page headers Date: Sun, 19 Nov 2000 16:28:48 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20001119162848.0177d600@pop.wxs.nl> References: <20001117200038.6850B2317E@client44-3.kabela.oprit.rug.nl> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035394101 16400 80.91.224.250 (23 Oct 2002 17:28:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:28:21 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: siepo@cybercomm.nl In-Reply-To: <20001117200038.6850B2317E@client44-3.kabela.oprit.rug.nl> Xref: main.gmane.org gmane.comp.tex.context:3365 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:3365 At 08:57 PM 11/17/00 +0100, siepo@client44-3.kabelA.oprit.rug.nl wrote: >I need a parameterized way to set the font size of page headers, with an >explicit fontsize as parameter. The following works: > >\getparameters[demo][numsize=8pt] >\xdef\foliofnt{\switchtobodyfont [\demonumsize]} >\setupheader[style=\foliofnt] > >However, this causes a noticable performance hit compared to e.g. > >\setupheader[style=small] > >Is there a way around this? I assume that you want to do this in order to speed up processing. \switchtobodyfont is slow due the fact that quite some related font info has to be switched [esp math]. In the case of headers and footers and alike, there is a switch for each header part, so the more you have defined, the slower the process. This is why you can set the style for all layout areas at once, \setuplayout[style={\switchtobodyfont[10pt}] This is significant faster. BTW, your \xdef is okay in etex, but normally edef/xdef can be tricky in combination with commands that themselves do \edef's and alike. In non etex you can prefix the switch with \noexpand. Also, in this case i suppose that a \gdef would work as well. This leaves the difference between style=small and style={\switchtobodyfont[small]}. A small style is just \tfx, so a small size of the current text font, and since there are no other swithches involved it is much faster then a complete bodyfont switch. If you know that there is no math, and you know the font, you can do [fast] things like: \definefont[foliofont][Regular at \numsize] \setupheader[style=foliofont] if you know what goes left/right you can save a bit by leftstyle=foliofont Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------