ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: additional font faces
Date: Fri, 8 Mar 2024 18:02:10 +0100	[thread overview]
Message-ID: <8b860a00-bd1d-49e3-b3b5-3038008e61eb@xs4all.nl> (raw)
In-Reply-To: <1dcdcf45-ec8e-412f-a02b-de81369c50f9@fiee.net>

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

___________________________________________________________________________________
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-03-08 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 16:55 [NTG-context] " Henning Hraban Ramm
2024-03-08 17:02 ` Hans Hagen [this message]
2024-03-08 17:22   ` [NTG-context] " Henning Hraban Ramm

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=8b860a00-bd1d-49e3-b3b5-3038008e61eb@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --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).