ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Ali Ali" <111414w@gmail.com>
To: ntg-context@ntg.nl
Subject: [NTG-context] Playing with math font setup
Date: Tue, 21 May 2024 14:40:45 -0000	[thread overview]
Message-ID: <171630244572.1996.3670850218643042704@cgl.ntg.nl> (raw)

Hi, hope everyone's doing well!

Is it possible to setup math font so that all the basic ascii characters (i.e. a..zA..Z0..9) glyphs are substituted with current serif (or sans) font. I tried playing with fallback thing but it didn't got me anywhere!

e.g. $x$ will use the 'x' glyph from current serif italic font, and $\bf x$ will use the 'x' glyph from current serif bold font!
I would appreciate any suggestions and help!

Suppose we have all the required font files in the 'font' directory of the working directory, and below is the minimal source code! 
"""
\starttypescriptcollection[CustomFontSelection]
  \starttypescript [serif] [CustomFontSelection] [name]
    \setups[font:fallback:serif]
    \definefontsynonym [Serif]
        % [file:font/Lora-Regular.ttf]
        [file:font/Lora-Medium.ttf]
        [features=default,fallbacks=Serif]
    \definefontsynonym [SerifBold]
        [file:font/Lora-Bold.ttf]
        [features=default,fallbacks=SerifBold]
    \definefontsynonym [SerifItalic]
        % [file:font/Lora-Italic.ttf]
        [file:font/Lora-MediumItalic.ttf]
        [features=default,fallbacks=SerifItalic]
    \definefontsynonym [SerifBoldItalic]
        [file:font/Lora-BoldItalic.ttf]
        [features=default,fallbacks=SerifBoldItalic]
  \stoptypescript

  \starttypescript [math] [CustomFontSelection] [name]
    %%% \definefontfallback [MathRomanFallBack]
    %%%     [SansItalic]
    %%%     [extendedlatin]
    %%%     [force=yes] 
    \definefontsynonym [MathRoman]
        [file:font/STIXTwoMath-Regular.otf]
        [features=math,fallbacks=MathRomanFallBack] 
  \stoptypescript

  \starttypescript[CustomFontSelection]
    \definetypeface [CustomFontSelection] [rm] [serif] [CustomFontSelection]    [default] [rscale=0.9]
    \definetypeface [CustomFontSelection] [ss] [sans]  [newcomputermodern-book] [default]
    \definetypeface [CustomFontSelection] [tt] [mono]  [newcomputermodern-book] [default]
    \definetypeface [CustomFontSelection] [mm] [math]  [CustomFontSelection]    [default] [rscale=0.97] 
  \stoptypescript  
\stoptypescriptcollection

\setupbodyfont[CustomFontSelection] 


\starttext

We use $X$, $Y$, $Z$ and $n$, $m$, etc. $\sin(x) \to \limsup x_n$ whatever.

\mathematics{%
  \delta_{ij} =
    \startmathcases
    \NC 1 \NC \text{if } i = j \NR
    \NC 0 \NC \text{otherwise} \NR
    \stopmathcases
}

We use $\bf X$, $\bf Y$, $\bf Z$ and $\bf n$, $\bf m$, etc. $\bf \sin(x) \gets \limsup x_n$ whatever.

\stoptext
"""

Best regards,
Ali
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2024-05-21 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 14:40 Ali Ali [this message]
2024-05-21 15:16 ` [NTG-context] " 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=171630244572.1996.3670850218643042704@cgl.ntg.nl \
    --to=111414w@gmail.com \
    --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).