ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez <oinos@gmx.es>
To: ntg-context@ntg.nl
Subject: Re: set fallback in \definefont
Date: Mon, 15 Feb 2021 21:51:35 +0100	[thread overview]
Message-ID: <2e686683-ae74-2943-f496-f70d667fd428@gmx.es> (raw)
In-Reply-To: <CAMHZ1dYPawgAj2Td+cpYp_Mjnr=ppe_SFtxxAcctLMhrJg+sWw@mail.gmail.com>

On 2/15/21 8:47 PM, Mohammad Hossein Bateni wrote:
> Hi,
>
> Is there a way to set the fallback for fonts when we define them not as
> a typescript but using \definefont?
>
> \definefont[MyFont][Font.otf*MyFeatures]
>
> Is there a default fallback one can specify?
> Is simplefonts module deprecated or discouraged now?

Hi Mohammad,

the simplefonts module has been deprecated, since it has been
implemented in the ConTeXt core (see below).

\definefontfallback might be the command you are looking for.

> When we define a font via typescript commands, we can specify rm, ss,
> tt, mm, hw and cg shapes for it.  Can we add arbitrary styles? 
> For example, I would use this for quotations, headings, etc.  Currently,
> I either have to spare ss or use \definefont for such scenarios.

The new commands are \definefallbackfamily and \definefontfamily.

A sample document, in case it might help (GFS Heraklit at
https://greekfontsociety-gfs.gr/_assets/fonts/GFS_Heraklit.zip):

  \definefallbackfamily
    [mainface]
    [rm]
    [GFS Heraklit]
    [preset=range:greek,
     force=yes]

  \definefontfamily
    [mainface]
    [rm]
    [TeX Gyre Pagella]

  \setupbodyfont
    [mainface]

  \starttext
    \agr\input aristotle-grc

    \de\input aesop-de
  \stoptext

Sorry, but unless you provide a minimal sample, it isn’t easy to guess
what you might have in mind.

I’m afraid that I’m not sure whether the following sample contains your
“arbitrary styles”.

  \setupinteractionscreen[option=max]

  \definefontfamily
    [mainface]
    [rm]
    [TeX Gyre Pagella]
    [it={TeX Gyre Cursor-Italic},
     bf={TeX Gyre Adventor-Bold},
     bi={TeX Gyre Termes-BoldItalic}]

  \setupbodyfontenvironment
    [default]
    [em=italic]

  \setupbodyfont[mainface]

  \starttext
  \startTEXpage[offset=1em]
  Roman font {\em & italic}

  {\bf Bold font \em & bold italic}
  \stopTEXpage
  \stoptext

Feel free to explain what your needs are.

I hope it helps,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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-02-15 20:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 19:47 Mohammad Hossein Bateni
2021-02-15 20:51 ` Pablo Rodriguez [this message]
2021-02-15 21:30   ` Wolfgang Schuster
2021-02-15 21:55     ` Mohammad Hossein Bateni
2021-02-15 21:31   ` Mohammad Hossein Bateni
2021-02-16 18:34     ` Wolfgang Schuster

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=2e686683-ae74-2943-f496-f70d667fd428@gmx.es \
    --to=oinos@gmx.es \
    --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).