ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: setting size of page headers
Date: Sun, 19 Nov 2000 16:28:48 +0100	[thread overview]
Message-ID: <3.0.6.32.20001119162848.0177d600@pop.wxs.nl> (raw)
In-Reply-To: <20001117200038.6850B2317E@client44-3.kabela.oprit.rug.nl>

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


  reply	other threads:[~2000-11-19 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-17 19:57 siepo
2000-11-19 15:28 ` Hans Hagen [this message]
2000-11-20 22:52   ` siepo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.6.32.20001119162848.0177d600@pop.wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).