ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Alex <aleks.ctx.tex@gmail.com>
To: Hans Hagen via ntg-context <ntg-context@ntg.nl>
Subject: [NTG-context] Typescript and Math fallback
Date: Fri, 4 Oct 2024 07:42:57 +0200	[thread overview]
Message-ID: <425ff7d9-28a1-4d35-ad3a-6ec315e3b991@Spark> (raw)
In-Reply-To: <f9b8d8e6-6f48-4f27-8333-6b2f726b12f4@Spark>


[-- Attachment #1.1: Type: text/plain, Size: 7380 bytes --]

Dear list,

I’m having some issues with my custom type-imp file.

I saw in a previous exchange (https://www.mail-archive.com/ntg-context@ntg.nl/msg107516.html) that Hans suggested a way to define a fallback font for math. Based on this, I’ve adapted my custom type-imp:

\starttypescriptcollection [alegreya_libertinus]

\usetypescriptfile[libertinus]
\loadfontgoodies[libertinus-with-alegreya-math]

\definefontfeature[alefeatures][
 mode=node,
 liga=yes,
 kern=yes,
 tlig=yes,
 ccmp=yes,
 language=dflt,
 protrusion=quality,
 expansion=quality
]

\starttypescript [sans] [alegreya,alegreya-light,alegreya-medium] [name]
 \definefontsynonym [Sans] [name:alegreyasansregular] [features=alefeatures]
 \definefontsynonym [SansItalic] [name:alegreyasansitalic] [features=alefeatures]
 \definefontsynonym [SansSlanted] [name:alegreyasansitalic] [features=alefeatures]
 \definefontsynonym [SansBold] [name:alegreyasansbold] [features=alefeatures]
 \definefontsynonym [SansBoldItalic] [name:alegreyasansbolditalic] [features=alefeatures]
 \definefontsynonym [SansBoldSlanted] [name:alegreyasansbolditalic] [features=alefeatures]
 %\definefontsynonym [SansCaps] [AlegreyaSans-Caps] [features=alefeatures]
 \definefontsynonym [SansThin] [name:alegreyasansthin] [features=alefeatures]
 \definefontsynonym [SansThinItalic] [name:alegreyasansthinitalic] [features=alefeatures]
 \definefontsynonym [SansThinSlanted] [name:alegreyasansthinitalic] [features=alefeatures]
 %\definefontsynonym [SansThinCaps] [AlegreyaSans-ThinCaps] [features=alefeatures]
 \definefontsynonym [SansLight] [name:alegreyasanslight] [features=alefeatures]
 \definefontsynonym [SansLightItalic] [name:alegreyasanslightitalic] [features=alefeatures]
 \definefontsynonym [SansLightSlanted] [name:alegreyasanslightitalic] [features=alefeatures]
 %\definefontsynonym [SansLightCaps] [AlegreyaSans-LightCaps] [features=alefeatures]
 \definefontsynonym [SansMedium] [name:alegreyasansmedium] [features=alefeatures]
 \definefontsynonym [SansMediumItalic] [name:alegreyasansmediumitalic] [features=alefeatures]
 \definefontsynonym [SansMediumSlanted][name:alegreyasansmediumitalic] [features=alefeatures]
\stoptypescript

\starttypescript [sans] [alegreya-light] [name]
 \definefontsynonym [Sans] [AlegreyaSans-Light] [features=alefeatures]
 \definefontsynonym [SansItalic] [AlegreyaSans-LightItalic] [features=alefeatures]
 \definefontsynonym [SansSlanted] [AlegreyaSans-LightItalic] [features=alefeatures]
 %\definefontsynonym [SansCaps] [AlegreyaSans-LightCaps] [features=alefeatures]
 \definefontsynonym [SansBold] [AlegreyaSans-Medium] [features=alefeatures]
 \definefontsynonym [SansBoldItalic] [AlegreyaSans-MediumItalic] [features=alefeatures]
 \definefontsynonym [SansBoldSlanted][AlegreyaSans-MediumItalic] [features=alefeatures]
\stoptypescript

\starttypescript [sans] [alegreya-medium] [name]
 \definefontsynonym [Sans] [AlegreyaSans-Medium] [features=alefeatures]
 \definefontsynonym [SansItalic] [AlegreyaSans-MediumItalic] [features=alefeatures]
 \definefontsynonym [SansSlanted] [AlegreyaSans-MediumItalic] [features=alefeatures]
 %\definefontsynonym [SansCaps] [AlegreyaSans-MediumCaps] [features=alefeatures]
 \definefontsynonym [SansBold] [AlegreyaSans-ExtraBold] [features=alefeatures]
 \definefontsynonym [SansBoldItalic] [AlegreyaSans-ExtraBoldItalic] [features=alefeatures]
 \definefontsynonym [SansBoldSlanted][AlegreyaSans-ExtraBoldItalic] [features=alefeatures]
\stoptypescript

\starttypescript [serif] [alegreya] [name]
 \setups[font:fallback:serif]
 \definefontsynonym [Serif] [name:alegreyaregular] [features=alefeatures]
 \definefontsynonym [SerifItalic] [name:alegreyaitalic] [features=alefeatures]
 \definefontsynonym [SerifSlanted] [name:alegreyaitalic] [features=alefeatures]
 \definefontsynonym [SerifBold] [name:alegreyabold] [features=alefeatures]
 \definefontsynonym [SerifBoldItalic] [name:alegreyabolditalic] [features=alefeatures]
 \definefontsynonym [SerifBoldSlanted][name:alegreyabolditalic] [features=alefeatures]
 %\definefontsynonym [SerifCaps] [AlegreyaSerif-Caps] [features=alefeatures]
\stoptypescript

\starttypescript [math] [alegreya] [name]
 \loadfontgoodies[libertinus-with-alegreya-math]
 \definefontfallback [MathRomanFallBack]
 [name:alegreyaitalic]
 [lowercaseitalic,uppercaseitalic]
 [force=yes]
 \definefontfallback [MathRomanFallBack]
 [name:alegreyabolditalic]
 [lowercasebolditalic,uppercasebolditalic]
 [force=yes]
 \definefontfallback [MathRomanFallBack]
 [name:alegreyaregular]
 [lowercasenormal,uppercasenormal]
 [force=yes]
 \definefontfallback [MathRomanFallBack]
 [name:alegreyabold]
 [lowercasebold,uppercasebold]
 [force=yes]
 \definefontsynonym
 [MathRoman]
 [file:libertinusmath-regular.otf]
 [features={math\mathsizesuffix,libertinus:mathextra,mathextra},fallbacks=MathRomanFallBack,goodies=libertinus-math]
 \definefontsynonym
 [MathRomanBold]
 [file:libertinusmath-regular.otf]
 [features={math\mathsizesuffix,libertinus-math-bold,libertinus:mathextra,mathextra},fallbacks=MathRomanFallBack,goodies=libertinus-math]
\stoptypescript

\starttypescript [mono] [overpass]
 \definefontsynonym[OverpassMono-Regular] [file:overpass-mono-regular]
 \definefontsynonym[OverpassMono-Light] [file:overpass-mono-light]
\stoptypescript

\starttypescript [mono] [overpass] [name]
 \definefontsynonym [Mono] [OverpassMono-Regular] [features=]
\stoptypescript

\starttypescript [mono] [overpass-light] [name]
 \definefontsynonym [Mono] [OverpassMono-Light] [features=]
\stoptypescript

\starttypescript [alegreya]
 \definetypeface [alegreya] [rm] [serif] [alegreya] [default]
 \definetypeface [alegreya] [ss] [sans] [alegreya] [default]
 \definetypeface [alegreya] [mm] [math] [alegreya] [default]
 \definefontfamily [alegreya] [tt] [overpass] [scale=0.9]
\stoptypescript

\starttypescript [alegreya-light]
 \definetypeface [alegreya-light] [rm] [serif] [alegreya] [default]
 \definetypeface [alegreya-light] [ss] [sans] [alegreya-light] [default]
 \definetypeface [alegreya-light] [mm] [math] [alegreya] [default]
 \definefontfamily [alegreya-light] [tt] [overpass-light] [scale=0.9]
\stoptypescript

\starttypescript [alegreya-medium]
 \definetypeface [alegreya] [rm] [serif] [alegreya] [default]
 \definetypeface [alegreya] [ss] [sans] [alegreya-medium] [default]
 \definetypeface [alegreya] [mm] [math] [alegreya] [default]
 \definefontfamily [alegreya] [tt] [overpass] [scale=0.9]
\stoptypescript

\stoptypescriptcollection

Also if needed I can share the custom goodie file, but not sure if it is the cause of my problems.

Basically lowercaseitalic,uppercaseitalic are not replaced and libertinus is still used.

The MWE:

\starttext

\setupbodyfont[alegreya,10pt]

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

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

\setupbodyfont[libertinus,10pt]

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

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

\stoptext

Guidance much welcome.

Alex

[-- Attachment #1.2: Type: text/html, Size: 9005 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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-10-04  5:48 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <f9b8d8e6-6f48-4f27-8333-6b2f726b12f4@Spark>]

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=425ff7d9-28a1-4d35-ad3a-6ec315e3b991@Spark \
    --to=aleks.ctx.tex@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).