Re: [NTG-context] Stixtwo spacing between upright integrals and lower limits

2017-10-04 Thread Hans Hagen

On 10/3/2017 9:40 PM, Mikael P. Sundqvist wrote:

Dear Hans (and others),

In the tex stackexchange chat today we were discussing the stix two 
fonts, and in particular the spacing between the integral sign and the 
lower bound. It is known that this was way to big before (see 
https://tex.stackexchange.com/q/327710/52406), but it seems that it is 
still too big, at least if one uses the upright version. Judge yourself 
from the example file at the end of this email (result attached).


well, normally i don't care too much about it as it's a font design 
property and a designers choice


I made a bug report (see 
https://sourceforge.net/p/stixfonts/tracking/95/) but Ulrike Fischer 
said that it could take time to get it fixed, and that you Hans made a 
fix for another bug (https://sourceforge.net/p/stixfonts/tracking/86/) 
in the fontloader.


Can you do that for this one as well?

During the discussion Harald Hanche-Olsen came up with the following 
"quick fix" for LuaLaTeX:


\usepackage{luatexbase,luacode}
\begin{luacode}
local patch_stixmath = function (fontdata)
  if fontdata.psname == "STIXTwoMath"
  then
   
fontdata.characters[983352]["italic"]=3*fontdata.characters[983352]["italic"]

  end
end
luatexbase.add_to_callback
  (
   "luaotfload.patch_font",
   patch_stixmath,
   "change_stixmath"
  )
\end{luacode}

I don't know if this is the way to go, but I thought I should include it.


no it's not the way to go (in context) but i cannot speak for latex


Best regards, Mikael

%%% TEST FILE %%%
\setupbodyfont[stixtwo]

\setupmathematics[
integral=nolimits,
]

\startTEXpage[offset=3bp]

With slanted integral:

\startformula
\int_0^\pi \sin x\,dx=2.
\stopformula

\setupmathematics[stylealternative={upright}]

With upright integral:

\startformula
\int_0^\pi \sin x\,dx=2.
\stopformula

\stopTEXpage


i'll add (hopefully robust) patch code to the goodie file

also, i noticed that there's more wrong with stix2 (i bet that that 
would not have happened if the font was made by the gyre folks as they 
have a bit more consistent workflow), so i added


% \enabletrackers[otf.preparing]
% \definefontfeature[mathextra][mathextra][fixitalics=true]

to the next beta, not enabled by default because one never knows what 
side effects occur


Hans








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




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Stixtwo spacing between upright integrals and lower limits

2017-10-03 Thread Mikael P. Sundqvist
Dear Hans (and others),

In the tex stackexchange chat today we were discussing the stix two fonts,
and in particular the spacing between the integral sign and the lower
bound. It is known that this was way to big before (see
https://tex.stackexchange.com/q/327710/52406), but it seems that it is
still too big, at least if one uses the upright version. Judge yourself
from the example file at the end of this email (result attached).

I made a bug report (see https://sourceforge.net/p/stixfonts/tracking/95/)
but Ulrike Fischer said that it could take time to get it fixed, and that
you Hans made a fix for another bug (
https://sourceforge.net/p/stixfonts/tracking/86/) in the fontloader.

Can you do that for this one as well?

During the discussion Harald Hanche-Olsen came up with the following "quick
fix" for LuaLaTeX:

\usepackage{luatexbase,luacode}
\begin{luacode}
local patch_stixmath = function (fontdata)
 if fontdata.psname == "STIXTwoMath"
 then

fontdata.characters[983352]["italic"]=3*fontdata.characters[983352]["italic"]
 end
end
luatexbase.add_to_callback
 (
  "luaotfload.patch_font",
  patch_stixmath,
  "change_stixmath"
 )
\end{luacode}

I don't know if this is the way to go, but I thought I should include it.

Best regards, Mikael

%%% TEST FILE %%%
\setupbodyfont[stixtwo]

\setupmathematics[
integral=nolimits,
]

\startTEXpage[offset=3bp]

With slanted integral:

\startformula
\int_0^\pi \sin x\,dx=2.
\stopformula

\setupmathematics[stylealternative={upright}]

With upright integral:

\startformula
\int_0^\pi \sin x\,dx=2.
\stopformula

\stopTEXpage


ctx-listexample39.pdf
Description: Adobe PDF document
___
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
___