ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Max Chernoff <mseven@telus.net>
Subject: Re: Specifying font size as x-height
Date: Sat, 28 May 2022 00:49:34 -0600	[thread overview]
Message-ID: <6c9ac03f-1c1c-c2f5-d7de-a6f9a4811b47@telus.net> (raw)
In-Reply-To: <CAGraPNdNm_CpbLVEdYuc3T+WA=1S6SF+OOBXKbWiLE0E_MqEPA@mail.gmail.com>

> 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
___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2022-05-28  6:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 19:18 Stefan Nedeljkovic via ntg-context
2022-05-28  6:49 ` Max Chernoff via ntg-context [this message]
2022-05-28  7:34   ` Stefan Nedeljkovic via ntg-context
2022-05-28  8:27     ` Stefan Nedeljkovic via ntg-context
2022-05-28  8:40       ` Max Chernoff via ntg-context
2022-05-28  9:40         ` Stefan Nedeljkovic via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c9ac03f-1c1c-c2f5-d7de-a6f9a4811b47@telus.net \
    --to=ntg-context@ntg.nl \
    --cc=mseven@telus.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).