\switchtobodyfont behaves differenctly with splitted parameters
Dear List, after hours of debugging, I finally found out that \switchtobodyfont[face, 20pt] does NOT behave the same with \switchtobodyfont[face]\switchtobodyfont[20pt]. In my case the latter is the correct one, while the former does nothing but falling back to latinmodern. Does anyone know when or why \switchtobodyfont behaves differently with splitted and joined parameters? Thanks. Best, Sylvain
On 11/8/20 2:35 AM, Sylvain Hubert wrote:
Dear List,
after hours of debugging, I finally found out that \switchtobodyfont[face, 20pt] does NOT behave the same with \switchtobodyfont[face]\switchtobodyfont[20pt]. In my case the latter is the correct one, while the former does nothing but falling back to latinmodern.
Does anyone know when or why \switchtobodyfont behaves differently with splitted and joined parameters?
Hi Sylvain, as a general rule, it helps when there is a minimal sample that provides the problematic behavior. I don’t get diffferent results: \definefontfamily[mainface][rm][TeX Gyre Pagella] \definefontfamily[face][rm][TeX Gyre Heros] \setupbodyfont[mainface] \startbuffer In my case, the latter is the correct one, while the former does nothing but falling back to latinmodern.\par \stopbuffer \starttext \getbuffer \switchtobodyfont[face]\switchtobodyfont[20pt] \getbuffer \switchtobodyfont[face, 20pt] \getbuffer \stoptext Correct the sample to show what I got wrong from your message. Pablo -- http://www.ousia.tk
Hi Pablo,
thanks for the suggestion. Here's the minimal example which shows the
difference:
\definefontfamily[face][rm][dejavuserif]
\starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
this should warn:
fonts > checking > char ɑ (U+00251) in font
'LatinModernMath-Regular-4' with id 10: missing
while
\definefontfamily[face][rm][dejavuserif]
\starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
produces the expected result despite a harmless warning.
Sylvain
On Sun, 8 Nov 2020 at 10:41, Pablo Rodriguez
On 11/8/20 2:35 AM, Sylvain Hubert wrote:
Dear List,
after hours of debugging, I finally found out that \switchtobodyfont[face, 20pt] does NOT behave the same with \switchtobodyfont[face]\switchtobodyfont[20pt]. In my case the latter is the correct one, while the former does nothing but falling back to latinmodern.
Does anyone know when or why \switchtobodyfont behaves differently with splitted and joined parameters?
Hi Sylvain,
as a general rule, it helps when there is a minimal sample that provides the problematic behavior.
I don’t get diffferent results:
\definefontfamily[mainface][rm][TeX Gyre Pagella] \definefontfamily[face][rm][TeX Gyre Heros] \setupbodyfont[mainface] \startbuffer In my case, the latter is the correct one, while the former does nothing but falling back to latinmodern.\par \stopbuffer
\starttext \getbuffer \switchtobodyfont[face]\switchtobodyfont[20pt] \getbuffer \switchtobodyfont[face, 20pt] \getbuffer \stoptext
Correct the sample to show what I got wrong from your message.
Pablo -- http://www.ousia.tk
___________________________________________________________________________________ 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
___________________________________________________________________________________
On Sun, 8 Nov 2020 at 11:18, Sylvain Hubert
Hi Pablo,
thanks for the suggestion. Here's the minimal example which shows the difference:
\definefontfamily[face][rm][dejavuserif] \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
this should warn:
fonts > checking > char ɑ (U+00251) in font 'LatinModernMath-Regular-4' with id 10: missing
while
\definefontfamily[face][rm][dejavuserif] \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
sorry, this should read \definefontfamily[face][rm][dejavuserif] \starttext\switchtobodyfont[face]\switchtobodyfont[24pt]ɑ\stoptext
produces the expected result despite a harmless warning.
Sylvain
On 11/8/20 11:18 AM, Sylvain Hubert wrote:
Hi Pablo,
thanks for the suggestion. Here's the minimal example which shows the difference:
\definefontfamily[face][rm][dejavuserif] \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
this should warn:
fonts > checking > char ɑ (U+00251) in font 'LatinModernMath-Regular-4' with id 10: missing
Well, you are switching before setting up a body font. I don’t know whether this might be a bug in ConTeXt (see previous report), but I would set up the body font always first: \definefontfamily[face][rm][dejavuserif] \definefontfamily[deface][rm][dejavusans] \setupbodyfont[deface] \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext
while
\definefontfamily[face][rm][dejavuserif] \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
produces the expected result despite a harmless warning.
I guess the command reads: \switchtobodyfont[face]ɑ This might also be related to the issue just reported. Pablo -- http://www.ousia.tk
On Sun, 8 Nov 2020 at 11:37, Pablo Rodriguez
On 11/8/20 11:18 AM, Sylvain Hubert wrote:
Hi Pablo,
thanks for the suggestion. Here's the minimal example which shows the difference:
\definefontfamily[face][rm][dejavuserif] \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
this should warn:
fonts > checking > char ɑ (U+00251) in font 'LatinModernMath-Regular-4' with id 10: missing
Well, you are switching before setting up a body font.
I don’t know whether this might be a bug in ConTeXt (see previous report), but I would set up the body font always first:
\definefontfamily[face][rm][dejavuserif] \definefontfamily[deface][rm][dejavusans] \setupbodyfont[deface] \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext
Thanks, it works! And I agree that it probably indicates the existence of a bug, since by changing "\setupbodyfont[deface]" to "\setupbodyfont[dejavu]" in your example, the problem reappears: \definefontfamily[face][rm][dejavuserif] \setupbodyfont[dejavu] \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext Sylvain
Sylvain Hubert schrieb am 08.11.2020 um 12:02:
On Sun, 8 Nov 2020 at 11:37, Pablo Rodriguez
mailto:oinos@gmx.es> wrote: On 11/8/20 11:18 AM, Sylvain Hubert wrote: > Hi Pablo, > > thanks for the suggestion. Here's the minimal example which shows the > difference: > > \definefontfamily[face][rm][dejavuserif] > \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext > > this should warn: > > fonts > checking > char ɑ (U+00251) in font > 'LatinModernMath-Regular-4' with id 10: missing
Well, you are switching before setting up a body font.
I don’t know whether this might be a bug in ConTeXt (see previous report), but I would set up the body font always first:
\definefontfamily[face][rm][dejavuserif] \definefontfamily[deface][rm][dejavusans] \setupbodyfont[deface] \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext
Thanks, it works!
And I agree that it probably indicates the existence of a bug, since by changing "\setupbodyfont[deface]" to "\setupbodyfont[dejavu]" in your example, the problem reappears:
\definefontfamily[face][rm][dejavuserif]
Add here: \definebodyfont[24pt] Wolfgang
On 11/8/2020 12:02 PM, Sylvain Hubert wrote:
On Sun, 8 Nov 2020 at 11:37, Pablo Rodriguez
mailto:oinos@gmx.es> wrote: On 11/8/20 11:18 AM, Sylvain Hubert wrote: > Hi Pablo, > > thanks for the suggestion. Here's the minimal example which shows the > difference: > > \definefontfamily[face][rm][dejavuserif] > \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext > > this should warn: > > fonts > checking > char ɑ (U+00251) in font > 'LatinModernMath-Regular-4' with id 10: missing
Well, you are switching before setting up a body font.
I don’t know whether this might be a bug in ConTeXt (see previous report), but I would set up the body font always first:
\definefontfamily[face][rm][dejavuserif] \definefontfamily[deface][rm][dejavusans] \setupbodyfont[deface] \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext
Thanks, it works!
And I agree that it probably indicates the existence of a bug, since by changing "\setupbodyfont[deface]" to "\setupbodyfont[dejavu]" in your example, the problem reappears:
\definefontfamily[face][rm][dejavuserif] \setupbodyfont[dejavu] \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext when yyou use several bodyfonts you can do this before \starttext:
\usebodyfont[face,24pt] \usebodyfont[deface] \starttext .... \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 8 Nov 2020 at 12:14, Hans Hagen
when yyou use several bodyfonts you can do this before \starttext:
\usebodyfont[face,24pt] \usebodyfont[deface]
\starttext .... \stoptext
Thank you for the information, Hans! Could you please also shed some light on the relation/difference among \{setup,switchto,use}bodyfont? There seems to be not much documentation on this. Can one conclude, from the wiki https://wiki.contextgarden.net/Command/switchtobodyfont and the source code https://source.contextgarden.net/tex/context/base/mkiv/font-ini.mklx#l2287, that they are mostly the same, except that \switchtobodyfont is restricted to the content area, and \usebodyfont is a helper to call \setupbodyfont in the beginning? If this is the case, is it recommended to always put a \setupbodyfont[...] in the beginning, even if it's just a \setupbodyfont[modern]? One reason might be that the following example somehow enlarges the page number in the header, intuitively contradicting what is claimed by the wiki https://wiki.contextgarden.net/Command/switchtobodyfont: \switchtobodyfont[dejavu] \starttext \switchtobodyfont[dejavu, 24pt]a\stoptext Thanks! Sylvain
On 11/8/2020 12:46 PM, Sylvain Hubert wrote:
On Sun, 8 Nov 2020 at 12:14, Hans Hagen
mailto:j.hagen@xs4all.nl> wrote: when yyou use several bodyfonts you can do this before \starttext:
\usebodyfont[face,24pt] \usebodyfont[deface]
\starttext .... \stoptext
Thank you for the information, Hans!
Could you please also shed some light on the relation/difference among \{setup,switchto,use}bodyfont? There seems to be not much documentation on this. Can one conclude, from the wiki https://wiki.contextgarden.net/Command/switchtobodyfont and the source code https://source.contextgarden.net/tex/context/base/mkiv/font-ini.mklx#l2287, that they are mostly the same, except that \switchtobodyfont is restricted to the content area, and \usebodyfont is a helper to call \setupbodyfont in the beginning?
If this is the case, is it recommended to always put a \setupbodyfont[...] in the beginning, even if it's just a \setupbodyfont[modern]? One reason might be that the following example somehow enlarges the page number in the header, intuitively contradicting what is claimed by the wiki https://wiki.contextgarden.net/Command/switchtobodyfont:
\switchtobodyfont[dejavu] \starttext \switchtobodyfont[dejavu, 24pt]a\stoptext
\setup is document wide \switch is for local usage (has to do with picking up font/space related issues after page breaks and when typesetting page ornaments like headers and footers) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 8 Nov 2020 at 12:52, Hans Hagen
On 11/8/2020 12:46 PM, Sylvain Hubert wrote:
On Sun, 8 Nov 2020 at 12:14, Hans Hagen
mailto:j.hagen@xs4all.nl> wrote: when yyou use several bodyfonts you can do this before \starttext:
\usebodyfont[face,24pt] \usebodyfont[deface]
\starttext .... \stoptext
Thank you for the information, Hans!
Could you please also shed some light on the relation/difference among \{setup,switchto,use}bodyfont? There seems to be not much documentation on this. Can one conclude, from the wiki https://wiki.contextgarden.net/Command/switchtobodyfont and the source code < https://source.contextgarden.net/tex/context/base/mkiv/font-ini.mklx#l2287>,
that they are mostly the same, except that \switchtobodyfont is restricted to the content area, and \usebodyfont is a helper to call \setupbodyfont in the beginning?
If this is the case, is it recommended to always put a \setupbodyfont[...] in the beginning, even if it's just a \setupbodyfont[modern]? One reason might be that the following example somehow enlarges the page number in the header, intuitively contradicting what is claimed by the wiki https://wiki.contextgarden.net/Command/switchtobodyfont:
\switchtobodyfont[dejavu] \starttext \switchtobodyfont[dejavu, 24pt]a\stoptext
\setup is document wide \switch is for local usage
So \switchtobodyfont before \starttext is semantically an error then. Thanks for the confirmation!
(has to do with picking up font/space related issues after page breaks and when typesetting page ornaments like headers and footers)
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Sylvain
participants (4)
-
Hans Hagen
-
Pablo Rodriguez
-
Sylvain Hubert
-
Wolfgang Schuster