On 3/8/2024 5:55 PM, Henning Hraban Ramm wrote:
Hi, if I need an additional pair of upright and italic font faces, e.g. a Medium or Light version, would it make sense to define them like this:
I'd just define a new typeface / bodyfont, using fo rinstance \starttypescript [sans] [AlegreyaMedium] and then use \switchtobodyfont[AlegreyaMedium]\sl or \AlegreyaMedium\sl which is also more efficient than adding more variants Hans
% adapted from font-pre.mkxl
\definefontalternative[md] \definefontalternative[mi] \definefontalternative[ms]
\definealternativestyle [medium] [\md] [] \definealternativestyle [mediumitalic,italicmedium] [\mi] [] \definealternativestyle [mediumslanted,slantedmedium][\ms] []
\definealternativestyle [sansmedium] [\ss\md] [] \definealternativestyle [serifmedium] [\rm\md] [] \definealternativestyle [monomedium] [\tt\md] []
%\definealternativestyle [mediumface] [\mediumface] []
\unexpanded\def\normalmd{\let\fontalternative\md\font_helpers_synchronize_font} \unexpanded\def\normalmi{\let\fontalternative\mi\font_helpers_synchronize_font} \unexpanded\def\normalms{\let\fontalternative\ms\font_helpers_synchronize_font}
\let\md\normalmd \let\mi\normalmi \let\ms\normalms
\definehighlight[medium ] [command=no,style=medium] \definehighlight[mediumitalic ] [command=no,style=mediumitalic] \definehighlight[mediumslanted] [command=no,style=mediumslanted]
Is that necessary? And is it enough?
\starttypescript [sans] [alegreya] \definefontsynonym[AlegreyaSans-Regular][name:AlegreyaSans-Regular] \definefontsynonym[AlegreyaSans-Italic][name:AlegreyaSans-Italic] \definefontsynonym[AlegreyaSans-Caps][name:AlegreyaSansSC-Regular] \definefontsynonym[AlegreyaSans-ItalicCaps][name:AlegreyaSansSC-Italic] \definefontsynonym[AlegreyaSans-Medium][name:AlegreyaSans-Medium]
\definefontsynonym[AlegreyaSans-MediumItalic][name:AlegreyaSans-MediumItalic] \definefontsynonym[AlegreyaSans-MediumCaps][name:AlegreyaSansSC-Medium]
\definefontsynonym[AlegreyaSans-MediumItalicCaps][name:AlegreyaSansSC-MediumItalic] \definefontsynonym[AlegreyaSans-Bold][name:AlegreyaSans-Bold]
\definefontsynonym[AlegreyaSans-BoldItalic][name:AlegreyaSans-BoldItalic] \definefontsynonym[AlegreyaSans-BoldCaps][name:AlegreyaSansSC-Bold]
\definefontsynonym[AlegreyaSans-BoldItalicCaps][name:AlegreyaSansSC-BoldItalic] \stoptypescript
\starttypescript [sans] [alegreya] [name] \definefontsynonym [Sans] [AlegreyaSans-Regular] [] \definefontsynonym [SansItalic] [AlegreyaSans-Italic] [] \definefontsynonym [SansSlanted] [AlegreyaSans-Italic] [] \definefontsynonym [SansMedium] [AlegreyaSans-Medium] [] \definefontsynonym [SansMediumItalic] [AlegreyaSans-MediumItalic][] \definefontsynonym [SansMediumSlanted][AlegreyaSans-MediumItalic][] \definefontsynonym [SansBold] [AlegreyaSans-Bold] [] \definefontsynonym [SansBoldItalic] [AlegreyaSans-BoldItalic] [] \definefontsynonym [SansBoldSlanted][AlegreyaSans-BoldItalic] [] \definefontsynonym [SansCaps] [AlegreyaSans-Caps] \stoptypescript ___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------