# [NTG-context] Euler with fallback

Sanjoy Mahajan sanjoy at olin.edu
Sun Feb 16 17:51:07 CET 2014

Aditya Mahajan <adityam at umich.edu> writes:

> This is to announce that the latest beta supports creating virtual math
> fonts with fallback. The main test case is to use Euler font with missing
> characters taken from Pagella but the mechanism is general and can be used
> to replace a specific set of math glyphs from a font.
>
> This feature is not extensively tested. As such it will be useful if
> everyone interested in math fallback mechanism could test this out and
> report any bugs or inconsistencies.

I would like to test and hopefully use this setup for _Street-Fighting
Science and Engineering_.  It should also give the setup a thorough
workout.  But I can't quite get the preamble right.

The test file below typesets text and math in palatino.

\usetypescriptfile[euler-with-pagella]
\definebodyfontenvironment[10.5pt]
\setupbodyfont[palatino,10.5pt]

\starttext

\input knuth

\placeformula\startformula
a^2 + b^2 = c^2.
\stopformula

\stoptext

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

just before \starttext, the math is typeset in roman pagella.

What am I doing silly?

Also, one of my reservations about using Euler for math, which readers
complained about in _Street-Fighting Mathematics_, is that v and \nu
(kinematic viscosity) look so similar.  Do you know any way to make them
more distinguishable, e.g. by substituting a different character?

-Sanjoy

> To use this feature you have to use pagellaovereuler as your math font.
> For example, to use Euler with DejaVu fonts, use:
>
>
> \usetypescriptfile[euler]
> \starttypescript[mainface]
>  	\definetypeface[mainface][rm][serif][dejavu]          [default]
>  	\definetypeface[mainface][ss][sans] [dejavu]          [default]
>  	\definetypeface[mainface][tt][mono] [dejavu]          [default]
>  	\definetypeface[mainface][mm][math] [pagellaovereuler][default]
> \stoptypescript
>
> \setupbodyfont[mainface]
>
> \appendtoks \rm \to \everymathematics
> \setupmathematics
>         [lcgreek=normal, ucgreek=normal]
>
>
> There is a built-in typescript euler-with-pagella to use
> pagellaovereuler as the math font and pagella as the text font.