Michael Urban via ntg-context schrieb am 05.02.2022 um 20:28:
I am experiencing an odd behavior switching text styles in a defined startstop group ("blockquote"). I get different behavior depending on whether the switchtobodyfont in the startstop definition includes the dummy {\it } and {\bf } text. If they are not there, the italic and boldface switches in the second blockquote revert to the gyreschola body font of the main text; but this only happens if there is an earlier blockquote with no style changes. This is with:
[...]
Do I need a newer version of ConTeXt, or am I doing something wrong? Fonts in ConTeXt are always perilous, alas. For me, anyway.
\definefallbackfamily[story][serif][notoserif][range={greekandcoptic,greekextended},force=yes] \definefontfamily[story][serif][TeX Gyre Schola]
The following two font settings are wrong, you're passing the name of a typescript for the third argument while \definefontfamily expects the family name of a font. Even though the usage of the command is wrong you didn't notice it because as a fallback \definefontfamily uses the Latin Modern version of the requested style when no font was found.
\definefontfamily[story][sans][modern] \definefontfamily[story][mono][modern]
The correct settings for both settings are \definefontfamily [story] [sans] [Latin Modern Sans] \definefontfamily [story] [mono] [Latin Modern Mono] [features=none] with the "features=none" for the mono font to ensure no ligatures are formed. An alternative for \definefontfamily is to use \definetypeface and choose a predefined typescript for the Latin Modern family. You can either use \definetypeface [story] [ss] [sans] [modern] [default] \definetypeface [story] [ss] [mono] [modern] [default] which uses the 10pt optical size even for smaller and bigger sizes or you enable optical sizes with the following typescript \definetypeface [story] [ss] [sans] [modern-designsize] [default] \definetypeface [story] [ss] [mono] [modern-designsize] [default]
\definefontfamily[story][mm][TeX Gyre Pagella Math]
I recommend to load the math font with the provided typescript because they ensure existing patches (e.g. spacing corrections) for the selected font are applied. \definetypeface [story] [mm] [math] [pagella] [default]
\setupbodyfont[story,11pt]
\definestartstop[blockquote] [ before={ \blank \startnarrower \setupwhitespace[2pt] \setupindenting[none] \switchtobodyfont[termes]{\it }{\bf }% This is so weird. Put a comment marker after [termes] for a different result }, after={ \stopnarrower \blank \indenting[next]}, ]%
ConTeXt already provides a blockquote-environment which can be configured to have the same style as your custom environment. \startsetups [blockquote:style] \switchtobodyfont[termes] \setupwhitespace[2pt] \stopsetups \setupdelimitedtext [blockquote] [spacebefore=big, style=\directsetup{blockquote:style}, indenting=none, indentnext=yes] Wolfgang