Fwd: Re: Using legacy math fonts
-------- Forwarded Message --------
Subject: Re: [NTG-context] Using legacy math fonts
Date: Wed, 9 Aug 2017 10:52:34 +0200
From: Hans Hagen
Furthermore the example only works in TeXlive 2017 but not in beta. What has changed and how do I make it work again?
I'm surprised that it worked because we do math deep down in a different way than you (probably) assume. Anyway, your definitions are not ok as they refer to the wrong family. Also, you need to refer to the lm fonts as these are the cm replacements. % Load CM calligraphic \font\tensy =lmsy10 at \mathstyleface\textstyle \font\sevensy=lmsy7 at \mathstyleface\scriptstyle \font\fivesy =lmsy5 at \mathstyleface\scriptscriptstyle % Allocate family \newfam\cmcalfam % Assign font families \textfont \cmcalfam=\tensy \scriptfont \cmcalfam=\sevensy \scriptscriptfont\cmcalfam=\fivesy \newtoks\cmcalmathcodes \cmcalmathcodes{% \Umathcode`A=\zerocount\cmcalfam`A% \Umathcode`B=\zerocount\cmcalfam`B% \Umathcode`C=\zerocount\cmcalfam`C% \Umathcode`D=\zerocount\cmcalfam`D% \Umathcode`E=\zerocount\cmcalfam`E% \Umathcode`F=\zerocount\cmcalfam`F% \Umathcode`G=\zerocount\cmcalfam`G% \Umathcode`H=\zerocount\cmcalfam`H% \Umathcode`I=\zerocount\cmcalfam`I% \Umathcode`J=\zerocount\cmcalfam`J% \Umathcode`K=\zerocount\cmcalfam`K% \Umathcode`L=\zerocount\cmcalfam`L% \Umathcode`M=\zerocount\cmcalfam`M% \Umathcode`N=\zerocount\cmcalfam`N% \Umathcode`O=\zerocount\cmcalfam`O% \Umathcode`P=\zerocount\cmcalfam`P% \Umathcode`Q=\zerocount\cmcalfam`Q% \Umathcode`R=\zerocount\cmcalfam`R% \Umathcode`S=\zerocount\cmcalfam`S% \Umathcode`T=\zerocount\cmcalfam`T% \Umathcode`U=\zerocount\cmcalfam`U% \Umathcode`V=\zerocount\cmcalfam`V% \Umathcode`W=\zerocount\cmcalfam`W% \Umathcode`X=\zerocount\cmcalfam`X% \Umathcode`Y=\zerocount\cmcalfam`Y% \Umathcode`Z=\zerocount\cmcalfam`Z% } % Make a macro wrapper \showglyphs \unexpanded\def\cmcal#1{{\fam\cmcalfam\the\cmcalmathcodes#1}} \starttext [$\mathcal{TUVA}$] [$\cmcal {TUVA}$] \stoptext These old fonts with glyph widths that cheat assume an old math engine (with respect to kerning and italics which are fundamentally different in opentype math) so there you need to compensate yourself. It's proabbly easier to use the math font fallback mechanism and map that range to some other math font. Hans
On Wed, 2017-08-09 at 17:00 +1200, Henri wrote:
Dear list,
Because I don't like that Euler calligraphic script provided by Latin Modern Math, I want to revert to Computer Modern for the uppercase calligraphic letters. I got so far, that the command will produce the correct glyphs, however, the kerning is borken. What did I miss?
Cheers, Henri
---
% Allocate tokens for legacy math codes \newtoks\legacymathcodes\legacymathcodes={ \Umathcode`A="7"1"41 \Umathcode`B="7"1"42 \Umathcode`C="7"1"43 \Umathcode`D="7"1"44 \Umathcode`E="7"1"45 \Umathcode`F="7"1"46 \Umathcode`G="7"1"47 \Umathcode`H="7"1"48 \Umathcode`I="7"1"49 \Umathcode`J="7"1"4A \Umathcode`K="7"1"4B \Umathcode`L="7"1"4C \Umathcode`M="7"1"4D \Umathcode`N="7"1"4E \Umathcode`O="7"1"4F \Umathcode`P="7"1"50 \Umathcode`Q="7"1"51 \Umathcode`R="7"1"52 \Umathcode`S="7"1"53 \Umathcode`T="7"1"54 \Umathcode`U="7"1"55 \Umathcode`V="7"1"56 \Umathcode`W="7"1"57 \Umathcode`X="7"1"58 \Umathcode`Y="7"1"59 \Umathcode`Z="7"1"5A }
% Load CM calligraphic \font\tensy =cmsy10 at \mathstyleface\textstyle \font\sevensy=cmsy7 at \mathstyleface\scriptstyle \font\fivesy =cmsy5 at \mathstyleface\scriptscriptstyle
% Allocate family \newfam\cmcalfam
% Assign font families \textfont \cmcalfam=\tensy \scriptfont \cmcalfam=\sevensy \scriptscriptfont\cmcalfam=\fivesy
% Make a macro wrapper \unexpanded\def\cmcal#1{{\fam\cmcalfam\the\legacymathcodes#1}}
\starttext
$\mathcal{TUV}$
$\cmcal{TUV}$
\stoptext
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (1)
-
Hans Hagen