ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Using legacy math fonts
@ 2017-08-09  5:00 Henri
  2017-08-09  5:01 ` Henri
  2017-08-09 11:44 ` Aditya Mahajan
  0 siblings, 2 replies; 3+ messages in thread
From: Henri @ 2017-08-09  5:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: Using legacy math fonts
  2017-08-09  5:00 Using legacy math fonts Henri
@ 2017-08-09  5:01 ` Henri
  2017-08-09 11:44 ` Aditya Mahajan
  1 sibling, 0 replies; 3+ messages in thread
From: Henri @ 2017-08-09  5:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Furthermore the example only works in TeXlive 2017 but not in beta.  What has changed and how do I
make it work again?

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
___________________________________________________________________________________

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

* Re: Using legacy math fonts
  2017-08-09  5:00 Using legacy math fonts Henri
  2017-08-09  5:01 ` Henri
@ 2017-08-09 11:44 ` Aditya Mahajan
  1 sibling, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2017-08-09 11:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> 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 don't have access to a context installation right now so cannot give a 
more detailed answer.

But typically math fonts provide two stylistic sets of caligraphic 
letters: one similar to the default \mathcal alphabel and the other 
similar to \mathscr alphabet (RSFS fonts etc.) The latter is the default, 
but typically moving to the traditional mathcal styled calligraphic 
letters should be as simple as setting an appropriate font feature.

Aditya
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2017-08-09 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09  5:00 Using legacy math fonts Henri
2017-08-09  5:01 ` Henri
2017-08-09 11:44 ` Aditya Mahajan

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).