From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: how to convert font size to pt number ?
Date: Sat, 12 Jul 2008 18:35:33 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.1.00.0807121823520.27284@nqv-yncgbc> (raw)
In-Reply-To: <326847810807121406p6b21aad4re0869b2543186567@mail.gmail.com>
On Sat, 12 Jul 2008, Alan Stone wrote:
> Thanks for your quick response Aditya.
>
> I've read that too and unfortunately don't find anything on that page that
> answers my question.
>
> Hmmm...
>
> Either the question was not clear enough or I've been smoking the carpet...
> :O)
I wanted to say that by default, \tfa = 1.2 times \tf size, tfb is 1.44
times \tf size, tfc = 1.728 times \tf size, tfd = 2.074 times \tf size,
and tfe = 2.488 times \tf size. So you can always use
(in a 10 point document)
\definefont[chapterfont][Sans sa 1.728]
\setuphead[chapter][style=chapterfont]
> Let's try to formulate it otherwise...
>
> With somefont defined through \definetypeface[somefont][...]
>
> style={\switchtobodyfont[somefont,huge]} gives a compile error,
> only, for example, style={\switchtobodyfont[somefont,14pt]} works
>
> like in \setuphead[chapter][style={\switchtobodyfont[somefont,14pt]}]
>
> I don't want to manually input some pt size but, for example, the \tfc or
> huge corresponding pt size.
>
>
>
> Therefore I'm looking for
>
> - the ConTeXtMagicCommand to convert
> \ConTexTMagicCommand[\tfc or huge] to "\tfc or huge size expressed in pt"
>
> or
>
> - some other ConTeXtSuperMagic trick to display the chapter heading in
> somefont and \tfc or huge size
The default values of \tfa etc can be changed by \definefont. If these
values have not been changed, then you can use:
\definefont[chapterfont][Sans sa \magfactor3]
\setuphead[chapter][style=chapterfont]
\magfactor is defined in font-ini.tex as
\def\magfactor#1%
{\ifcase#1 1.000\or1.200\or1.440\or1.728\or2.074\or2.488\or1\fi}
so \magfactor 3 is equal to \tfc in size. You can also use a more plain
TeX like syntax as
\definefont[chapterfont][Sans scaled \magstep3]
where \magstep is defined in font-ini.tex as
\def\magstep#1%
{\ifcase#1 \@m\or1200\or1440\or1728\or2074\or2488\or\@m\fi}
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2008-07-12 22:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-12 19:48 Alan Stone
2008-07-12 20:05 ` Aditya Mahajan
2008-07-12 21:06 ` Alan Stone
2008-07-12 21:20 ` Henning Hraban Ramm
2008-07-12 22:05 ` Wolfgang Schuster
2008-07-12 22:35 ` Aditya Mahajan [this message]
2008-07-13 3:52 ` Aditya Mahajan
2008-07-13 7:56 ` Alan Stone
2008-07-13 11:16 ` Alan Stone
2008-07-13 12:00 ` Wolfgang Schuster
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=alpine.DEB.1.00.0807121823520.27284@nqv-yncgbc \
--to=adityam@umich.edu \
--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).