ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math font tips and tricks
@ 2021-11-06 10:23 Alexandre Christe via ntg-context
  2021-11-07 18:05 ` Hans Hagen via ntg-context
  2021-11-11 11:57 ` Marcus Vinicius Mesquita via ntg-context
  0 siblings, 2 replies; 4+ messages in thread
From: Alexandre Christe via ntg-context @ 2021-11-06 10:23 UTC (permalink / raw)
  To: ntg-context; +Cc: Alexandre Christe


[-- Attachment #1.1: Type: text/plain, Size: 921 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 1189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Math font tips and tricks
  2021-11-06 10:23 Math font tips and tricks Alexandre Christe via ntg-context
@ 2021-11-07 18:05 ` Hans Hagen via ntg-context
  2021-11-07 18:34   ` Wolfgang Schuster via ntg-context
  2021-11-11 11:57 ` Marcus Vinicius Mesquita via ntg-context
  1 sibling, 1 reply; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2021-11-07 18:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Math font tips and tricks
  2021-11-07 18:05 ` Hans Hagen via ntg-context
@ 2021-11-07 18:34   ` Wolfgang Schuster via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-11-07 18:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Wolfgang Schuster

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Math font tips and tricks
  2021-11-06 10:23 Math font tips and tricks Alexandre Christe via ntg-context
  2021-11-07 18:05 ` Hans Hagen via ntg-context
@ 2021-11-11 11:57 ` Marcus Vinicius Mesquita via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Marcus Vinicius Mesquita via ntg-context @ 2021-11-11 11:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marcus Vinicius Mesquita


[-- Attachment #1.1: Type: text/plain, Size: 4311 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 4504 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-11 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 10:23 Math font tips and tricks Alexandre Christe via ntg-context
2021-11-07 18:05 ` Hans Hagen via ntg-context
2021-11-07 18:34   ` Wolfgang Schuster via ntg-context
2021-11-11 11:57 ` Marcus Vinicius Mesquita via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).