ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Selecting fonts using the built-in simplefonts module
Date: Sun, 29 Mar 2015 22:57:27 +0200	[thread overview]
Message-ID: <78286512-B0CA-43E7-96E5-549CC581188F@gmail.com> (raw)
In-Reply-To: <55186090.1000704@googlemail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4004 bytes --]


> Am 29.03.2015 um 22:29 schrieb Jörg Weger <joerg73.muc@googlemail.com>:
> 
> 
> 
> On 29.03.2015 21:31, Wolfgang Schuster wrote:
>> 
>>> Am 29.03.2015 um 20:33 schrieb Jörg Weger <joerg73.muc@googlemail.com <mailto:joerg73.muc@googlemail.com>
>>> <mailto:joerg73.muc@googlemail.com <mailto:joerg73.muc@googlemail.com>>>:
>>> 
>>>> You need the familyname of the font, you use the font manager of your OS
>>>> to get the name.
>>>> 
>>>> \definefontfamily [junction] [rm] [Junction]
>>>> \definefontfamily [junction] [mm] [Latin Modern Math]
>>>> 
>>>> \definefontfamily [junction-light] [rm] [Junction]
>>>> [tf=style:light,bf=style:regular]
>>> 
>>> I just had it made working this way:
>>> 
>>> \definefontfamily[mainface]
>>> [ss]
>>> [EgalobhierFarinUrlaubodersonstwasoderwersteht]
>>> [tf=Junction Light, bf=Junction Regular]
>> 
>> \definefontfamily [mainface] [ss] [Junction] [tf=* Light,bf=* Regular]
>> 
>>> It seems that as soon as you define your own weights (which you can
>>> mix from different font families) in the fourth pair of brackets,
>>> there can be anything in the third pair of brackets (family name).
>>> 
>>> \definefontfamily[mainface]
>>> [sans]
>>> [Anything]
>>> [regularfont=Junction Light, boldfont=Junction Regular]
>>> 
>>> works as well and is more self-explaining.
>> 
>> This will only work when you set a upright font or you will get problems.
>> 
> 
> What problems do you mean?

When you write nonsense as font name without setting a upright font nothing will show up in your document because the fonts aren’t loaded.

> The following seems to work, only that there is a fallback to the fonts defined as upright fonts (which are in fact italic fonts) for the \em parts which seems to be the default behaviour if no italic fonts are defined in the fourth bracket pair:

The \em command uses the slanted and not the italic alternative by default.

When there is no italic or slanted style in the font the regular style is used and when there is no bolditalic or boldslanted style the bold style is used.

> %%% MWE %%%%%%%%%%%%%%%%%%%%
> 
> \definefontfamily[mainface][ss][EgalobhierFarinUrlaubodersonstwassteht][tf=Roboto Light Italic, bf=Roboto Black Italic]
> 
> \setupbodyfont[mainface,9pt]
> 
> 
> \starttext
> 
> \ss \input lorem
> 
> \ss \bf \input lorem
> 
> \ss \tf \em \input lorem
> 
> \ss \bf \em \input lorem
> 
> \stoptext
> 
> 
> %%%%%%%%%% End of MWE %%%%%%%%%
> 
> 
> Of course these font definitions do not make much sense but they work as I had expected from previous observations. And of course you should define all styles (\rm, \ss, \mm).

You don’t need a serif and a sans font in your document, one of them is enough but math should be always present because some symbols like bullets (but you can force context to take them from the text font) are taken from math.

>>> An advantage of your way
>>> 
>>> > \definefontfamily [junction-light] [rm] [Junction]
>>> > [tf=style:light,bf=style:regular]
>>> 
>>> is that you have to type the family name only once if you re-define
>>> weights from the same family.
>> 
>> When you use the keywords for the style you don’t have to look for the
>> right names and simpelfonts has fallbacks when the requested style isn’t
>> available.
> 
> That is a nice option.
> 
>> 
>>> Are there any reasons why one should not use any of all those synonyms?
>> 
>> What do you mean?
> 
> I mean that for example inside the second bracket pair “rm” equals “serif”, ”ss“ equals “sans” etc., in the fourth bracket pair “regularfont” equals “tf” etc.
> 
> Are there recommendations to not use some of those apart from personal taste? Or is “rm” simply a shorter plain TeX heritage while “serif” is more self-explaining?

It doesn’t matter whether you use rm or serif in the second argument because the argument is checked and converted to a internal name.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 25107 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2015-03-29 20:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-29 12:40 Pavneet Arora
2015-03-29 15:56 ` Jörg Weger
2015-03-29 16:52   ` Pablo Rodriguez
2015-03-29 19:38   ` Pavneet Arora
2015-03-29 16:37 ` Pablo Rodriguez
2015-03-29 17:47 ` Wolfgang Schuster
2015-03-29 18:33   ` Jörg Weger
2015-03-29 19:31     ` Wolfgang Schuster
2015-03-29 20:29       ` Jörg Weger
2015-03-29 20:57         ` Wolfgang Schuster [this message]
2015-03-29 20:44   ` Pavneet Arora
2015-03-29 21:16     ` Wolfgang Schuster
     [not found] <mailman.527.1427657514.2410.ntg-context@ntg.nl>
2015-03-29 19:45 ` Pavneet Arora

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=78286512-B0CA-43E7-96E5-549CC581188F@gmail.com \
    --to=schuster.wolfgang@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).