ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Typescript and Math fallback
       [not found] <f9b8d8e6-6f48-4f27-8333-6b2f726b12f4@Spark>
@ 2024-10-04  5:42 ` Alex
  0 siblings, 0 replies; only message in thread
From: Alex @ 2024-10-04  5:42 UTC (permalink / raw)
  To: Hans Hagen via ntg-context


[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-04  5:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <f9b8d8e6-6f48-4f27-8333-6b2f726b12f4@Spark>
2024-10-04  5:42 ` [NTG-context] Typescript and Math fallback Alex

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