ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: typescripts and variants
Date: Wed, 23 Jun 2021 18:22:10 +0200	[thread overview]
Message-ID: <bb672422-352d-5b1d-c473-4c041e15157d@gmail.com> (raw)
In-Reply-To: <40e86e6c07664d6e8c525f479aadc569@unibe.ch>

denis.maier@unibe.ch schrieb am 23.06.2021 um 11:05:
> Hi,
>
>>> Am 23.06.2021 um 08:43 schrieb Henning Hraban Ramm <texml@fiee.net>:
>>>
>>>
>>>> Am 23.06.2021 um 00:17 schrieb denis.maier@unibe.ch:
>>>>
>>>> Hi
>>>> In my current project I need to use different variants if the Noto
>>>> Serif font (Regular, Medium, Semi Condensed Bold, Regular ExtraBold.) Is
>> my understanding of typescripts correct that I cannot have bold and extrabold
>> in the same typescript? And that I need a typescript for regular and one for the
>> semicondensed variants?
>>> You can combine whatever you like in one typescript, but you’re restricted to
>> six styles (regular, italic, slanted, bold, bold italic, bold slanted). You can just
>> “abuse” the italic or slanted styles for your other weights.
>>
>> ... or use roman styles, if you don’t need roman.
> Thanks for your help.
> After playing a bit more with the different variants for loading fonts it looks like I don't even need to use typescripts. \definefontfamily works just as good:
>
> \definefontfamily[mainface][rm][Noto Serif]
> \definefontfamily[mainface-semicond][rm][Noto Serif]
>    [tf=file:NotoSerif-SemiCondensed.ttf,
>    it=file:NotoSerif-SemiCondensedItalic.ttf,
>    bf=file:NotoSerif-SemiCondensedBold.ttf,
>    bi=file:NotoSerif-SemiCondensedBoldItalic.ttf]
>
> But, do typescripts have any advantages over that approach?

Even when you use \definefontfamily the internal font handling relies on 
the typescripts.

The advantage of hand written (or generated) typescripts is better 
reliability, most of the time you pass just a name to \definefontfamily 
and some font is chosen for each style but this can fail because all 
depends on the information in the font files. When you use a typescript 
each alternative is associated with a certain font file and almost no 
guess work is required.

> Then, for fonts used only in specific contexts, you can also do something like
>   
> \definefont [TitleFont] [notoserifsemicondensedextrabold]
> and use that with \TitleFont
> But you will then also need \TitleMonoFont etc, whereas it seems easier to keep things consistent with \definefontfamily...
>
> One thing I'm wondering about: Would it be possible to add a easy mechanism to switch to different variants of a font, say, to use the SemiCondensed variant or the ExtraCondensed or so? (Or does that already exist?)
> And, what about adding more styles so that you could have Light, Medium, SemiBold, Bold, ExtraBold, Black etc. all defined in a single fontfamily? If that was available each font family would then define all the styles for one variant (SemiCondensed, ExtraCondensed, Condensed, each with 18 styles!)

You can add more alternatives (\it, \bf ...) to the font mechanism but 
this requires additional settings (\definebodyfont ...) to get it 
working. A limiting factor is that you have to stick to two-letter names 
for each alternative and the easier solution is to create additional 
typefaces.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-06-23 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 22:17 denis.maier
2021-06-23  6:43 ` Henning Hraban Ramm
2021-06-23  6:53   ` Henning Hraban Ramm
2021-06-23  9:05     ` denis.maier
2021-06-23 16:22       ` Wolfgang Schuster [this message]
2021-06-24 14:53         ` BPJ
2021-06-23 19:42   ` Bruce Horrocks
2021-06-23 20:32     ` Henning Hraban Ramm
2021-06-23 21:01       ` Hans Hagen

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=bb672422-352d-5b1d-c473-4c041e15157d@gmail.com \
    --to=wolfgang.schuster.lists@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).