ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Incorrect math kerning
@ 2016-05-30  3:50 Aditya Mahajan
  2016-05-30  7:35 ` Hans Hagen
  2016-05-30 17:08 ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: Aditya Mahajan @ 2016-05-30  3:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

This is based on a question about latex on tex.stackexchange:
http://tex.stackexchange.com/q/312098/323

but context shows the same behaviour.

The subscript "i" in the following example is kerned incorrectly (it is 
too far away from W). Is this a bug in the font, or with the fontloader?

\setupbodyfont[cambria]

\starttext

\startTEXpage[offset=2mm]
$W_i^i$
\stopTEXpage

\stoptext

Thanks,
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Incorrect math kerning
  2016-05-30  3:50 Incorrect math kerning Aditya Mahajan
@ 2016-05-30  7:35 ` Hans Hagen
  2016-05-30 14:56   ` Ulrike Fischer
  2016-05-30 17:08 ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2016-05-30  7:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5/30/2016 5:50 AM, Aditya Mahajan wrote:
> Hi,
>
> This is based on a question about latex on tex.stackexchange:
> http://tex.stackexchange.com/q/312098/323
>
> but context shows the same behaviour.
>
> The subscript "i" in the following example is kerned incorrectly (it is
> too far away from W). Is this a bug in the font, or with the fontloader?
>
> \setupbodyfont[cambria]
>
> \starttext
>
> \startTEXpage[offset=2mm]
> $W_i^i$
> \stopTEXpage
>
> \stoptext

In traditional TeX fonts italic correction is used as a kind of kerning. 
This happens in combination with cheating with the width of glyphs. This 
is somewhat reflected in the lm fonts (with some inconsistencies between 
for instance V and W ... we're currently discussing this). So, a way to 
force a subscript towards the shape is to use less width, and then use 
italic correction to move the superscript the other way. Of course this 
kind of kerning is a bit of a cheat and not related to italic shape 
(some upright characters also have italic corrections).

In cambria staircase kerns are used for this but they are not defined 
for all (base) characters. The gyre fonts don't cheat on the width.

\starttext

\startTEXpage[offset=2mm]
     \startcombination[2*2]
         {\hbox to 40pt{\hss\showboxes\switchtobodyfont 
[modern]$W_i^i$\hss}} {\infofont modern}
         {\hbox to 40pt{\hss\showboxes\switchtobodyfont 
[cambria]$W_i^i$\hss}} {\infofont cambria}
         {\hbox to 
40pt{\hss\showboxes\switchtobodyfont[lucidaot]$W_i^i$\hss}} {\infofont 
lucida}
         {\hbox to 40pt{\hss\showboxes\switchtobodyfont 
[pagella]$W_i^i$\hss}} {\infofont pagella}
     \stopcombination
\stopTEXpage

\stoptext

Once the math fonts are stable and frozen I'll come up with a solution 
(in ConTeXt) for this. Luatex < 0.85 had a mixed code path for dealing 
with italics (adding them always and removing them selectively) but as 
the standard is not more explicit about where to apply italic correction 
these code paths have been separated.

In ConTeXt we had some italic correction juggling (basically i disabled 
passing them to the engine and applied them selectively) but because lm 
/ rest of ot is not consistent it never was satisfying.

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Incorrect math kerning
  2016-05-30  7:35 ` Hans Hagen
@ 2016-05-30 14:56   ` Ulrike Fischer
  2016-05-30 16:01     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrike Fischer @ 2016-05-30 14:56 UTC (permalink / raw)
  To: ntg-context

Am Mon, 30 May 2016 09:35:25 +0200 schrieb Hans Hagen:

> In cambria staircase kerns are used for this but they are not defined 
> for all (base) characters.

Are this these values:

   ["math"]={
    ["kerns"]={
     ["bottomright"]=36,
     ["topright"]=17,
    },
   },


? If yes, how could one change them to check if other values gives a
better result?


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Incorrect math kerning
  2016-05-30 14:56   ` Ulrike Fischer
