Bruce Horrocks via ntg-context schrieb am 25.08.2021 um 14:28:
Why does HerosBold give bold italic instead of just bold?
\definefont[TestA][name:Heros at 14pt]
\definefont[TestB][name:HerosBold at 14pt]
\definefont[TestC][name:HerosItalic at 14pt]
\starttext
\TestA {The quick brown}
\TestB {fox jumps over}
\TestC {the lazy dog}
\stoptext
I guess you try to use TeX Gyre Heros, when this is the case you use the
wrong names for the font. The correct names are in the following example.
Another problem is how you use the new font commands, unlike many other
user created commands \definefont creates a switch and you have to move
the left braces before the command.
\definefont [TestA] [name:texgyreheros*default at 14pt]
\definefont [TestB] [name:texgyreherosbold*default at 14pt]
\definefont [TestC] [name:texgyreherositalic*default at 14pt]
\starttext
{\TestA The quick brown}
{\TestB fox jumps over}
{\TestC the lazy dog}
\stoptext
In my cases it is easier to use \switchtobodyfont rather than using a
fixed font style, below is a modified version of your example above.
While the example itself isn't very useful the method can be used to
change the font for a header, typing environment etc.
\usebodyfont[heros]
\starttext
\style[style={\switchtobodyfont[heros,14pt]}]{The quick brown}
\style[style={\switchtobodyfont[heros,14pt]\bf}]{fox jumps over}
\style[style={\switchtobodyfont[heros,14pt]\it}]{the lazy dog}
\stoptext
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
___________________________________________________________________________________