ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LuaTeX has troubles with contextual kern
@ 2013-04-24  9:07 Georg Duffner
  2013-04-24 10:46 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Georg Duffner @ 2013-04-24  9:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Hi,

in EB Garamond I have some contextual lookups in the kern feature with 
which LuaTeX in context standalone (updated today in the morning) seems 
to have problems (the issue is not new, I’ve already reported it in 
january but perhaps that was a bit too confusing).

The test document is:

\definefontfeature[default][default][mode=base]
\definefontsynonym[ebg][file:EBGaramond12-Regular.otf]
\definefontfeature[ss20][ss20=yes]
\definefontfeature[iota1][cv81=1]
\definefontfeature[iota2][cv81=2]
\definefontfeature[altcirc][cv80=1]
\define\test{Tì αᾟα\par}
\starttext
\definedfont[ebg*default at 12pt]\test
\addfeature{ss20}\test
\addfeature{iota1}\test
\addfeature{iota2}\test
\addfeature{altcirc}\test
\stoptext

The font is at 
http://www.georgduffner.at/ebgaramond/fonts/EBGaramond12-Regular.otf

The corresponding lookups in the kern.fea roughly contain

     pos T' 145 i.dotless gravecomb;

which increases the right sidebearing of T by 145 before i.dotless 
followed by gravecomb

and

     pos Eta' <218 0 218 0> uni0345.cap @grk_tlAcc2;
     pos Eta' <218 0 418 0> uni0345.cap1 @grk_tlAcc2;
     pos Eta' <218 0 558 0> uni0345.cap2 @grk_tlAcc2;

where @grk_tlAcc2 contains the accents attached at the top left of the 
glyph and which means that Eta is positioned at 218 inside its bounding 
box and the bounding box is expanded by the third value between <>, on 
the condition that it’s followed by uni0345.cap* and the said accents.

ss20 does a full decomposition of all composed glyphs so I can replace 
any component by an alternate glyph. Their order corresponds to 
canonical decomposition.

Attached you find the pdf output and a pdf from a parallel xelatex test 
which shows the desired result:

\documentclass[12pt]{minimal}
\usepackage{fontspec}
\setmainfont{EB Garamond}
\newcommand{\test}{Tì αᾟα\par}
\begin{document}
\test
\addfontfeature{RawFeature=+ss20}\test
\addfontfeature{CharacterVariant=81:1}\test
\addfontfeature{CharacterVariant=81:2}\test
\addfontfeature{CharacterVariant=80}\test
\end{document}

Best regards,
Georg

