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

Stefan Nedeljkovic tsar.srb at gmail.com
Sat May 28 10:27:31 CEST 2022


One slight problem is when I use 2\measured{xheight} as the font size I get
an error. \measure works fine though.

On Sat, May 28, 2022 at 9:34 AM Stefan Nedeljkovic <tsar.srb at gmail.com>
wrote:

> 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/d433bb61/attachment.htm>


More information about the ntg-context mailing list