ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mathias Schickel <msch@fa.uni-tuebingen.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Font Fallbacks
Date: Mon, 3 Apr 2017 15:04:25 +0200	[thread overview]
Message-ID: <77C1597B-3918-4A5C-8038-17DA20CEB2ED@fa.uni-tuebingen.de> (raw)
In-Reply-To: <CAFMOkGXxQaQDGmHVF6Yxp47gJ8Ef+HsR3XnHJ9GWTUrdkK-Caw@mail.gmail.com>


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

Dear ConTeXt users,

I have a question concerning font fallbacks in math fonts. I have not been able to find an option to specify optical sizes in fallbacks. I want to use Minion Math for the alphabetical symbols, and this font ships with single font files for each optical size. So I am searching for the right command to get for example the following behaviour:

Use the CambriaMath fonts for mathematical symbols and use Minion Math (Minion-Math-Regular.otf for standard size, Minion-Math-Caption.otf for indices and Minion-Math-Tiny for sub-indices) for alphabetical symbols.

Can anyone tell me which commands I have to use to achieve this?

So the general question is paraphrased as follows: Use some font as a general math font (here CambriaMath) and replace some symbols out of another fonts that ships with single files for each optical size.

One remark about that: Minion Math has supporting mkiv-files. So you can use this font (specifying all optical sizes) by writing \setupbodyfont[minion]. One could make use of that and maybe use a command like

\definefamilyfallback[MathFallback][family:minion][<range of symbols to be replaced>][force=yes].

As far as I know a command like that does not exist at present. Maybe it could be designed to take use of existing font definition files.

And I have some similar problem: I do not like the mathematical symbols of the STIX2 fonts that much (since they are mainly taken from STIX1) and let us suppose now that I want to use again CambriaMath instead for mathematical symbols. I was able to figure out the following commands that nearly achieve what I want to get:

\definefontfallback[MathFallback][file:STIX2Math.otf][lowercasescript,uppercasescript,lowercasefraktur,uppercasefraktur][force=yes]
%
\starttypescriptcollection[stix2own]
	%
	\starttypescript [\s!math][stix2own][\s!all]
        \loadfontgoodies[cambria-math]
        \definefontsynonym[\s!MathRoman] [Cambria-Math]	[\s!features={\s!math\mathsizesuffix},\s!designsize=\s!auto,\s!fallbacks={MathFallback},\s!goodies=cambria-math]
   	 \stoptypescript
	%
	\starttypescript [stix2own]
        	\definetypeface [\typescriptone] [\s!mm] [\s!math]  [stix2own] [\s!default]
	\stoptypescript
	%
\stoptypescriptcollection

This font can be used by the command \setupbodyfont[stix2own].

The only problem is that STIX2 has design sizes embedded in the file STIX2Math.otf that are used if I am using this file as whole for math, but that are not used any longer using the mechanism defined above. That means: If I use Cambria as Math font and replace the alphabetical symbols out of STIX2Math.otf the optical sizes for indices are not used any longer.

What can be done to solve this second problem?

One last question remains: I dislike the summation symbol of CambriaMath (because it is too large in my eyes) and this is why I want to replace it by the version of STIX2Math again (this symbols is indeed redesigned in STIX2Math and looks very nice in my eyes). So I could add a second font fallback that should be applied besides the one above. The unicode slot of the summation symbol is 0x2211in STIX2Math. So I could define

\definefontfallback[SummationFallback][file:STIX2Math.otf][0x2211][force=yes]

and pass it as a second fallback as follows (changing the following line in the example above):

\definefontsynonym[\s!MathRoman] [Cambria-Math]	[\s!features={\s!math\mathsizesuffix},\s!designsize=\s!auto,\s!fallbacks={MathFallback,SummationFallback},\s!goodies=cambria-math]

The problem is that only one of those fallbacks is used if I pass two arguments for fallbacks. Of course this problem can be solved easily if I add the summation symbol to the list of replaced symbols in the first fallback definition. But if I want to use a summation symbol out of another font this trick does not work any longer.

Besides there is a second problem in replacing the summation symbol in the way described: Every time I am using $\sum$, ConTeXt uses the bigger symbol designed for displayed formulas and not the one designed for inline formulas. How can I solve this problem?

Thank you very much for your assistance! If running minimal examples are required I can of course provide them. But I hope someone understands the fallback mechanism better than I do and then the minimal examples written by me would be obsolete (besides the require some font definition files which makes them more of less a little complex). Besides because of Minion Math is commercial not everyone owns this font an thus is unable to run the minimal example.

Kind regards
Mathias


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

[-- Attachment #2: Type: text/plain, Size: 492 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
___________________________________________________________________________________

  reply	other threads:[~2017-04-03 13:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02 15:23 Hieroglyphic font query Alan Bowen
2017-04-02 15:32 ` kaddour kardio
2017-04-02 15:39   ` Alan Bowen
2017-04-02 16:45 ` Pablo Rodriguez
2017-04-02 18:19   ` Alan Bowen
2017-04-02 18:35     ` Wolfgang Schuster
2017-04-02 19:51       ` Alan Bowen
2017-04-03 13:04         ` Mathias Schickel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-30 13:51 font fallbacks Henning Hraban Ramm via ntg-context
2022-08-01 17:42 ` Henning Hraban Ramm via ntg-context
2022-08-01 18:43   ` Denis Maier via ntg-context
2022-08-01 19:00     ` Henning Hraban Ramm via ntg-context
2008-08-29 11:16 Font fallbacks Wolfgang Schuster
2008-08-29 15:44 ` Hans Hagen

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=77C1597B-3918-4A5C-8038-17DA20CEB2ED@fa.uni-tuebingen.de \
    --to=msch@fa.uni-tuebingen.de \
    --cc=ntg-context@ntg.nl \
    /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).