[NTG-context] Specifying font size as x-height

Stefan Nedeljkovic tsar.srb at gmail.com
Sat May 28 09:34:26 CEST 2022


Awesome, thank you very much Max!

On Sat, May 28, 2022 at 8:49 AM Max Chernoff <mseven at telus.net> wrote:

> > How would one specify the font size in LMTX, but via x-height?
>
> You could try this:
>
>      \starttexdefinition setxheight [#1][#2]
>          \switchtobodyfont[#1, 12pt]
>          \switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp"1ex" *
> tex.sp"1em" .. "sp"}]
>      \stoptexdefinition
>
> Demo:
>
>      \starttexdefinition setxheight [#1][#2]
>          \switchtobodyfont[#1, 12pt]
>          \switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp"1ex" *
> tex.sp"1em" .. "sp"}]
>      \stoptexdefinition
>
>      \define[1]\sample{%
>          \setxheight[#1][10pt] Hello%
>      }
>
>      \setuppapersize[letter, landscape]
>
>      \starttext
>          \dontleavehmode\rlap{\vrule width\textwidth height 10.5pt depth
> -10pt}%
>          \processcommalist[modern, pagella, termes, heros, bonum, scholas,
> adventor, cursor, chorus, dejavu]\sample
>      \stoptext
>
> This is kind of a hacky solution though. It works reasonably well,
> although there's likely a better (perhaps builtin?) way to do this.
>
> -- Max
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220528/f0f0d2b2/attachment-0001.htm>


More information about the ntg-context mailing list