ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Fwd: Re:  Using legacy math fonts
Date: Wed, 9 Aug 2017 10:53:00 +0200	[thread overview]
Message-ID: <d811c89b-5a31-624a-607b-1d8bbba8d9fb@wxs.nl> (raw)
In-Reply-To: <001c20e8-64fa-cc13-42de-b87ea0473837@wxs.nl>




-------- Forwarded Message --------
Subject: Re: [NTG-context] Using legacy math fonts
Date: Wed, 9 Aug 2017 10:52:34 +0200
From: Hans Hagen <pragma@wxs.nl>
To: Henri <henrimenke@gmail.com>

On 8/9/2017 7:01 AM, Henri wrote:
> 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
-----------------------------------------------------------------
___________________________________________________________________________________
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-08-09  8:53 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <001c20e8-64fa-cc13-42de-b87ea0473837@wxs.nl>]

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=d811c89b-5a31-624a-607b-1d8bbba8d9fb@wxs.nl \
    --to=pragma@wxs.nl \
    --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).