From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115092 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Nedeljkovic via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Specifying font size as x-height Date: Sat, 28 May 2022 09:34:26 +0200 Message-ID: References: <6c9ac03f-1c1c-c2f5-d7de-a6f9a4811b47@telus.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6023194400370349907==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18716"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Nedeljkovic , mailing list for ConTeXt users To: Max Chernoff Original-X-From: ntg-context-bounces@ntg.nl Sat May 28 09:35:20 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nuqyk-0004cb-Cm for gctc-ntg-context-518@m.gmane-mx.org; Sat, 28 May 2022 09:35:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C313128A0BE; Sat, 28 May 2022 09:34:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TBAMVg5aG4RW; Sat, 28 May 2022 09:34:42 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1D9DC28A0CD; Sat, 28 May 2022 09:34:42 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 90ECA28A0CD for ; Sat, 28 May 2022 09:34:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1DyAFdPF2Wm7 for ; Sat, 28 May 2022 09:34:38 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.222.174; helo=mail-qk1-f174.google.com; envelope-from=tsar.srb@gmail.com; receiver= Original-Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 2BC91289FF8 for ; Sat, 28 May 2022 09:34:38 +0200 (CEST) Original-Received: by mail-qk1-f174.google.com with SMTP id x65so7430372qke.2 for ; Sat, 28 May 2022 00:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6sQ1GejUVCHWh1KnIcHFg7lFlGkBtKb90THsk7Uos/Q=; b=S0S79HDHnYX9Cd0TePCFp2xXWxPqDrSzZJoS/7oHC5oOOxNx5q1EaDZjixC1ZnSoAH 0GyGQUDiBARqmoPa1dA9SCckmCQKwHv7AHRIPt3XUsZfP7clD7qzkpPFVC7QRYpNdx1I R3v+PEQyFVBHwQ4PoZ1ggmPPXqNnFU2eBBvhw/SGfoSj1taWmClHKKxD9A37wQRZYoiz Jdr6qr4yxbSq3uJe+NnZHTftSPDj5iB+AQDo/4DjtoKMHcruG5qENzyjX1rQ7Pbbrjhu aEi7ueBc6Kj2iqhywyk/XDrxR/u9NNfph6G2jhFwWnXZ9CTvDpQMyBVKF15tpc1oXcq/ oV5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6sQ1GejUVCHWh1KnIcHFg7lFlGkBtKb90THsk7Uos/Q=; b=jTHy0MiRXWq+DxDWYXAtlvdEZN3f6WbzBlov6run2/HhyTS6NV4oeHk0CEXfaEXYwT ua0KNXzmZHzK5FsNqBtMUJPaQ4r8B6kBA4AI0QTA9/uZuoCuJywpd6VheBTCkSVilu8B zMAgH6rSfLtikAhFyBGGyQLQiSovR565YhtMtN05XH5rdI1RwQGbX+VwOZFtZPh+elyE +GQjUskS1YKv3uwI7xZy6m6a6EEX3fZOcS5jzffOScXQ3+LPnuD0vdnibaPuJhSx9G6C CMS38wY/nCT1JM114+rQ6yPPo2om8ZMMQ1Td0Ky+t9V/g7z+e4WP2xqX5INDG38CZHBd HrIA== X-Gm-Message-State: AOAM532XwlGgccKQCsL7iyDnmv4wrT8dUt0XnHBCx2GIMOGYx2X25KQQ 6hlgU3CVZNsrC39dZSp/q0IGRNa8jF4sFlErBmk= X-Google-Smtp-Source: ABdhPJxIsTWOWkoM5SarbynXToReYich7Gqi/2NICnSimtG/QfjCFmU/RM5Q4TeTWv2j8dpTr7KqCdq8JU0irYiGSh8= X-Received: by 2002:a05:620a:4150:b0:6a3:7c8b:9796 with SMTP id k16-20020a05620a415000b006a37c8b9796mr21061307qko.18.1653723276882; Sat, 28 May 2022 00:34:36 -0700 (PDT) In-Reply-To: <6c9ac03f-1c1c-c2f5-d7de-a6f9a4811b47@telus.net> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:115092 Archived-At: --===============6023194400370349907== Content-Type: multipart/alternative; boundary="00000000000079b93c05e00d7410" --00000000000079b93c05e00d7410 Content-Type: text/plain; charset="UTF-8" Awesome, thank you very much Max! On Sat, May 28, 2022 at 8:49 AM Max Chernoff 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 > --00000000000079b93c05e00d7410 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Awesome, thank you very much Max!

On Sat, May 28, 2022 at 8= :49 AM Max Chernoff <mseven@telus.ne= t> wrote:
> How would one specify the font size in LMTX, but via x-height?

You could try this:

=C2=A0 =C2=A0 =C2=A0\starttexdefinition setxheight [#1][#2]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\switchtobodyfont[#1, 12pt]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\switchtobodyfont[#1, \cldcontext{tex.sp&= quot;#2" / tex.sp"1ex" * tex.sp"1em" .. "sp&q= uot;}]
=C2=A0 =C2=A0 =C2=A0\stoptexdefinition

Demo:

=C2=A0 =C2=A0 =C2=A0\starttexdefinition setxheight [#1][#2]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\switchtobodyfont[#1, 12pt]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\switchtobodyfont[#1, \cldcontext{tex.sp&= quot;#2" / tex.sp"1ex" * tex.sp"1em" .. "sp&q= uot;}]
=C2=A0 =C2=A0 =C2=A0\stoptexdefinition

=C2=A0 =C2=A0 =C2=A0\define[1]\sample{%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\setxheight[#1][10pt] Hello%
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0\setuppapersize[letter, landscape]

=C2=A0 =C2=A0 =C2=A0\starttext
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\dontleavehmode\rlap{\vrule width\textwid= th height 10.5pt depth -10pt}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\processcommalist[modern, pagella, termes= , heros, bonum, scholas, adventor, cursor, chorus, dejavu]\sample
=C2=A0 =C2=A0 =C2=A0\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
--00000000000079b93c05e00d7410-- --===============6023194400370349907== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============6023194400370349907==--