[NTG-context] Simple font size changes command

josephcanedo at gmail.com josephcanedo at gmail.com
Sun Jun 12 18:57:26 CEST 2016

Thanks Alan for the suggestion, I’ll try it. Doing more research I figured out that \definefont defined such simple command at the expense of eventually repeating the font name and features. 

\definefont[SmallFont][name:EBGaramond*base,xxicentury at \SmallFontSize]  % \SmallFont works

I was also a bit surprised with \tf<size> behaviour when used inside a scope of another one leading to 2 different sizes in output, as in

{\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.

For the sake of knowledge I would be interested in knowing if this is expected eventually. 

Thanks a lot



From: Alan BRASLAU
Sent: ‎Sunday‎, ‎June‎ ‎12‎, ‎2016 ‎5‎:‎19‎ ‎PM
To: josephcanedo at gmail.com
Cc: ntg-context at ntg.nl

On Thu, 9 Jun 2016 21:47:07 +0000
<josephcanedo at gmail.com> wrote:

> Dear all,
> In a simple document using only 1 font but with different sizes what
> are the easiest switch commands to change font size locally ? I am
> aware of \tfa, \tfx etc …. but they do not seem to size in absolute
> size but rather relatively to current font size. In the following
> MWE :
> \starttext
> {\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.
> \stoptext
> Bar1 is typeset much larger than Bar2.
> I’d look to write something like but don’t know who to get \BigSize
> and \SmallSize defined (and have Bar1 and Bar2 of same size) :
> {\BigSize Foo {\SmallSize Bar1}} {\SmallSize Bar2} Baz. 
> Many thanks for any hint.

Perhaps (untested):

\definealternativestyle [BigFont] [{\setbodyfont [12pt]}]
\definealternativestyle [SmallFont] [{\setbodyfont [8pt]}]
\definehighlight [BigSize] [style=BigFont]
\definehighlight [SmallSize] [style=SmallFont]

\BigSize{Foo \SmallSize{Bar1}} \SmallSize{Bar2} Baz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160612/ba1c6603/attachment.html>

More information about the ntg-context mailing list