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@gmail.com> wrote:
Awesome, thank you very much Max!

On Sat, May 28, 2022 at 8:49 AM Max Chernoff <mseven@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