Re: [NTG-context] font features in math

2016-05-01 Thread Philipp Gesang
·

> When I compile this in context all number are oldstyle numbers:
> 
> \starttext
> 
> \font\test= {name:TeX-Gyre-Termes:+onum}
> \test 0123456789
> $\fam0 \textfont0=\test 0123456789$ 
> \stoptext
> 
> When I run a similar plaintex (or latex) example in texlive 2016
> with a new luaotfload then the text numbers are (as wanted) old
> style, but the numbers in math mode are lining numbers (the font is
> correct):
> 
> \input luaotfload.sty
> \font\test= {name:TeX-Gyre-Termes:+onum}
> \test 0123456789
> $\fam0 \textfont0=\test 0123456789$ 
> \bye
> 
> 
> So somehow in math the +onum is lost in plain and latex but not in
> context. What is context doing differently to avoid this?

mode=base

See the issue thread where you got the example from or the
Luaotfload manual.

Philipp



pgpCT9kJ2b60F.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] font features in math

2016-05-01 Thread Ulrike Fischer
Am Sun, 1 May 2016 11:45:02 +0200 schrieb Philipp Gesang:

>> So somehow in math the +onum is lost in plain and latex but not in
>> context. What is context doing differently to avoid this?
> 
> mode=base

If context attach mode=base to math, how does it it? How can you
switch a feature like mode=node to mode=base for every font in math?


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

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

Re: [NTG-context] font features in math

2016-05-01 Thread Hans Hagen

On 5/1/2016 12:53 PM, Ulrike Fischer wrote:

Am Sun, 1 May 2016 11:45:02 +0200 schrieb Philipp Gesang:


So somehow in math the +onum is lost in plain and latex but not in
context. What is context doing differently to avoid this?


mode=base


If context attach mode=base to math, how does it it? How can you
switch a feature like mode=node to mode=base for every font in math?


that has to be done in otfload i guess (context does it in the 
featureset applied to math fonts)


there is no node processing in math (when using base mode one ca apply 
some features like substitutions) that then gets passed to tex


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] font features in math

2016-05-02 Thread Philipp Gesang
·

> Am Sun, 1 May 2016 11:45:02 +0200 schrieb Philipp Gesang:
> 
> >> So somehow in math the +onum is lost in plain and latex but not in
> >> context. What is context doing differently to avoid this?
> > 
> > mode=base
> 
> If context attach mode=base to math, how does it it?

A one would do in Luaotfload: specify base mode when defining the
font. It’s unrelated to math, just the default set of features
that Luaotfload has been applying to every definition for ages.
The reasoning -- by Khaled and others -- was, that the Opentype
standard mandates some defaults so Luaotfload should follow suit.

The defaults can be overridden by setting the appropriate values
in luaotfload.conf(5).

>  How can you
> switch a feature like mode=node to mode=base for every font in math?

Define two fonts: one for use in math mode, another for where you
really, really require node mode.

Philipp



pgp5j7EyuLGpU.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] font features in math

2016-05-02 Thread jfbu

Le 2 mai 2016 à 18:47, Philipp Gesang  a écrit :

> ·
> 
>> Am Sun, 1 May 2016 11:45:02 +0200 schrieb Philipp Gesang:
>> 
 So somehow in math the +onum is lost in plain and latex but not in
 context. What is context doing differently to avoid this?
>>> 
>>>mode=base
>> 
>> If context attach mode=base to math, how does it it?
> 
> A one would do in Luaotfload: specify base mode when defining the
> font. It’s unrelated to math, just the default set of features
> that Luaotfload has been applying to every definition for ages.
> The reasoning -- by Khaled and others -- was, that the Opentype
> standard mandates some defaults so Luaotfload should follow suit.
> 
> The defaults can be overridden by setting the appropriate values
> in luaotfload.conf(5).
> 
>> How can you
>> switch a feature like mode=node to mode=base for every font in math?
> 
> Define two fonts: one for use in math mode, another for where you
> really, really require node mode.
> 
> Philipp


Ulrike, thanks a lot for keeping asking questions on this and Philipp
for answering.

I have figured experimentally that I could use (at least in some cases,
and after math fonts are initialized which in LaTeX seems to mean
one needs to enter math mode at least once before)

\font\fixmath=\fontname\textfont\foo mode=base;
\textfont\foo=\fixmath

for example creating this \fontname:

[Vollkorn-Regular]:mode=node;script=latn;language=DFLT;+tlig;+lnum;mode=base;

which is then experimentally observed to obey the second mode specifier
and thus does display lining figures in math mode.

Jean-François
___
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
___

Re: [NTG-context] font features in math

2016-05-02 Thread jfbu


> \font\fixmath=\fontname\textfont\foo mode=base;
> \textfont\foo=\fixmath

