[NTG-context] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Aditya Mahajan

Hi,

Using * in superscripts gives wrong glyph size and spacing.

For example, with LM math everyhing looks fine:

\starttext
$x^*$ vs $x^{\ast}$
\stoptext

With Cambria, the result is OK (but you can still see the differences in 
the spacing of * in x^*)


\usemodule[simplefonts]
\setmathfont[Cambria]
\starttext
$x^*$ vs $x^{\ast}$
\stoptext

With Neo Euler, $x^*$ look really bad.

\usemodule[simplefonts]
\setmathfont[Cambria]
\starttext
$x^*$ vs $x^{\ast}$
\stoptext

I cannot figure out why this is happening. It definitely looks like a bug 
at the context end rather than a bug with the fonts.


Aditya

___
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] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Otared Kavian
Hi Aditya,

I tried your code: as you say with LM there is no problem, but with the 
simplefonts module nothing i stypeset since I get an error message:

 
   \3>simplefonts:1-12pt-mm-mr--3 
\font_helpers_preset_math_family_indeed ...csname 
  \scriptfont #1\csname \??f...
\font_helpers_set_math_family ...amily_indeed #1#2
  \else \font_helpers_set_ma...
\font_helpers_bidirectional_mathstrategy_nop ...r 
  \textfont \c_font_fam_mr_r...
 ...bidirectional_mathstrategy_nop 
  \fi \font_helpers_apply_co...
\font_helpers_synchronize_math ...math_strategies 
  \fi 
...

This is with ConTeXt  ver: 2012.02.21 00:51 MKIV.

Best regards: OK

On 22 févr. 2012, at 20:52, Aditya Mahajan wrote:

> Hi,
> 
> Using * in superscripts gives wrong glyph size and spacing.
> 
> For example, with LM math everyhing looks fine:
> 
> \starttext
> $x^*$ vs $x^{\ast}$
> \stoptext
> 
> With Cambria, the result is OK (but you can still see the differences in the 
> spacing of * in x^*)
> 
> \usemodule[simplefonts]
> \setmathfont[Cambria]
> \starttext
> $x^*$ vs $x^{\ast}$
> \stoptext
> 
> With Neo Euler, $x^*$ look really bad.
> 
> \usemodule[simplefonts]
> \setmathfont[Cambria]
> \starttext
> $x^*$ vs $x^{\ast}$
> \stoptext
> 
> I cannot figure out why this is happening. It definitely looks like a bug at 
> the context end rather than a bug with the fonts.
> 
> Aditya
> 
> ___
> 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
> ___

___
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] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Wolfgang Schuster

Am 22.02.2012 um 21:31 schrieb Otared Kavian:

> Hi Aditya,
> 
> I tried your code: as you say with LM there is no problem, but with the 
> simplefonts module nothing i stypeset since I get an error message:

Do you have Cambria?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Otared Kavian
Yes, I have it in
/Library/Fonts/Microsoft/Cambria.ttf
Maybe is it the wrong version?
In my test files I have other instances where Cambria is used and correctly 
typeset, but with the new versions they don't typeset anymore.

Best regards: OK

On 22 févr. 2012, at 21:47, Wolfgang Schuster wrote:

> 
> Am 22.02.2012 um 21:31 schrieb Otared Kavian:
> 
>> Hi Aditya,
>> 
>> I tried your code: as you say with LM there is no problem, but with the 
>> simplefonts module nothing i stypeset since I get an error message:
> 
> Do you have Cambria?
> 
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___

___
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] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Wolfgang Schuster

Am 22.02.2012 um 22:28 schrieb Otared Kavian:

> Yes, I have it in
>   /Library/Fonts/Microsoft/Cambria.ttf
> Maybe is it the wrong version?

For math you need “Cambria Math.ttf” or “Cambria.ttc”.

> In my test files I have other instances where Cambria is used and correctly 
> typeset, but with the new versions they don't typeset anymore.


Cambria works for me:

\usemodule[simplefonts]

\setmainfont[Cambria]
\setmathfont[Cambria]

\starttext

\input knuth

\startformula
1 + 1 = 2
\stopformula

\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Khaled Hosny
On Wed, Feb 22, 2012 at 02:52:22PM -0500, Aditya Mahajan wrote:
> Hi,
> 
> Using * in superscripts gives wrong glyph size and spacing.
> 
> For example, with LM math everyhing looks fine:
> 
> \starttext
> $x^*$ vs $x^{\ast}$
> \stoptext

For me this is typeset using LM Type1 fonts, not the OpenType LM math
font which explains why both are correct, after adding
\setupbodyfont[modern] the first * is raised than the other but still
readable.

> With Cambria, the result is OK (but you can still see the
> differences in the spacing of * in x^*)
> 
> \usemodule[simplefonts]
> \setmathfont[Cambria]
> \starttext
> $x^*$ vs $x^{\ast}$
> \stoptext
> 
> With Neo Euler, $x^*$ look really bad.
> 
> \usemodule[simplefonts]
> \setmathfont[Cambria]
> \starttext
> $x^*$ vs $x^{\ast}$
> \stoptext
> 
> I cannot figure out why this is happening. It definitely looks like
> a bug at the context end rather than a bug with the fonts.

It seems that * in math mode should map to U+2217 (which is what \ast
maps to) and not the ASCII asterisk.

Regards,
 Khaled
___
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] Incorrect rendering of * with UTF math fonts

2012-02-22 Thread Aditya Mahajan

On Wed, 22 Feb 2012, Khaled Hosny wrote:


On Wed, Feb 22, 2012 at 02:52:22PM -0500, Aditya Mahajan wrote:

Hi,

Using * in superscripts gives wrong glyph size and spacing.

For example, with LM math everyhing looks fine:

\starttext
$x^*$ vs $x^{\ast}$
\stoptext


For me this is typeset using LM Type1 fonts, not the OpenType LM math
font which explains why both are correct, after adding
\setupbodyfont[modern] the first * is raised than the other but still
readable.


With Cambria, the result is OK (but you can still see the
differences in the spacing of * in x^*)

\usemodule[simplefonts]
\setmathfont[Cambria]
\starttext
$x^*$ vs $x^{\ast}$
\stoptext

With Neo Euler, $x^*$ look really bad.

\usemodule[simplefonts]
\setmathfont[Cambria]
\starttext
$x^*$ vs $x^{\ast}$
\stoptext

I cannot figure out why this is happening. It definitely looks like
a bug at the context end rather than a bug with the fonts.


It seems that * in math mode should map to U+2217 (which is what \ast
maps to) and not the ASCII asterisk.


Indeed. Making this change gives the correct result.

@Hans, can you make the following change in char-def.lua

--- char-def.old2012-02-22 17:18:05.0 -0500
+++ char-def.lua2012-02-22 17:19:06.0 -0500
@@ -382,8 +382,7 @@
   description="ASTERISK",
   direction="on",
   linebreak="al",
-  mathclass="binary",
-  mathname="ast",
+  mathsymbol=0x2217,
   unicodeslot=0x002A,
  },
  {

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