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