[NTG-context] OK, I Don't Quite Understand \definefontfamily

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Mon Sep 28 21:39:15 CEST 2020


Michael Urban schrieb am 25.09.2020 um 21:12:
> I don't seem quite able to put it all together, forgive the question.
> 
> I have a 'Bookman' font setup, pretty vanilla:
> 
> \definetypeface [Bookman] [rm] [serif] [bonum] [sl=name:unituscndboldoblique]
> \definetypeface [Bookman] [tt] [mono]  [modern] [default]
> \definetypeface [Bookman] [ss] [sans] [unitus] [default]
> \definetypeface [Bookman] [mm] [math] [modern] [default]
> 
> (Unitus is the fontsite 500 'Univers' substitute, works fine)
> 
> Now, the built-in gyre bonum font doesn't have a slanted/oblique variant, so if I have Bookman as my main body
> font, \sl  produces (unsurprisingly) the same result as \it, TexGyreBonum-Italic.   If I want \sl to summon
> Latin Modern for the variant, I have tried variations on
> 
> \definetypeface [Bookman] [rm] [serif] [bonum] [sl=file:Latin Modern Roman Slanted]
> 
> 
> but to no avail — not helped by the fact that the \definetypeface contextgarden page doesn't have any pointer to just what that fifth
> argument can contain.

https://wiki.contextgarden.net/Command/definetypeface

> How do I accomplish this?

Use \definefontfamily which is missing in your example.

\definefontfamily [Bookman] [rm] [TeX Gyre Bonum]
   [sl=features:{*,slanted},
    bs=features:{*,slanted}]

\definetypeface [Bookman] [mm] [math] [modern] [default]

\setupbodyfont [Bookman]

\starttext
\tf upright \it italic \sl slanted \bf bold \bi bolditalic \bs boldslanted
\stoptext

Wolfgang


More information about the ntg-context mailing list