ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Subject: Re: Math font tips and tricks
Date: Sun, 7 Nov 2021 19:34:17 +0100	[thread overview]
Message-ID: <8b623471-3151-d8bd-7012-5c7fcfedbf27@gmail.com> (raw)
In-Reply-To: <65afe953-80a2-4db4-c773-fa7d6d8ac1b8@xs4all.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

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

  reply	other threads:[~2021-11-07 18:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-06 10:23 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 [this message]
2021-11-11 11:57 ` Marcus Vinicius Mesquita via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b623471-3151-d8bd-7012-5c7fcfedbf27@gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).