I will use a better approach as this one does not work
when the thing ends as "at 7.0pt" for example, but in principle
I see I can do surgery on the \fontname and replace there
mode=node if it exists with mode=base.

I only have to figure out the best time to do that
in a context (no pun intended) where people may change
"\mathversion" (latex thing).

Jean-François



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

Re: [NTG-context] font features in math

2016-05-02 Thread jfbu

Le 2 mai 2016 à 20:15, jfbu  a écrit :

> 
> 
>> \font\fixmath=\fontname\textfont\foo mode=base;
>> \textfont\foo=\fixmath
> 
> I will use a better approach as this one does not work
> when the thing ends as "at 7.0pt" for example, but in principle
> I see I can do surgery on the \fontname and replace there
> mode=node if it exists with mode=base.
> 
> I only have to figure out the best time to do that
> in a context (no pun intended) where people may change
> "\mathversion" (latex thing).
> 

\begingroup
\catcode`N 12
\catcode`O 12
\catcode`D 12
\catcode`E 12
\lowercase{\gdef\FixMathFont@i #1=NODE;#2\relax #3}%
  {\font\fixmath=#1=base;#2\relax\global#3\symmtoperatorfont=\fixmath}
\endgroup

\def\FixMathFont 
{\setbox0\hbox{\MTeverymathoff$\relax$%
 \expandafter\FixMathFont@i\fontname\textfont\symmtoperatorfont\relax\textfont
 
\expandafter\FixMathFont@i\fontname\scriptfont\symmtoperatorfont\relax\scriptfont
 
\expandafter\FixMathFont@i\fontname\scriptscriptfont\symmtoperatorfont\relax\scriptscriptfont}%
}

I only need to add the layer to do nothing if "=node" is not found, and 
we are allset.

Jean-François

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

Re: [NTG-context] font features in math

2016-05-02 Thread Ulrike Fischer
Am Mon, 2 May 2016 18:47:36 +0200 schrieb Philipp Gesang:

>> How can you switch a feature like mode=node to mode=base for
>> every font in math?

> Define two fonts: one for use in math mode, another for where you
> really, really require node mode.

That's easy if one can select the fonts explicitly, but the question
was triggered by the url package which internally switches to math. 

Also in the context example there aren't two font definitions:

\starttext

\font\test= {name:TeX-Gyre-Termes:+onum}
\test 0123456789
$\fam0 \textfont0=\test 0123456789$ 
\stoptext

Nevertheless "\test" seems to use mode=node outside math and
mode=base inside math and I would like to know where the code is
that does it.


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

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

Re: [NTG-context] font features in math

2016-05-03 Thread jfbu

Le 3 mai 2016 à 00:13, Ulrike Fischer  a écrit :

> That's easy if one can select the fonts explicitly, but the question
> was triggered by the url package which internally switches to math. 

I have posted a (seemingly partial) patch to this problem of \url at 
http://tex.stackexchange.com/questions/264206/cant-get-oldstyle-figures-in-url-with-lualatex/307585#307585
___
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
___

Re: [NTG-context] font features in math

2016-05-04 Thread Hans Hagen

On 5/3/2016 12:13 AM, Ulrike Fischer wrote:

Am Mon, 2 May 2016 18:47:36 +0200 schrieb Philipp Gesang:


How can you switch a feature like mode=node to mode=base for
every font in math?



Define two fonts: one for use in math mode, another for where you
really, really require node mode.


That's easy if one can select the fonts explicitly, but the question
was triggered by the url package which internally switches to math.

Also in the context example there aren't two font definitions:

\starttext

\font\test= {name:TeX-Gyre-Termes:+onum}
\test 0123456789
$\fam0 \textfont0=\test 0123456789$
\stoptext

Nevertheless "\test" seems to use mode=node outside math and
mode=base inside math and I would like to know where the code is
that does it.


in your font definition you use a low level xetex like specification so 
you bypass the normal feature definition mechanism which means that as 
you don't specify a mode, you get base mode which in turn means that the 
onum is applied to the font immediately and as you use the same font in 
math you get onum there too


{name:TeX-Gyre-Termes:+onum;mode=node}

gives you onum in text as a result of node mode processing but then the 
math is normal digits because the font is pass as-is


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] font features in math

2016-05-04 Thread Ulrike Fischer
Am Wed, 4 May 2016 09:53:14 +0200 schrieb Hans Hagen:

> as you don't specify a mode, you get base mode

Damn ;-). I didn't thought about this possibility. I assumed the
default mode would be like in luaotfload "node". Thanks for
correcting me. It is a relieve that I didn't find the font simply
because it isn't there ;-).

(Now I also understand Philipps remark ...)


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

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