* \switchtobodyfont issue, also with newotf
@ 2015-08-20 18:34 Rik Kabel
2015-08-21 13:10 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Rik Kabel @ 2015-08-20 18:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2462 bytes --]
While working to get italic smallcaps in a secondary font face, I came
across an issue with \switchbodyfont. When this is used in a certain
way, the \tf font-style is changed, but not the \it, \bf, and so on.
The example below compiles cleanly as presented, and the problem is not
present. Each test line shows the expected font name and text.
When the Oops! line is uncommented, the only test line for the test font
that is correct is the \tf line. Other lines use the default font face
in the specified font styles, but the font features are a mix (note that
some are onum, some lining, and that long-s t ligatures are inconsistent).
When the newotf module is enabled, the example fails to compile without
errors, but produces similar results to non-newotf when the errors are
ignored.
This is not a problem with individual fonts—I have tried a variety of
fonts both as default and secondary and get the same result.
%\usemodule[newotf]
\setupwhitespace[medium]
\define\testAlphabet{\purefontname\font\quad
ABCDEFGHIJKLmnopqrsſtuvwxyz \& 012345789}
\starttypescript[Secondary]
\definetypeface[Secondary][rm][serif][ebgaramond][default]
% \definetypeface[Secondary][rm][serif][palatino][default]
% \definetypeface[Secondary][rm][serif][libertine][default]
\stoptypescript
\setupbodyfont [modern, 10pt]
%\setupbodyfont [palatino, 10pt]
\starttext
% {\switchtobodyfont[Secondary]Oops!\par}% Oops!
Default tf: {\tf \testAlphabet}\par
Default bf: {\bf \testAlphabet}\par
Default it: {\it \testAlphabet}\par
Default sl: {\sl \testAlphabet}\par
Default bi: {\bi \testAlphabet}\par
Default bs: {\bs \testAlphabet}\par
Default sc: {\sc \testAlphabet}\par
Default xx: {\it\setff{smallcaps}\testAlphabet}\par
\switchtobodyfont[Secondary]
Secondary tf: {\tf \testAlphabet}\par
Secondary bf: {\bf \testAlphabet}\par
Secondary it: {\it \testAlphabet}\par
Secondary sl: {\sl \testAlphabet}\par
Secondary bi: {\bi \testAlphabet}\par
Secondary bs: {\bs \testAlphabet}\par
Secondary sc: {\sc \testAlphabet}\par
Secondary xx: {\it\setff{smallcaps}\testAlphabet}\par
\stoptext
Have I failed to properly specify the secondary typeface? Do I need a
more complete typescript? Or is there a bug here?
--
Rik
[-- Attachment #1.2: Type: text/html, Size: 3587 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: \switchtobodyfont issue, also with newotf
2015-08-20 18:34 \switchtobodyfont issue, also with newotf Rik Kabel
@ 2015-08-21 13:10 ` Hans Hagen
2015-08-21 21:50 ` Rik Kabel
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2015-08-21 13:10 UTC (permalink / raw)
To: ntg-context
On 8/20/2015 8:34 PM, Rik Kabel wrote:
> While working to get italic smallcaps in a secondary font face, I came
> across an issue with \switchbodyfont. When this is used in a certain
> way, the \tf font-style is changed, but not the \it, \bf, and so on.
>
> The example below compiles cleanly as presented, and the problem is not
> present. Each test line shows the expected font name and text.
>
> When the Oops! line is uncommented, the only test line for the test font
> that is correct is the \tf line. Other lines use the default font face
> in the specified font styles, but the font features are a mix (note that
> some are onum, some lining, and that long-s t ligatures are inconsistent).
>
> When the newotf module is enabled, the example fails to compile without
> errors, but produces similar results to non-newotf when the errors are
> ignored.
>
> This is not a problem with individual fonts—I have tried a variety of
> fonts both as default and secondary and get the same result.
>
> %\usemodule[newotf]
> \setupwhitespace[medium]
> \define\testAlphabet{\purefontname\font\quad
> ABCDEFGHIJKLmnopqrsſtuvwxyz \& 012345789}
> \starttypescript[Secondary]
> \definetypeface[Secondary][rm][serif][ebgaramond][default]
> % \definetypeface[Secondary][rm][serif][palatino][default]
> % \definetypeface[Secondary][rm][serif][libertine][default]
> \stoptypescript
> \setupbodyfont [modern, 10pt]
> %\setupbodyfont [palatino, 10pt]
> \starttext
> % {\switchtobodyfont[Secondary]Oops!\par}% Oops!
> Default tf: {\tf \testAlphabet}\par
> Default bf: {\bf \testAlphabet}\par
> Default it: {\it \testAlphabet}\par
> Default sl: {\sl \testAlphabet}\par
> Default bi: {\bi \testAlphabet}\par
> Default bs: {\bs \testAlphabet}\par
> Default sc: {\sc \testAlphabet}\par
> Default xx: {\it\setff{smallcaps}\testAlphabet}\par
> \switchtobodyfont[Secondary]
> Secondary tf: {\tf \testAlphabet}\par
> Secondary bf: {\bf \testAlphabet}\par
> Secondary it: {\it \testAlphabet}\par
> Secondary sl: {\sl \testAlphabet}\par
> Secondary bi: {\bi \testAlphabet}\par
> Secondary bs: {\bs \testAlphabet}\par
> Secondary sc: {\sc \testAlphabet}\par
> Secondary xx: {\it\setff{smallcaps}\testAlphabet}\par
> \stoptext
>
> Have I failed to properly specify the secondary typeface? Do I need a
mostly changed names of the fonts, a missing directive (i'll add a
fallback for that) and such ... patched in the next beta
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: \switchtobodyfont issue, also with newotf
2015-08-21 13:10 ` Hans Hagen
@ 2015-08-21 21:50 ` Rik Kabel
2015-08-22 9:01 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Rik Kabel @ 2015-08-21 21:50 UTC (permalink / raw)
To: ntg-context
On 2015-08-21 09:10, Hans Hagen wrote:
> mostly changed names of the fonts, a missing directive (i'll add a
> fallback for that) and such ... patched in the next beta
>
Hans,
This morning's release fixed the newotf module problem, but not the font
face problem. Was that to be expected?
--
Rik
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: \switchtobodyfont issue, also with newotf
2015-08-21 21:50 ` Rik Kabel
@ 2015-08-22 9:01 ` Hans Hagen
0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2015-08-22 9:01 UTC (permalink / raw)
To: ntg-context
On 8/21/2015 11:50 PM, Rik Kabel wrote:
> On 2015-08-21 09:10, Hans Hagen wrote:
>> mostly changed names of the fonts, a missing directive (i'll add a
>> fallback for that) and such ... patched in the next beta
>>
> Hans,
>
> This morning's release fixed the newotf module problem, but not the font
> face problem. Was that to be expected?
The font switching mechanism is quite optimized (for performance) and
makes some assumptions about namespaces. When you define a font,
normally each call will check the definition i.e. be dynamic, but a
bodyfont assumes a more frozen use.
Specially with in-document typescripts that can have side effects. In
your case, just say
\setupbodyfont [Secondary,10pt]
before the modern one, as it will then define Secondary in its own
namespace and also not have a local/global mix side effects that comes
from a first call to a bodyfont switch inside a group. Such a global
initialization also has the effect of more efficient definitions of
related bodyfont environments.
It's also good to add a math font definition:
\starttypescript[Secondary]
\definetypeface[Secondary][rm][serif][ebgaramond][default]
\definetypeface[Secondary][mm][math][modern][default]
as some symbols might come from math.
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-22 9:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 18:34 \switchtobodyfont issue, also with newotf Rik Kabel
2015-08-21 13:10 ` Hans Hagen
2015-08-21 21:50 ` Rik Kabel
2015-08-22 9:01 ` Hans Hagen
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).