@ 2016-05-30 16:01     ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2016-05-30 16:01 UTC (permalink / raw)
  To: news3, mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]

On 5/30/2016 4:56 PM, Ulrike Fischer wrote:
> Am Mon, 30 May 2016 09:35:25 +0200 schrieb Hans Hagen:
>
>> In cambria staircase kerns are used for this but they are not defined
>> for all (base) characters.
>
> Are this these values:
>
>    ["math"]={
>     ["kerns"]={
>      ["bottomright"]=36,
>      ["topright"]=17,
>     },
>    },
>
>
> ? If yes, how could one change them to check if other values gives a
> better result?

I looked into it a bit and found a few issues.

(1) i forgot to adapt the scaler to the new fontloader so i fixed that 
(no beta yet)

(2) the old (ff) loader makes up some values which is probably a side 
effect of the at that time missing spec; it's harmless and ok but 
results in different tables between old and new loader

(3) you're right about the spot to patch or add but keep in mind that 
you look at the packed font table, so in the end you end up with something:

         kerns = {
             [0x1D449] = { bottomright = { { kern = -200 } } }, -- it V
             [0x1D44A] = { bottomright = { { kern = -100 } } }, -- it W
         }

the amount of kerning is subjected to personal preferences e.g. lucida 
has way less bottom kerning than cambria for instance

attached a sample for italic V and W

- native lucida ot kerning
- native cambria kerning
- specified for other fonts

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

[-- Attachment #2: cutins.pdf --]
[-- Type: application/x-pdf, Size: 73164 bytes --]

[-- Attachment #3: 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] 5+ messages in thread

* Re: Incorrect math kerning
  2016-05-30  3:50 Incorrect math kerning Aditya Mahajan
  2016-05-30  7:35 ` Hans Hagen
@ 2016-05-30 17:08 ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2016-05-30 17:08 UTC (permalink / raw)
  To: ntg-context

Hi Aditya,

> This is based on a question about latex on tex.stackexchange:
> http://tex.stackexchange.com/q/312098/323
>
> but context shows the same behaviour.
>
> The subscript "i" in the following example is kerned incorrectly (it is
> too far away from W). Is this a bug in the font, or with the fontloader?
>
> \setupbodyfont[cambria]
>
> \starttext
>
> \startTEXpage[offset=2mm]
> $W_i^i$
> \stopTEXpage
>
> \stoptext

The next beta fixes the scaler but of course that leaves fonts untouched.

However, as a test I added some more lfg files that implement the V and 
W cutins for some fonts. Beware: the lm / gyre fonts are in the process 
of being updated which means that kerning will change (and therefore 
also the rendering) later this year. After that we can still decide to 
ship variants. For now it's directive driven.

\enabledirectives[fontgoodies.mathkerning]

\startTEXpage[offset=2mm]
     \startcombination[4*2]
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont  [modern]$V_i^i 
= W_i^i$\hss}} {\infofont modern}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont [cambria]$V_i^i 
= W_i^i$\hss}} {\infofont cambria}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont[lucidaot]$V_i^i 
= W_i^i$\hss}} {\infofont lucida}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont  [dejavu]$V_i^i 
= W_i^i$\hss}} {\infofont dejavu}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont [pagella]$V_i^i 
= W_i^i$\hss}} {\infofont pagella}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont  [termes]$V_i^i 
= W_i^i$\hss}} {\infofont termes}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont   [bonum]$V_i^i 
= W_i^i$\hss}} {\infofont bonum}
         {\hbox to 50pt{\hss\showboxes\switchtobodyfont  [schola]$V_i^i 
= W_i^i$\hss}} {\infofont schola}
     \stopcombination
\stopTEXpage

A bit of a playground for deciding om where to draw the limit.

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-30 17:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-30  3:50 Incorrect math kerning Aditya Mahajan
2016-05-30  7:35 ` Hans Hagen
2016-05-30 14:56   ` Ulrike Fischer
2016-05-30 16:01     ` Hans Hagen
2016-05-30 17:08 ` 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).