Re: [NTG-context] GSUB LookupType 6 in fea file not working

2016-01-09 Thread Paolo Brasolin
That's really cool.
I ended up directly patching the font, but the patch itself would
probably be easier to produce with some scripting. I'll definitely
play around with your code.
Thanks Hans!

2016-01-07 13:43 GMT+01:00 Hans Hagen :
> On 1/6/2016 5:28 PM, Paolo Brasolin wrote:
>>
>> Hello.
>>
>> I am trying to add some custom ligatures to a font using a feature file.
>> Everything works just fine, until I try what is called a chained
>> contextual substitution, i.e. a GSUB lookup of type 6.
>> I am studying the specs from
>>
>> http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#5.f
>>
>> A simple example.fea that does not work for me is:
>>
>>
>> languagesystem dflt dflt;
>>
>> lookup FOOBAR {
>>sub B by Q ;
>> } FOOBAR;
>>
>> feature foba {
>>sub [A] B' lookup FOOBAR;
>> } foba ;
>>
>>
>> I'd expect it to replace B with Q only when preceeded by A.
>> The same rule expressed with a lookup of type 8 works just fine:
>>
>>
>> languagesystem dflt dflt;
>>
>> feature foba {
>>sub [A] B' by Q;
>> } foba ;
>>
>>
>> Ultimately I would need to use multiple inline lookups, something like
>>sub [A]' B' lookup FOO C' lookup BAR;
>>
>> Are inline lookups unsupported by the engine?
>> That would seem strange to me.
>> I'm probably missing some point, but I'm unable to find more
>> documentation.
>> Am I using the wrong syntax?
>
>
> As we have a way to define additional features in context i played a bit
> with contextual lookups. As a result we now have an additional type
> chainsubstitution. In due time I will document this better (once it's
> settled). I still need to think of a way to kick this into place at a
> specific location in the sequence.
>
> Btw, contrary to fea extensions (not supported in the new font loader
> anyway) these are runtime extensions i.e. not cached.
>
> I'll upload a beta.
>
> --
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "stest",
> type = "substitution",
> data = {
> a = "X",
> b = "P",
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "atest",
> type = "alternate",
> data = {
> a = { "X", "Y" },
> b = { "P", "Q" },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "mtest",
> type = "multiple",
> data = {
> a = { "X", "Y" },
> b = { "P", "Q" },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "ltest",
> type = "ligature",
> data = {
> ['1'] = { "a", "b" },
> ['2'] = { "d", "a" },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "ktest",
> type = "kern",
> data = {
> a = { b = -500 },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name= "ytest",
> type= "chainsubstitution",
>  -- flags   = { false, false, false, false },
> lookups = {
> {
> type = "substitution",
> data = {
> ["b"] = "B",
> ["c"] = "C",
> },
> },
> },
>  -- steps= {
>  -- {
>  -- rules = {
>  -- {
>  -- before  = { { "a" } },
>  -- current = { { "b", "c" } },
>  -- lookups = { 1 },
>  -- },
>  -- },
>  -- },
>  -- },
> data = {
> rules = {
> {
> before  = { { "a" } },
> current = { { "b", "c" } },
> lookups = { 1 },
>

[NTG-context] GSUB LookupType 6 in fea file not working

2016-01-06 Thread Paolo Brasolin
Hello.

I am trying to add some custom ligatures to a font using a feature file.
Everything works just fine, until I try what is called a chained
contextual substitution, i.e. a GSUB lookup of type 6.
I am studying the specs from
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#5.f

A simple example.fea that does not work for me is:


languagesystem dflt dflt;

lookup FOOBAR {
  sub B by Q ;
} FOOBAR;

feature foba {
  sub [A] B' lookup FOOBAR;
} foba ;


I'd expect it to replace B with Q only when preceeded by A.
The same rule expressed with a lookup of type 8 works just fine:


languagesystem dflt dflt;

feature foba {
  sub [A] B' by Q;
} foba ;


Ultimately I would need to use multiple inline lookups, something like
  sub [A]' B' lookup FOO C' lookup BAR;

Are inline lookups unsupported by the engine?
That would seem strange to me.
I'm probably missing some point, but I'm unable to find more documentation.
Am I using the wrong syntax?

Thanks to anyone who can shed some light.
___
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
___

[NTG-context] [Bug report] TikZ + makeup + grid = blank page

2016-01-04 Thread Paolo Brasolin
Hello.

Consider the following MWE:

\usemodule[tikz]
\setuplayout[grid=yes]
\starttext
\startstandardmakeup
Not nothing.
\stopstandardmakeup
\stoptext

The output consists of two pages, the first being an unexpected and
undesired blank.
Removal of either tikz, grid or makeup is sufficient to make the blank
disappear.
I am failing to see how these three interact.

My versions:
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)
ConTeXt  ver: 2015.05.18 12:26 MKIV current  fmt: 2015.10.28  int:
english/english

The bug is reproduced also at live.contextgarden.net too

Here is the related SE question:
http://tex.stackexchange.com/questions/284972/tikz-causes-blank-page-in-front-of-context-makeup-with-grid-layout

Can anyone explain the interaction or provide a workaround?

Thanks.

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