[-- Attachment #2: contextual_kerning.pdf --]
[-- Type: application/pdf, Size: 7192 bytes --]

[-- Attachment #3: contextual_kerning_xtx.pdf --]
[-- Type: application/pdf, Size: 3392 bytes --]

[-- Attachment #4: 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: LuaTeX has troubles with contextual kern
  2013-04-24  9:07 LuaTeX has troubles with contextual kern Georg Duffner
@ 2013-04-24 10:46 ` Hans Hagen
  2013-04-25  6:08   ` Georg Duffner
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2013-04-24 10:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/24/2013 11:07 AM, Georg Duffner wrote:
> Hi,
>
> in EB Garamond I have some contextual lookups in the kern feature with
> which LuaTeX in context standalone (updated today in the morning) seems
> to have problems (the issue is not new, I’ve already reported it in
> january but perhaps that was a bit too confusing).
>
> The test document is:
>
> \definefontfeature[default][default][mode=base]

you want node mode, so mode=node

> \definefontsynonym[ebg][file:EBGaramond12-Regular.otf]
> \definefontfeature[ss20][ss20=yes]
> \definefontfeature[iota1][cv81=1]
> \definefontfeature[iota2][cv81=2]
> \definefontfeature[altcirc][cv80=1]
> \define\test{Tì αᾟα\par}
> \starttext
> \definedfont[ebg*default at 12pt]\test
> \addfeature{ss20}\test
> \addfeature{iota1}\test
> \addfeature{iota2}\test
> \addfeature{altcirc}\test
> \stoptext
>
> The font is at
> http://www.georgduffner.at/ebgaramond/fonts/EBGaramond12-Regular.otf
>
> The corresponding lookups in the kern.fea roughly contain
>
>      pos T' 145 i.dotless gravecomb;
>
> which increases the right sidebearing of T by 145 before i.dotless
> followed by gravecomb

maybe you also need to enable lfbd and rtbd?

> and
>
>      pos Eta' <218 0 218 0> uni0345.cap @grk_tlAcc2;
>      pos Eta' <218 0 418 0> uni0345.cap1 @grk_tlAcc2;
>      pos Eta' <218 0 558 0> uni0345.cap2 @grk_tlAcc2;
>
> where @grk_tlAcc2 contains the accents attached at the top left of the
> glyph and which means that Eta is positioned at 218 inside its bounding
> box and the bounding box is expanded by the third value between <>, on
> the condition that it’s followed by uni0345.cap* and the said accents.

ok, so that is effectively changing the advance width

> ss20 does a full decomposition of all composed glyphs so I can replace
> any component by an alternate glyph. Their order corresponds to
> canonical decomposition.
>
> Attached you find the pdf output and a pdf from a parallel xelatex test
> which shows the desired result:
>
> \documentclass[12pt]{minimal}
> \usepackage{fontspec}
> \setmainfont{EB Garamond}
> \newcommand{\test}{Tì αᾟα\par}
> \begin{document}
> \test
> \addfontfeature{RawFeature=+ss20}\test
> \addfontfeature{CharacterVariant=81:1}\test
> \addfontfeature{CharacterVariant=81:2}\test
> \addfontfeature{CharacterVariant=80}\test
> \end{document}

I don't know what \addfontfeature does in xetex (probably accumulative) 
but in context you can best use the \feature command: \feature[+][iota1] 
as \addfeature cum suis were somewhat experimental features related to 
oriental tex.

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: LuaTeX has troubles with contextual kern
  2013-04-24 10:46 ` Hans Hagen
@ 2013-04-25  6:08   ` Georg Duffner
  2013-04-25  9:24     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Georg Duffner @ 2013-04-25  6:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Am 2013-04-24 12:46, schrieb Hans Hagen:
> On 4/24/2013 11:07 AM, Georg Duffner wrote:
>> Hi,
>>
>> in EB Garamond I have some contextual lookups in the kern feature with
>> which LuaTeX in context standalone (updated today in the morning) seems
>> to have problems (the issue is not new, I’ve already reported it in
>> january but perhaps that was a bit too confusing).
>>
>> The test document is:
>>
>> \definefontfeature[default][default][mode=base]
>
> you want node mode, so mode=node

I'm sorry, I forgot to mention it, I’ve already tested with mode=node, 
the result is exactly the same.

>> \definefontsynonym[ebg][file:EBGaramond12-Regular.otf]
>> \definefontfeature[ss20][ss20=yes]
>> \definefontfeature[iota1][cv81=1]
>> \definefontfeature[iota2][cv81=2]
>> \definefontfeature[altcirc][cv80=1]
>> \define\test{Tì αᾟα\par}
>> \starttext
>> \definedfont[ebg*default at 12pt]\test
>> \addfeature{ss20}\test
>> \addfeature{iota1}\test
>> \addfeature{iota2}\test
>> \addfeature{altcirc}\test
>> \stoptext
>>
>> The font is at
>> http://www.georgduffner.at/ebgaramond/fonts/EBGaramond12-Regular.otf
>>
>> The corresponding lookups in the kern.fea roughly contain
>>
>>      pos T' 145 i.dotless gravecomb;
>>
>> which increases the right sidebearing of T by 145 before i.dotless
>> followed by gravecomb
>
> maybe you also need to enable lfbd and rtbd?

lfbd and rtbd don’t make sense here, they are meant to by activated by 
opbd and only should affect left and right line-ends. They are the 
Opentype equivalents to protrusion settings. This is about "simple" 
kerning in the text (btw, there are experimental lfbd and rtbd settings 
in the font). This example is a standard kerning lookup (cf. 
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#6.a 
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#6.h 
and http://glyphsapp.com/blog/contextual-kerning/ )

>> and
>>
>>      pos Eta' <218 0 218 0> uni0345.cap @grk_tlAcc2;
>>      pos Eta' <218 0 418 0> uni0345.cap1 @grk_tlAcc2;
>>      pos Eta' <218 0 558 0> uni0345.cap2 @grk_tlAcc2;
>>
>> where @grk_tlAcc2 contains the accents attached at the top left of the
>> glyph and which means that Eta is positioned at 218 inside its bounding
>> box and the bounding box is expanded by the third value between <>, on
>> the condition that it’s followed by uni0345.cap* and the said accents.
>
> ok, so that is effectively changing the advance width

Yes.

>> ss20 does a full decomposition of all composed glyphs so I can replace
>> any component by an alternate glyph. Their order corresponds to
>> canonical decomposition.
>>
>> Attached you find the pdf output and a pdf from a parallel xelatex test
>> which shows the desired result:
>>
>> \documentclass[12pt]{minimal}
>> \usepackage{fontspec}
>> \setmainfont{EB Garamond}
>> \newcommand{\test}{Tì αᾟα\par}
>> \begin{document}
>> \test
>> \addfontfeature{RawFeature=+ss20}\test
>> \addfontfeature{CharacterVariant=81:1}\test
>> \addfontfeature{CharacterVariant=81:2}\test
>> \addfontfeature{CharacterVariant=80}\test
>> \end{document}
>
> I don't know what \addfontfeature does in xetex (probably accumulative)
> but in context you can best use the \feature command: \feature[+][iota1]
> as \addfeature cum suis were somewhat experimental features related to
> oriental tex.

I’m a bit confused. As I don’t use context yet (this time I did for 
reporting a bug upon which I stumbled when using lualatex) I looked up 
the necessary commands in the newly presented "Fonts out of ConTeXt" 
where on p. 41 the commands \addfeature and \subtractfeature are used.

In xelatex, \addfontfeature is defined by the package fontspec and does 
indeed accumulate features (much like I thought, \addfeature does in 
context) but without the need to be defined in the preamble and without 
the advantage to define feature sets.

Best regards,
Georg
___________________________________________________________________________________
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: LuaTeX has troubles with contextual kern
  2013-04-25  6:08   ` Georg Duffner
@ 2013-04-25  9:24     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2013-04-25  9:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/25/2013 8:08 AM, Georg Duffner wrote:

>>> The font is at
>>> http://www.georgduffner.at/ebgaramond/fonts/EBGaramond12-Regular.otf
>>>
>>> The corresponding lookups in the kern.fea roughly contain
>>>
>>>      pos T' 145 i.dotless gravecomb;

I'll send you off list what I get here (latest version font as the 
version I had on my machine didn't have that kern defined + recent 
context). There is some interference with the ss feature in other cases.

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:[~2013-04-25  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-24  9:07 LuaTeX has troubles with contextual kern Georg Duffner
2013-04-24 10:46 ` Hans Hagen
2013-04-25  6:08   ` Georg Duffner
2013-04-25  9:24     ` 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).