From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115093 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 10:27:31 +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="===============3901824619864597031==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22560"; 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 10:28:29 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 1nuroD-0005cY-02 for gctc-ntg-context-518@m.gmane-mx.org; Sat, 28 May 2022 10:28:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2258F28A0BD; Sat, 28 May 2022 10:27:50 +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 TOdgDf030o8E; Sat, 28 May 2022 10:27:46 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EC47D28A0A1; Sat, 28 May 2022 10:27:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4178A28A0A1 for ; Sat, 28 May 2022 10:27: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 TRjjUv6Y7q4S for ; Sat, 28 May 2022 10:27:43 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.160.170; helo=mail-qt1-f170.google.com; envelope-from=tsar.srb@gmail.com; receiver= Original-Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 30B9328A086 for ; Sat, 28 May 2022 10:27:43 +0200 (CEST) Original-Received: by mail-qt1-f170.google.com with SMTP id x7so7789906qta.6 for ; Sat, 28 May 2022 01:27:43 -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=djYXVL+uuXVzT4tihRHae41sDEOGRnSoUJTcQNBhi2s=; b=NmBod3nThu908ZReSO1lNiqUKZRrVowK4rGyAzcHCWkDDDdlAP04qjHa2xdSKsTxoP zQ5PE/d48VI0UZElv2gGsm1vKSHYGx7tTVqRL/P3MEzHk7AiubaTiYfUgwHzrSn0rFop yJyqUxJSK+bB54K7CqRPlm8Mfl/Uw/p08uVsmFYk+2Gi3gEm5NpWC9woqG8sOzfVK/Md pHy55sqbNlPr5O/rDRAV3dMK2V7HVRyutP1AAqnBs9tDAuzQJ5g2luU9Jsr2K0PFeBZx wVakBwg4goKV9+WYFDcqA1EJaY+R1LruMlHKA/edRTcjdJNWy08R5c0fAivBR6cfYkO6 iD2w== 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=djYXVL+uuXVzT4tihRHae41sDEOGRnSoUJTcQNBhi2s=; b=WD0oOXZpEHUy8wp8ANwnOGl6Z29V/zL0hKu3lJH3THy8gOCoWmS9mrq9+6FnKr23ok 6XHJXSnc3JMWkiqF8p59r6kH4LnNwvjTgq/BQ4VI8MZhLA2KSXgFhNywAQsZFICrr1fj 8f57iokWi8e5sZMNuWmCgcgBTo+bBFCTMau3UDnheGaPWYw/Zo/33iTpsJFhGQSKGKsd 22lP/nfSnkL8ldvxH/3dWgpXK4ngXnMYfTDTaiKan42ccLIpCxINKutNP9B/aXkk6NL4 SNFHrRavSweVkowCMOxOIEtQqPey3dgHEcQY6Wqems1JUpXn90b0a2AlgpURib0CKSDv QJgA== X-Gm-Message-State: AOAM5314hVLC3r64FbIbtitvb24mTMRxpNdzEcHpwVKCahgY1fPvqM7y 36F+9SG6Cj/ABI025DP72gKeXJmne/I6TI9Q390= X-Google-Smtp-Source: ABdhPJy6ffku2DGSCaWV8YvMWS3JBPQ44sTS00xUaeRQ8Nj5Yn0NY/MRkkfNLe4AcEQGTiVadaOfQEk7f2JkXR4BLSw= X-Received: by 2002:a05:622a:8c:b0:2fb:4df4:3421 with SMTP id o12-20020a05622a008c00b002fb4df43421mr13336400qtw.144.1653726461879; Sat, 28 May 2022 01:27:41 -0700 (PDT) In-Reply-To: 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:115093 Archived-At: --===============3901824619864597031== Content-Type: multipart/alternative; boundary="00000000000050ea8605e00e328c" --00000000000050ea8605e00e328c Content-Type: text/plain; charset="UTF-8" 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 wrote: > 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 >> > --00000000000050ea8605e00e328c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
One slight problem is when I use=C2=A02\measured{xheight} as the font size I get an error. \meas= ure works fine though.

On Sat, May 28, 2022 at 9:34 AM Stefan Nedelj= kovic <tsar.srb@gmail.com> = wrote:
Awesome, thank you very much Max!

On Sat, May 28, 2022 at 8:49 AM M= ax Chernoff <mseve= n@telus.net> wrote:
> How would one specify the font size in LMTX, but via x-heig= ht?

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
--00000000000050ea8605e00e328c-- --===============3901824619864597031== 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== --===============3901824619864597031==--