ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Odd  Font Behavior in startstop Group
@ 2022-02-05 19:28 Michael Urban via ntg-context
  2022-02-06  7:34 ` śrīrāma via ntg-context
  2022-02-06 10:20 ` Wolfgang Schuster via ntg-context
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Urban via ntg-context @ 2022-02-05 19:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Michael Urban

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:

$  context --version
mtx-context     | ConTeXt Process Management 1.03
mtx-context     |
mtx-context     | main context file: /usr/local/texlive/texmf-local/tex/context/base/mkiv/context.mkiv
mtx-context     | current version: 2020.03.10 14:44
mtx-context     | main context file: /usr/local/texlive/texmf-local/tex/context/base/mkiv/context.mkxl
mtx-context     | current version: 2020.03.10 14:44

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]
\definefontfamily[story][sans][modern]
\definefontfamily[story][mono][modern]
\definefontfamily[story][mm][TeX Gyre Pagella Math]
\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]},
 ]%
\starttext
\chapter{Testing}
\input ward

\startblockquote
\input knuth

\stopblockquote

\input zapf

{\it This is what Italic letters look like.} {\bf And these are bold.}


\startblockquote
This is what it said, in {\it Italic} and {\bf bold} letters:

\bgroup
\it\noindent This is what Italic letters look like here.
\egroup

\bgroup
\bf\noindent This is what Bold letters look like here.
\egroup
\stopblockquote
\stoptext

___________________________________________________________________________________
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: Odd  Font Behavior in startstop Group
  2022-02-05 19:28 Odd Font Behavior in startstop Group Michael Urban via ntg-context
@ 2022-02-06  7:34 ` śrīrāma via ntg-context
  2022-02-06 10:20 ` Wolfgang Schuster via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: śrīrāma via ntg-context @ 2022-02-06  7:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Michael Urban; +Cc: śrīrāma

On Sunday, February 6, 2022 12:58:06 AM IST Michael Urban via ntg-context 
wrote:
> Do I need a newer version of ConTeXt, or am I doing something wrong?
> Fonts in ConTeXt are always perilous, alas.  For me, anyway.

(pre)loading the typescripts 'fixes' the issue.
	\usebodyfont[termes]

See below a modified version of your MWE:

\definefallbackfamily[story][serif][notoserif]
[range={greekandcoptic,greekextended},force=yes]
\definefontfamily[story][serif][TeX Gyre Schola]
\definefontfamily[story][sans][modern]
\definefontfamily[story][mono][modern]
\definefontfamily[story][mm][TeX Gyre Pagella Math]
\setupbodyfont[story,11pt]
\usebodyfont[termes]

\definestartstop
    [blockquote]
    [before={\blank\startnarrower\setupwhitespace[2pt]\setupindenting[none]},
     style={\switchtobodyfont[termes]},
     after={\stopnarrower\blank\indenting[next]}]

\starttext
\input knuth

    \startblockquote
    \input knuth
    \stopblockquote

    this is normal text
    \par
    {\bf this is bold}
    \par
    {\it this is italics}

    \startblockquote
    this is normal text
    \par
    {\bf this is bold}
    \par
    {\it this is italics}
    \stopblockquote
\stoptext

Best,
Sreeram


___________________________________________________________________________________
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: Odd Font Behavior in startstop Group
  2022-02-05 19:28 Odd Font Behavior in startstop Group Michael Urban via ntg-context
  2022-02-06  7:34 ` śrīrāma via ntg-context
@ 2022-02-06 10:20 ` Wolfgang Schuster via ntg-context
  2022-02-06 12:36   ` śrīrāma via ntg-context
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-02-06 10:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Michael Urban via ntg-context
  Cc: Wolfgang Schuster, Michael Urban

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

___________________________________________________________________________________
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: Odd Font Behavior in startstop Group
  2022-02-06 10:20 ` Wolfgang Schuster via ntg-context
@ 2022-02-06 12:36   ` śrīrāma via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: śrīrāma via ntg-context @ 2022-02-06 12:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Wolfgang Schuster
  Cc: śrīrāma, Michael Urban

On Sunday, February 6, 2022 3:50:21 PM IST Wolfgang Schuster via ntg-context 
wrote:
> 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.
> […]
> ConTeXt already provides a blockquote-environment which can be
> configured to have the same style as your custom environment.

Hi Wolfgang,

I have a related question:
I noticed that the font settings were wrong in the original MWE of Michael. I 
am also aware that ConTeXt has a blockquote env (having used it before). In 
fact, I first tested the following example before responding to Michael's 
question:

%%% SOF
    \usebodyfont[termes]
    \setupbodyfont[schola]
    \setupdelimitedtext
        [blockquote]
        [style={\switchtobodyfont[termes]}]

    \starttext
    main body font here
        \startblockquote
        \input knuth
        \stopblockquote
    {\bf test}\par
    {\it test}
        \startblockquote
        {\bf test}
        {\it test}
        \stopblockquote
    \stoptext
%%% EOF

In the above, if the first line '\usebodyfont[termes]' is removed, the second 
blockquote env renders in schola not termes. Moreover, on removing the first 
blockquote env with '\input knuth' the second one appears correctly in termes. 
Thus, regardless of other things, '\usebodyfont[termes]' seems to be necessary 
here. Is this correct or am I missing something?

Thanks,
śrīrāma (Sreeram)


___________________________________________________________________________________
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:[~2022-02-06 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05 19:28 Odd Font Behavior in startstop Group Michael Urban via ntg-context
2022-02-06  7:34 ` śrīrāma via ntg-context
2022-02-06 10:20 ` Wolfgang Schuster via ntg-context
2022-02-06 12:36   ` śrīrāma 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).