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