ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Why does HerosBold give bold italic?
@ 2021-08-25 12:28 Bruce Horrocks via ntg-context
  2021-08-25 12:56 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Horrocks via ntg-context @ 2021-08-25 12:28 UTC (permalink / raw)
  To: ntg-context; +Cc: Bruce Horrocks

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

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why does HerosBold give bold italic?
  2021-08-25 12:28 Why does HerosBold give bold italic? Bruce Horrocks via ntg-context
@ 2021-08-25 12:56 ` Wolfgang Schuster via ntg-context
  2021-08-25 21:15   ` Bruce Horrocks via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-08-25 12:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Bruce Horrocks via ntg-context
  Cc: Wolfgang Schuster

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why does HerosBold give bold italic?
  2021-08-25 12:56 ` Wolfgang Schuster via ntg-context
@ 2021-08-25 21:15   ` Bruce Horrocks via ntg-context
  2021-08-26  3:52     ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Horrocks via ntg-context @ 2021-08-25 21:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Bruce Horrocks


> On 25 Aug 2021, at 13:56, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
> 
> 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

Thanks Wolfgang. I always get very confused when ConTeXt 'nearly' works and this was one of those times. Your \style example is interesting and I'll bear it in mind but at the moment I only need this for some one-off title page text rather than body text.

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why does HerosBold give bold italic?
  2021-08-25 21:15   ` Bruce Horrocks via ntg-context
@ 2021-08-26  3:52     ` Wolfgang Schuster via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-08-26  3:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Bruce Horrocks via ntg-context
  Cc: Wolfgang Schuster

Bruce Horrocks via ntg-context schrieb am 25.08.2021 um 23:15:
>> On 25 Aug 2021, at 13:56, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
>>
>> 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
> Thanks Wolfgang. I always get very confused when ConTeXt 'nearly' works and this was one of those times. Your \style example is interesting and I'll bear it in mind but at the moment I only need this for some one-off title page text rather than body text.

In this case you change the font once at the start of the title page, 
afterwards you can use \bf and \it to change styles.

\usebodyfont[heros]

\definebodyfontenvironment [14pt]

\starttext

\startstandardmakeup [style={\switchtobodyfont[heros,14pt]}]

The quick brown
{\bf fox jumps over}
{\it the lazy dog}

\stopstandardmakeup

\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-26  3:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 12:28 Why does HerosBold give bold italic? Bruce Horrocks via ntg-context
2021-08-25 12:56 ` Wolfgang Schuster via ntg-context
2021-08-25 21:15   ` Bruce Horrocks via ntg-context
2021-08-26  3:52     ` Wolfgang Schuster via ntg-context

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).