ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Jörg Weger" <joerg73.muc@googlemail.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 20:33:14 +0200	[thread overview]
Message-ID: <5518456A.7020008@googlemail.com> (raw)
In-Reply-To: <4F197B16-5B9A-41CB-8E76-AD12C68D5F66@gmail.com>



On 29.03.2015 19:47, Wolfgang Schuster wrote:
>
>> Am 29.03.2015 um 14:40 schrieb Pavneet Arora <pavneet_arora@waroc.com
>> <mailto:pavneet_arora@waroc.com>>:
>>
>> Hello everyone,
>>
>> After a long time I have some typesetting work in front of me...yippeee!
>>
>> I am struggling with adapting my templates to the new integrated
>> simplefonts module, and hope that someone can help.
>>
>> The three issues I am having are:
>>
>> 1.  How does one find the proper expanded long name of the desired font.
>>    For this project, I am using some fonts from The League of Moveable
>>    Type (https://www.theleagueofmoveabletype.com/).
>>
>>    I have reloaded the fonts, and can list them, in the traditional
>>    manner.  What I don't know is how to find the proper name for---say
>>    Junction Light---to use as the third argument in
>>    '\definefontfamily[mainface][ss][Junction Light]'
>>
>>    The use of 'Junction Light' doesn't work, and neither does
>>    'Junction-Light', nor 'junctionlight', nor even 'Junction, Light'
>>    which I retrieve from Font Viewer under Linux.  MWE follows at the
>>    end of this email.  I reference Wolfgang's response stating that the
>>    expanded name must be used
>>    (http://www.ntg.nl/pipermail/ntg-context/2014/077321.html).
>
> 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]

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.

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.

Are there any reasons why one should not use any of all those synonyms?


Greetings Jörg

> \definefontfamily [junction-light] [mm] [Latin Modern Math]
>
> \setupbodyfont[junction]
>
> \starttext
>
> \input ward \bf \input ward
>
> \blank \switchtobodyfont[junction-light]
>
> \tf \input ward \bf \input ward
>
> \stoptext
>
>
>> 2.  How does one switch fonts in-line for small snippets of text?  I
>>    used to use '{\simplefont[heydingsicons] q}123.345.67890', but this
>>    now results in an error.
>>
>>    tex error       > error on line 7 in file
>> virtual://buffer.noname.1: ! Undefined control sequence
>>
>>    l.7                 {\simplefont [heydingsicons] q}~123.456.7890
>> {\simplefont[heydingsicons..
>
> When you use a symbol font define a command for it with \definesymbol
> and access it with \symbol.
>
> The example below uses the Font Awesome [1] font for the symbols (the
> symbols are defined in the attached file).
>
> \usesymbols[fontawesome]
>
> \defineframed
>    [SymbolFrame]
>    [strut=no,
>     width=1em,
>     height=1em,
>     background=color,
>     backgroundcolor=black,
>     corner=round,
>     radius=.5ex,
>     foregroundcolor=white]
>
> \definesymbol
>    [mysymbol]
>    [\SymbolFrame{\directsymbol{fontawesome}{question}}]
>
> \starttext
>
> \startlines
> \symbol[fontawesome][question]
> \symbol[fontawesome][question-circle]
> \framed[strut=no,width=1em,height=1em,background=color,backgroundcolor=black,corner=round,radius=.5ex,foregroundcolor=white]{\symbol[fontawesome][question]}
> \symbol[mysymbol]
> \stoplines
>
> \stoptext
>
>
>> 3.  This may be a more generic typescript mapping issue, but I still
>>    struggle with understanding font mappings.  I don't quite get how
>>    the default mappings are done.
>>
>>    Look, for example, at Junction above.  'junction' is mapped to
>>    'junctionbold' rather than 'junctionregular'.  Is this just done by
>>    taking the first in the list in alphabetic order?
>>
>>    Or how the League Gothic font is processed below.  How is it that
>>    leaguegothic is mapped to leaguegothiccondenseditalic by default?
>>    What is the recommended way in this new simplefont scheme to set the
>>    mappings for a document?
>>
>>    $ mtxrun --script fonts --list --all --pattern=leaguegothic
>>
>>    resolvers       | trees | analyzing 'home:texmf'
>>    resolvers       | caching | skipping 'files' for 'home:texmf' from
>>    '/opt/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/trees/54be04d87dd160089f572b19cb5c97e9'
>> (version mismatch)
>>    leaguegothic                   leaguegothiccondenseditalic
>>    /home/pavneet/.fonts/opentype/TheLeagueOfMoveableType/theleagueof-league-gothic-64c3ede/LeagueGothic-CondensedItalic.otf
>>    leaguegothiccondenseditalic    leaguegothiccondenseditalic
>>    /home/pavneet/.fonts/opentype/TheLeagueOfMoveableType/theleagueof-league-gothic-64c3ede/LeagueGothic-CondensedItalic.otf
>>    leaguegothiccondensedregular   leaguegothiccondensedregular
>>   /home/pavneet/.fonts/opentype/TheLeagueOfMoveableType/theleagueof-league-gothic-64c3ede/LeagueGothic-CondensedRegular.otf
>>    leaguegothicitalic             leaguegothicitalic
>>             /home/pavneet/.fonts/opentype/TheLeagueOfMoveableType/theleagueof-league-gothic-64c3ede/LeagueGothic-Italic.otf
>>    leaguegothicregular            leaguegothicregular
>>            /home/pavneet/.fonts/opentype/TheLeagueOfMoveableType/theleagueof-league-gothic-64c3ede/LeagueGothic-Regular.otf
>
> There mappings are only relevant when you create your own typescripts
> where you access fonts
> with the name method, e.g. \definefontsynonym [Serif]
> [name:leaguegothic] but simplefonts doesn’t
> use of them.
>
> [1] http://fontawesome.io
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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 18:33 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 [this message]
2015-03-29 19:31     ` Wolfgang Schuster
2015-03-29 20:29       ` Jörg Weger
2015-03-29 20:57         ` Wolfgang Schuster
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=5518456A.7020008@googlemail.com \
    --to=joerg73.muc@googlemail.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).