Math font tips and tricks
Dear all, I'd like to know how best to work with font features regarding adaptations of math fonts. For example, let's assume I'd like to use Minion Pro also for math typesetting. I've referred myself to this page of the Wiki https://wiki.contextgarden.net/Command/definefontfallback. I have tried the following, but it fails for greek letters in math mode. \definefallbackfamily [mainface] [math] [Minion Pro] [range={math:lowercaseitalic,math:uppercaseitalic,math:lowercasenormal,math:uppercasenormal},force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [range={math:lowercasegreekitalic,math:uppercasegreekitalic,math:lowercasegreeknormal,math:uppercasegreeknormal},force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [range=math:digitsnormal,features=f:lining,force=yes] \definefontfamily [mainface] [math] [Libertinus Math] Thanks in advance for your support.
On 11/6/2021 11:23 AM, Alexandre Christe via ntg-context wrote:
Dear all,
I'd like to know how best to work with font features regarding adaptations of math fonts.
For example, let's assume I'd like to use Minion Pro also for math typesetting. I've referred myself to this page of the Wiki https://wiki.contextgarden.net/Command/definefontfallback https://wiki.contextgarden.net/Command/definefontfallback. I have tried the following, but it fails for greek letters in math mode.
\definefallbackfamily [mainface] [math] [Minion Pro]
[range={math:lowercaseitalic,math:uppercaseitalic,math:lowercasenormal,math:uppercasenormal},force=yes] \definefallbackfamily [mainface] [math] [Minion Pro]
[range={math:lowercasegreekitalic,math:uppercasegreekitalic,math:lowercasegreeknormal,math:uppercasegreeknormal},force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [range=math:digitsnormal,features=f:lining,force=yes] \definefontfamily [mainface] [math] [Libertinus Math]
Thanks in advance for your support. Do you get results at all? Hard to check as that math font is a commercial one. If it's an otf font, I suppose it can be used directly as mainface math.
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen via ntg-context schrieb am 07.11.2021 um 19:05:
On 11/6/2021 11:23 AM, Alexandre Christe via ntg-context wrote:
Dear all,
I'd like to know how best to work with font features regarding adaptations of math fonts.
For example, let's assume I'd like to use Minion Pro also for math typesetting. I've referred myself to this page of the Wiki https://wiki.contextgarden.net/Command/definefontfallback https://wiki.contextgarden.net/Command/definefontfallback. I have tried the following, but it fails for greek letters in math mode.
\definefallbackfamily [mainface] [math] [Minion Pro] [range={math:lowercaseitalic,math:uppercaseitalic,math:lowercasenormal,math:uppercasenormal},force=yes]
\definefallbackfamily [mainface] [math] [Minion Pro] [range={math:lowercasegreekitalic,math:uppercasegreekitalic,math:lowercasegreeknormal,math:uppercasegreeknormal},force=yes]
\definefallbackfamily [mainface] [math] [Minion Pro] [range=math:digitsnormal,features=f:lining,force=yes] \definefontfamily [mainface] [math] [Libertinus Math]
Thanks in advance for your support. Do you get results at all? Hard to check as that math font is a commercial one. If it's an otf font, I suppose it can be used directly as mainface math.
Libertinus is a free Math font and Minion Pro was available with older installations of the Adobe Reader. To use the Minion font for math you have to create a new fallback for each set of characters because you need always a different argument for the offset key. To make everything a bit easier the fallbackfamily command provides preset list which already set he necessary values for range and offset. % \definefallbackfamily [mainface] [math] [Minion Pro] % [range=lowercasenormal] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasenormal] % \definefallbackfamily [mainface] [math] [Minion Pro] % [range=lowercasenormal,offset=lowercaseitalic,tf=style:italic] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercaseitalic] % \definefallbackfamily [mainface] [math] [Minion Pro] % [range=digitsnormal,features=f:lining] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:digitsnormal] \definefontfamily [mainface] [math] [Libertinus Math] \starttext \startformula c^2 = a^2 + b^2 \stopformula \switchtobodyfont[mainface] \startformula c^2 = a^2 + b^2 \stopformula \stoptext Wolfgang
Sometime ago I needed some basic math in Minion and I concocted something like follows below: % latin \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:mathematicalalphanumericsymbols,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:mathematicalalphanumericsymbols,range={1D50D,1D514},force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:miscellaneousmathematicalsymbolsa,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:miscellaneousmathematicalsymbolsb,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasenormal,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasenormal,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercaseitalic,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercaseitalic,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasebold,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasebold,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasebolditalic,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasebolditalic,force=yes] % greek \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasegreeknormal,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasegreeknormal,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasegreekitalic,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasegreekitalic,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasegreekbold,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasegreekbold,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:lowercasegreekbolditalic,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:uppercasegreekbolditalic,force=yes] % digits - need to be defined without node mode, which means no default set \definefontfeature[inlinemath][lnum=yes,pnum=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:digitsnormal,features=inlinemath,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [preset=math:digitsbold,features=inlinemath,force=yes] \definefallbackfamily [mainface] [math] [Minion Pro] [superscriptsandsubscripts] [force=yes] \setupmathematics[autopunctuation={all},ucgreek=italic,lcgreek=italic] \definefallbackfamily [mainface] [math] [Minion Pro] [tf=style:normal,range={0x27-0x2F,0x3C-0x3E,0xB1,0xD7,0xF7,0x3E,0x5B-0x5D,0x7B-0x7E,0x2111,0x1D50D,0x2128,0x2190,0x2192,0x210C-0x211C,0x212D,0x2202,0x2206,0x220F,0x2211,0x2212,0x2215,0x2219,0x221E,0x2248,0x2260,0x2264,0x2265,0x27E6-0x27E9,0x1D504-0x1D52F,0x2980}]% \definefallbackfamily [mainface] [math] [Minion Pro] [bf=style:bold,range={0x27-0x2F,0xD7,0xF7,0x3A-0x3C,0x3E,0x5B-0x5D,0x7B-0x7E,0x2111,0x1D50D,0x2128,0x210C-0x211C,0x212D,0x2212,0x27E6-0x27E9,0x1D504-0x1D52F,0x2980}] \definefontfamily [mainface] [math] [Cambria Math] \setupbodyfont[mainface,12pt] \starttext \startformula c^2 = a^2 + b^2 \stopformula \bgroup\bf \startformula c^2 = a^2 + b^2 \stopformula \egroup \startformula \cos (\gamma) = \Alpha \Gamma \Pi\sin (\alpha) \stopformula \bgroup\bf \startformula \cos (\gamma) = \Alpha \Gamma \Pi\sin (\alpha) \stopformula \egroup \startformula \[x\] - |y| + x^2 + y^2 -k² ≤ z^2; \quad \sin(\alpha)^2 + \cos(\beta)^2 = 1. \stopformula \bgroup\bf \startformula \[x\] - |y| + x^2 + y^2 -k² ≤ z^2; \quad \sin(\alpha)^2 + \cos(\beta)^2 = 1. \stopformula \egroup \startformula C^2 ≈ A^2 ∫ (B^2 ± \Theta \sin \gamma x) dx = \lim Z → ∞ \stopformula \bgroup\bf \startformula C^2 ≈ A^2 ∫ (B^2 ± \Theta \sin \gamma x) dx = \lim Z → ∞ \stopformula \egroup \startformula \sqrt{34×y\frac{21\alpha^2}{98.0 x_2}}Δθ = \sin(a)^2 + \cos(b)^2 \stopformula \bgroup\bf \startformula \sqrt{34×y\frac{21\alpha^2}{98.0 x_2}}Δθ = \sin(a)^2 + \cos(b)^2 \stopformula \egroup \stoptext
participants (4)
-
Alexandre Christe
-
Hans Hagen
-
Marcus Vinicius Mesquita
-
Wolfgang Schuster