ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* efficiently scaling fonts
@ 2020-12-24 11:20 Hans Hagen
  2020-12-24 15:00 ` Pablo Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Hagen @ 2020-12-24 11:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I uploaded a new lmtx ... in a previous mail i mentioned font scaling 
and I made that two dimensional:

\starttext

\setuplayout[topspace=1cm,header=1cm] \setuplayout[middle]

\setupbodyfont[pagella,10pt]

\setupalign[verytolerant,stretch]

\setupwhitespace[big]

\starttext

\startbuffer
\definescaledfont[bfe][xscale=2000,yscale=6000,style=bf]

\setuphead[chapter][style=\bfe]

\dostepwiserecurse {10} {2020} {10} {
     \title{Here we go #1!}
     \start
     \glyphxscale#1\relax
     \glyphyscale#1\relax
     \setupinterlinespace
     \samplefile{ward}%
     \start
     \bf
     \samplefile{ward}%
     \glyphxscale\numexpr(#1*2)/3\relax
     \glyphyscale#1\relax
     \samplefile{ward}%
     \par
     \stop
     \def\TEST{y = \sqrt{x^2 + 1}^3}%
     \dontleavehmode
     \ruledhbox{\glyphxscale #1                 \glyphyscale #1 
         $\left{\TEST\right}$}
     \ruledhbox{\glyphxscale #1                 \glyphyscale 
\numexpr#1*3\relax $\left{\TEST\right}$}
     \ruledhbox{\glyphxscale \numexpr#1/2\relax \glyphyscale 
\numexpr#1*2\relax $\left{\TEST\right}$}
     \par
     \stop
     \page
}

\stoptext

Best use the high level interface:

\definescaledfont
   [MyLargerFontB]
   [xscale=1200,yscale=2000,style=bold]

test {\MyLargerFontB test {\em test} test} test

etc. Math works too but I need to check soem details which I will do 
later. There are some conceptual decisions to be made there because 
we're nto so much talking of a font but of a 'setup of fonts and 
measures'. (Boldened math can be improved a bit, in general, unrelated 
to this feature.)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: efficiently scaling fonts
  2020-12-24 11:20 efficiently scaling fonts Hans Hagen
@ 2020-12-24 15:00 ` Pablo Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Rodriguez @ 2020-12-24 15:00 UTC (permalink / raw)
  To: ntg-context

On 12/24/20 12:20 PM, Hans Hagen wrote:
> Hi,
>
> I uploaded a new lmtx ... in a previous mail i mentioned font scaling
> and I made that two dimensional:

Hi Hans,

many thanks for the LMTX new release.

I can only get it working after removing the extra \starttext and adding
\stopbuffer and \getbuffer, such as in:

  \setuplayout[topspace=1cm,header=1cm]
  \setuplayout[middle]
  \setupbodyfont[pagella,10pt]
  \setupalign[verytolerant,stretch]
  \setupwhitespace[big]

  \starttext

  \startbuffer
  \definescaledfont[bfe][xscale=2000,yscale=6000,style=bf]
  \setuphead[chapter][style=\bfe]

  \dostepwiserecurse {10} {2020} {10} {
       \title{Here we go #1!}
       \start
       \glyphxscale#1\relax
       \glyphyscale#1\relax
       \setupinterlinespace
       \samplefile{ward}%
       \start
       \bf
       \samplefile{ward}%
       \glyphxscale\numexpr(#1*2)/3\relax
       \glyphyscale#1\relax
       \samplefile{ward}%
       \par
       \stop
       \def\TEST{y = \sqrt{x^2 + 1}^3}%
       \dontleavehmode
       \ruledhbox{\glyphxscale #1                 \glyphyscale #1
           $\left{\TEST\right}$}
       \ruledhbox{\glyphxscale #1                 \glyphyscale
  \numexpr#1*3\relax $\left{\TEST\right}$}
       \ruledhbox{\glyphxscale \numexpr#1/2\relax \glyphyscale
  \numexpr#1*2\relax $\left{\TEST\right}$}
       \par
       \stop
       \page
  }
  \stopbuffer

  \getbuffer
  \stoptext

Many thanks for your excellent work.

Happy holidays to you and to all list members,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-24 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 11:20 efficiently scaling fonts Hans Hagen
2020-12-24 15:00 ` Pablo Rodriguez

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