From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id C81DE23D68 for ; Tue, 21 May 2024 17:18:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id CD4FB4843DA for ; Tue, 21 May 2024 17:17:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=xs4all.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w632UQP11UWg for ; Tue, 21 May 2024 17:17:45 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 4E0AC48452F for ; Tue, 21 May 2024 17:16:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 2F338483F6F for ; Tue, 21 May 2024 17:16:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QWfUMDfD-bBt for ; Tue, 21 May 2024 17:16:02 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=195.121.94.184; helo=ewsoutbound.kpnmail.nl; envelope-from=j.hagen@xs4all.nl; receiver= Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id EB3D1483F6E for ; Tue, 21 May 2024 17:16:02 +0200 (CEST) X-KPN-MessageId: 08ced1f4-1785-11ef-adc0-005056994fde Received: from smtp.kpnmail.nl (unknown [10.31.155.6]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 08ced1f4-1785-11ef-adc0-005056994fde; Tue, 21 May 2024 17:16:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:from:to:subject:mime-version:date:message-id; bh=CE68p/GN3qJb0Yd80hyLGybzolkBvuVr5x/XRdsXpog=; b=fdBQrWZNWmBujL8tzaoCXN4rQ0efu8OgttXkPbEIqkNp+hWJ7loInrL7RVEGpXpCib8LuzBMtVwzK rTkxDFrzFjvIKVla45OYJJBySKtIIC8BBtmw9/fCvMyhT0XYBacVhRAFKgFoEDhIrpowAfPCFRPMGr BUkISHib04a65CzlEyv4k9I/Bwi0LPQ+NH/HNY4H2EbTx4DgwpYp/rlwZZ8pIWmbWATG7C6H03SECy 7ESbewFfxT0XaNbIQKTkislQZhkhhlKAZySIpKg3IMt5dteGHsoug+DJnetjKUyMoRFPfbfkahi3WM YHrtLxBPkvH0i1nm+BnmwLBJCj39+mA== X-KPN-MID: 33|2kVJWv/T6kUv4T+7HqF30ZMhpV2euzAKUMGlpm6xwPVETvjCK/qp+VMvSH/yAsd 0Behy1KkeOwJRsvOK291lggQ07+TNcmfTc99y8+QK1j0= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|gAMbCFCrsHbS704ggT5oVt7SABjwo85hlaYEXFSeAuvXYTuNW2jaAjvyVg2lpNd BX1/Z6O3rNbAEj9OB1/wdcg== X-Originating-IP: 213.125.29.162 Received: from [10.100.1.105] (d57d1da2.static.ziggozakelijk.nl [213.125.29.162]) by smtp.xs4all.nl (Halon) with ESMTPSA id 09360492-1785-11ef-9bde-00505699772e; Tue, 21 May 2024 17:16:02 +0200 (CEST) Message-ID: <2e169e65-6356-41e6-8dc9-bf0b52279f15@xs4all.nl> Date: Tue, 21 May 2024 17:16:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Ali Ali <111414w@gmail.com>, mailing list for ConTeXt users References: <171630244572.1996.3670850218643042704@cgl.ntg.nl> From: Hans Hagen In-Reply-To: <171630244572.1996.3670850218643042704@cgl.ntg.nl> Message-ID-Hash: V6WMH7PWJOKMVUWWJ5WY5R24PMLMOHWG X-Message-ID-Hash: V6WMH7PWJOKMVUWWJ5WY5R24PMLMOHWG X-MailFrom: j.hagen@xs4all.nl X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Playing with math font setup List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 5/21/2024 4:40 PM, Ali Ali wrote: > Hi, hope everyone's doing well! > > Is it possible to setup math font so that all the basic ascii characters (i.e. a..zA..Z0..9) glyphs are substituted with current serif (or sans) font. I tried playing with fallback thing but it didn't got me anywhere! > > e.g. $x$ will use the 'x' glyph from current serif italic font, and $\bf x$ will use the 'x' glyph from current serif bold font! > I would appreciate any suggestions and help! > > Suppose we have all the required font files in the 'font' directory of the working directory, and below is the minimal source code! > """ > \starttypescriptcollection[CustomFontSelection] > \starttypescript [serif] [CustomFontSelection] [name] > \setups[font:fallback:serif] > \definefontsynonym [Serif] > % [file:font/Lora-Regular.ttf] > [file:font/Lora-Medium.ttf] > [features=default,fallbacks=Serif] > \definefontsynonym [SerifBold] > [file:font/Lora-Bold.ttf] > [features=default,fallbacks=SerifBold] > \definefontsynonym [SerifItalic] > % [file:font/Lora-Italic.ttf] > [file:font/Lora-MediumItalic.ttf] > [features=default,fallbacks=SerifItalic] > \definefontsynonym [SerifBoldItalic] > [file:font/Lora-BoldItalic.ttf] > [features=default,fallbacks=SerifBoldItalic] > \stoptypescript > > \starttypescript [math] [CustomFontSelection] [name] > %%% \definefontfallback [MathRomanFallBack] > %%% [SansItalic] > %%% [extendedlatin] > %%% [force=yes] > \definefontsynonym [MathRoman] > [file:font/STIXTwoMath-Regular.otf] > [features=math,fallbacks=MathRomanFallBack] > \stoptypescript > > \starttypescript[CustomFontSelection] > \definetypeface [CustomFontSelection] [rm] [serif] [CustomFontSelection] [default] [rscale=0.9] > \definetypeface [CustomFontSelection] [ss] [sans] [newcomputermodern-book] [default] > \definetypeface [CustomFontSelection] [tt] [mono] [newcomputermodern-book] [default] > \definetypeface [CustomFontSelection] [mm] [math] [CustomFontSelection] [default] [rscale=0.97] > \stoptypescript > \stoptypescriptcollection > > \setupbodyfont[CustomFontSelection] > > > \starttext > > We use $X$, $Y$, $Z$ and $n$, $m$, etc. $\sin(x) \to \limsup x_n$ whatever. > > \mathematics{% > \delta_{ij} = > \startmathcases > \NC 1 \NC \text{if } i = j \NR > \NC 0 \NC \text{otherwise} \NR > \stopmathcases > } > > We use $\bf X$, $\bf Y$, $\bf Z$ and $\bf n$, $\bf m$, etc. $\bf \sin(x) \gets \limsup x_n$ whatever. > > \stoptext > """ More like this (if you want decent math). Also, use a math font as base that matches the fallbacks, also metric wise. \starttypescriptcollection[CustomFontSelection] \starttypescript [serif] [CustomFontSelection] [name] \setups[font:fallback:serif] \definefontsynonym [Serif] [name:dejavuserif] [features=default] \definefontsynonym [SerifBold] [name:dejavuserifbold] [features=default] \definefontsynonym [SerifItalic] [name:dejavuserifitalic] [features=default] \definefontsynonym [SerifBoldItalic] [name:dejavuserifbolditalic] [features=default] \stoptypescript \starttypescript [math] [CustomFontSelection] [name] \definefontfallback [MathRomanFallBack] [name:dejavuserifitalic] [lowercaseitalic,uppercaseitalic] [force=yes] \definefontfallback [MathRomanFallBack] [name:dejavuserifbolditalic] [lowercasebolditalic,uppercasebolditalic] [force=yes] \definefontfallback [MathRomanFallBack] [name:dejavuserif] [lowercasenormal,uppercasenormal] [force=yes] \definefontfallback [MathRomanFallBack] [name:dejavuserifbold] [lowercasebold,uppercasebold] [force=yes] \definefontsynonym [MathRoman] [file:stixtwomath-regular.ttf] [features={math\mathsizesuffix,stixtwomath,stixtwo:mathextra,mathextra},% fallbacks=MathRomanFallBack,% goodies=stixtwo-math] \definefontsynonym [MathRomanBold] [file:stixtwomath-regular.ttf] [features={math\mathsizesuffix,stixtwo-math-bold,stixtwomath,stixtwo:mathextra,mathextra},% fallbacks=MathRomanFallBack,% goodies=stixtwo-math] \stoptypescript \starttypescript[CustomFontSelection] \definetypeface [CustomFontSelection] [rm] [serif] [CustomFontSelection] [default] [rscale=0.9] \definetypeface [CustomFontSelection] [ss] [sans] [newcomputermodern-book] [default] \definetypeface [CustomFontSelection] [tt] [mono] [newcomputermodern-book] [default] \definetypeface [CustomFontSelection] [mm] [math] [CustomFontSelection] [default] [rscale=0.97] \stoptypescript \stoptypescriptcollection \setupbodyfont[CustomFontSelection] \starttext We use $X$, $Y$, $Z$ and $n$, $m$, etc. $\sin(x) \to \limsup x_n$ whatever. We use $\bf X$, $\bf Y$, $\bf Z$ and $\bf n$, $\bf m$, etc. $\bf \sin(x) \gets \limsup x_n$ whatever. \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________