ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* font-ocl.lua:76: attempt to call a nil value (field 'register')
@ 2018-11-21 12:01 Ulrike Fischer
  2018-11-21 12:37 ` Ulrike Fischer
  0 siblings, 1 reply; 13+ messages in thread
From: Ulrike Fischer @ 2018-11-21 12:01 UTC (permalink / raw)
  To: ntg-context

I tried to register a demo colorpalette:

\starttext
\directlua{fonts.handlers.otf.registerpalette("demo", {
{ g=1 }, %accents
{ b=1 }, %06dd
{ r=0.5, g=0.5, b=0.5 }, %unused?
{ g = 0.5, b=0, r=1 },
}
)}

blub
\stoptext


and got the error 

font-ocl.lua:76: attempt to call a nil value (field 'register')


(I wanted to test the coloring of
https://github.com/alif-type/amiri/blob/master/AmiriQuranColored.ttf, 
Khaled wrote that "is that [the code] uses the last palette color
for layers using paletteIndex 0xFFFF (special value that means use
text color)." and that 

local default       = colorvalues[#colorvalues] 

font-ocl.lua is faulty)

-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-21 12:01 font-ocl.lua:76: attempt to call a nil value (field 'register') Ulrike Fischer
@ 2018-11-21 12:37 ` Ulrike Fischer
  2018-11-21 17:46   ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Ulrike Fischer @ 2018-11-21 12:37 UTC (permalink / raw)
  To: ntg-context

Am Wed, 21 Nov 2018 13:01:47 +0100 schrieb Ulrike Fischer:

 
> Khaled wrote that "is that [the code] uses the last palette color

A bit too much deleted. It should say "it is a bug that ..." 

-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-21 12:37 ` Ulrike Fischer
@ 2018-11-21 17:46   ` Hans Hagen
  2018-11-21 18:04     ` Ulrike Fischer
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2018-11-21 17:46 UTC (permalink / raw)
  To: news3, mailing list for ConTeXt users

On 11/21/2018 1:37 PM, Ulrike Fischer wrote:
> Am Wed, 21 Nov 2018 13:01:47 +0100 schrieb Ulrike Fischer:
> 
>   
>> Khaled wrote that "is that [the code] uses the last palette color
> 
> A bit too much deleted. It should say "it is a bug that ..."
in context use the context interface (which uses a different 
implementation of the function you call)

\starttext

\definefontfeature[seguiemj-cl][default][colr=yes,ccmp=yes,dist=yes]

\definefontsynonym[emoji][seguiemj*seguiemj-cl]

\definecolor[emoji-red] [r=.4]
\definecolor[emoji-gray][s=1,t=.5,a=1]

\definefontcolorpalette [emoji-r] [emoji-red,emoji-gray]

\definefontfeature[seguiemj-r][ccmp=yes,dist=yes,colr=emoji-r]

\definefont[MyEmojiR][seguiemj*seguiemj-r @ 100pt]

\startTEXpage[offset=10pt]
    \MyEmojiR\resolvedemoji{triangular ruler}
\stopTEXpage

\stoptext

I'm not sure what yoy mwan with 0xFFFF as that's intercepted .. the 
choice for the last color as default is just that, a choice, could be 
the first one or none (or configureable if needed)

Hans


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

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-21 17:46   ` Hans Hagen
@ 2018-11-21 18:04     ` Ulrike Fischer
  2018-11-21 19:37       ` luigi scarso
  0 siblings, 1 reply; 13+ messages in thread
From: Ulrike Fischer @ 2018-11-21 18:04 UTC (permalink / raw)
  To: ntg-context

Am Wed, 21 Nov 2018 18:46:44 +0100 schrieb Hans Hagen:

> I'm not sure what yoy mwan with 0xFFFF as that's intercepted

With this example (font from
https://github.com/alif-type/amiri/blob/master/AmiriQuranColored.ttf)

a part of the glyphs are in blue. Khaled claims that this is wrong,
that the blue should be black, and the output look like this 
https://i.stack.imgur.com/gpoO7.jpg

(sorry about the ^^, it is a translation from a plain example):

\starttext
\definefontfeature[quran][script=arab,colr=yes]
\definefont[quran][AmiriQuranColored*quran @ 20pt]


\catcode`\^=7
\pardir TRT\textdir TRT
\quran
\baselineskip=2.6em
\parindent=0pt
\leftskip=0pt plus 1fil
\rightskip=0pt plus -1fil
\parfillskip=0pt plus 2fil
\def\aya#1{{\textdir TLT ^^^^06dd#1}}
^^^^fdfd~\aya{١}\par
ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ
ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ
وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ
ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ
غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par
\stoptext


-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-21 18:04     ` Ulrike Fischer
@ 2018-11-21 19:37       ` luigi scarso
  2018-11-21 20:04         ` Ulrike Fischer
  0 siblings, 1 reply; 13+ messages in thread
From: luigi scarso @ 2018-11-21 19:37 UTC (permalink / raw)
  To: Ulrike Fischer, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1924 bytes --]

On Wed, Nov 21, 2018 at 7:04 PM Ulrike Fischer <news3@nililand.de> wrote:

> Am Wed, 21 Nov 2018 18:46:44 +0100 schrieb Hans Hagen:
>
> > I'm not sure what yoy mwan with 0xFFFF as that's intercepted
>
> With this example (font from
> https://github.com/alif-type/amiri/blob/master/AmiriQuranColored.ttf)
>
> a part of the glyphs are in blue. Khaled claims that this is wrong,
> that the blue should be black, and the output look like this
> https://i.stack.imgur.com/gpoO7.jpg
>
> (sorry about the ^^, it is a translation from a plain example):
>
> \starttext
> \definefontfeature[quran][script=arab,colr=yes]
> \definefont[quran][AmiriQuranColored*quran @ 20pt]
>
>
> \catcode`\^=7
> \pardir TRT\textdir TRT
> \quran
> \baselineskip=2.6em
> \parindent=0pt
> \leftskip=0pt plus 1fil
> \rightskip=0pt plus -1fil
> \parfillskip=0pt plus 2fil
> \def\aya#1{{\textdir TLT ^^^^06dd#1}}
> ^^^^fdfd~\aya{١}\par
> ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ
> ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ
> وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ
> ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ
> غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par
> \stoptext
>


\definefontfeature[quran][mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
       ccmp=yes,locl=yes,calt=yes,
       liga=yes,clig=yes,dlig=yes,rlig=yes,
       mark=yes,mkmk=yes,kern=yes,curs=yes,
  colr=yes]
\definefont[quran][AmiriQuranColored*quran @ 18pt]

I have just copied-and- pasted an example around, but
at least the "black-and-white" typography match.


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2723 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-21 19:37       ` luigi scarso
@ 2018-11-21 20:04         ` Ulrike Fischer
  2018-11-22 12:50           ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Ulrike Fischer @ 2018-11-21 20:04 UTC (permalink / raw)
  To: ntg-context

Am Wed, 21 Nov 2018 20:37:29 +0100 schrieb luigi scarso:


> \definefontfeature[quran][mode=node,language=dflt,script=arab,
> init=yes,medi=yes,fina=yes,isol=yes,
>        ccmp=yes,locl=yes,calt=yes,
>        liga=yes,clig=yes,dlig=yes,rlig=yes,
>        mark=yes,mkmk=yes,kern=yes,curs=yes,
>   colr=yes]
> \definefont[quran][AmiriQuranColored*quran @ 18pt]
> 
> I have just copied-and- pasted an example around, but
> at least the "black-and-white" typography match.

When I use this definitions I still get partly blue glyphs with this
preamble. Don't you get them? 

-- 
Ulrike Fischer 
https://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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-21 20:04         ` Ulrike Fischer
@ 2018-11-22 12:50           ` Hans Hagen
  2018-11-22 13:12             ` Ulrike Fischer
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2018-11-22 12:50 UTC (permalink / raw)
  To: news3, mailing list for ConTeXt users

On 11/21/2018 9:04 PM, Ulrike Fischer wrote:
> Am Wed, 21 Nov 2018 20:37:29 +0100 schrieb luigi scarso:
> 
> 
>> \definefontfeature[quran][mode=node,language=dflt,script=arab,
>> init=yes,medi=yes,fina=yes,isol=yes,
>>         ccmp=yes,locl=yes,calt=yes,
>>         liga=yes,clig=yes,dlig=yes,rlig=yes,
>>         mark=yes,mkmk=yes,kern=yes,curs=yes,
>>    colr=yes]
>> \definefont[quran][AmiriQuranColored*quran @ 18pt]
>>
>> I have just copied-and- pasted an example around, but
>> at least the "black-and-white" typography match.
> 
> When I use this definitions I still get partly blue glyphs with this
> preamble. Don't you get them?
well, i don't know what to expect ... anyway:

\definefontfeature[quran][arabic][script=arab,colr=yes]

helps to get better arabic, also use \righttoleft instead of the dir 
commands; the ^^ can be avoided with \Uchar"FDFD

in font-ocl you can change this

             local default       = false -- colorvalues[#colorvalues] -- 
or 1 or ... maybe make it an option

so, no default (i used the default as in emoji it was better that way 
and those were the only fonts i had) .. when i have time i'll make it an 
option

Hans






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

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-22 12:50           ` Hans Hagen
@ 2018-11-22 13:12             ` Ulrike Fischer
  2018-11-22 13:46               ` luigi scarso
  2018-11-22 14:09               ` Hans Hagen
  0 siblings, 2 replies; 13+ messages in thread
From: Ulrike Fischer @ 2018-11-22 13:12 UTC (permalink / raw)
  To: ntg-context

Am Thu, 22 Nov 2018 13:50:08 +0100 schrieb Hans Hagen:

>> When I use this definitions I still get partly blue glyphs with this
>> preamble. Don't you get them?

> well, i don't know what to expect 

Khaled mentioned this link which shows how (harfbuzz-based) browsers
like firefox interpret the font 
https://www.amirifont.org/fatiha-colored.html

Also the spec
https://docs.microsoft.com/en-us/typography/opentype/spec/colr#layer-record
says

====
A palette entry index value of 0xFFFF is a special case indicating
that the text foreground color (defined by a higher-level client)
should be used and shall not be treated as actual index into CPAL
ColorRecord array.
====


-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-22 13:12             ` Ulrike Fischer
@ 2018-11-22 13:46               ` luigi scarso
  2018-11-22 15:14                 ` Ulrike Fischer
  2018-11-22 14:09               ` Hans Hagen
  1 sibling, 1 reply; 13+ messages in thread
From: luigi scarso @ 2018-11-22 13:46 UTC (permalink / raw)
  To: Ulrike Fischer, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1710 bytes --]

On Thu, Nov 22, 2018 at 2:13 PM Ulrike Fischer <news3@nililand.de> wrote:

> Am Thu, 22 Nov 2018 13:50:08 +0100 schrieb Hans Hagen:
>
> >> When I use this definitions I still get partly blue glyphs with this
> >> preamble. Don't you get them?
>
> > well, i don't know what to expect
>
> Khaled mentioned this link which shows how (harfbuzz-based) browsers
> like firefox interpret the font
> https://www.amirifont.org/fatiha-colored.html
>
> Also the spec
> https://docs.microsoft.com/en-us/typography/opentype/spec/colr#layer-record
> says
>
> ====
> A palette entry index value of 0xFFFF is a special case indicating
> that the text foreground color (defined by a higher-level client)
> should be used and shall not be treated as actual index into CPAL
> ColorRecord array.
> ====
>
>
sure, in font-dsp.lua
 2953         -- The special value 0xFFFF is foreground (but we index from
1). It
   2954         -- more looks like indices into a palette so 'class' is a
better name
   2955         -- than 'palette'.

" the text foreground color (defined by a higher-level client) should be
used"
doesn't mean   "you  MUST take the current color text" or even "you MUST
use black"
In fact "defined by a higher-level client" means
that  I could define  a palette  such  that each glyph marked with 0xFFFF
has its own color based on my palette ---  not necessarily the *same* color.
(this is the meaning  in font-ocl.lua of
 247             local default       = colorvalues[#colorvalues] -- or 1 or
... maybe make it an option
)
So..in this situation  black makes sense as blue -- I guess that 0xFFFF  is
mapped as "cuirrent text color" in harfbuzz-browsers,
so, sure,  it has a bit  more functionality.


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2799 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-22 13:12             ` Ulrike Fischer
  2018-11-22 13:46               ` luigi scarso
@ 2018-11-22 14:09               ` Hans Hagen
  1 sibling, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2018-11-22 14:09 UTC (permalink / raw)
  To: news3, mailing list for ConTeXt users

On 11/22/2018 2:12 PM, Ulrike Fischer wrote:

> ====
> A palette entry index value of 0xFFFF is a special case indicating
> that the text foreground color (defined by a higher-level client)
> should be used and shall not be treated as actual index into CPAL
> ColorRecord array.
> ====
unrelated ... 0xFFFF is intercepted and dealt with elsewhere ... default 
relates to what we like as default (which is an arbitrary choice from 
the palette but as said: that can be an option)

Hans


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

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-22 13:46               ` luigi scarso
@ 2018-11-22 15:14                 ` Ulrike Fischer
  2018-11-22 15:34                   ` luigi scarso
  0 siblings, 1 reply; 13+ messages in thread
From: Ulrike Fischer @ 2018-11-22 15:14 UTC (permalink / raw)
  To: ntg-context

Am Thu, 22 Nov 2018 14:46:57 +0100 schrieb luigi scarso:

>> ====
>> A palette entry index value of 0xFFFF is a special case indicating
>> that the text foreground color (defined by a higher-level client)
>> should be used and shall not be treated as actual index into CPAL
>> ColorRecord array.
>> ====
>>


> " the text foreground color (defined by a higher-level client)
> should be used" doesn't mean   "you  MUST take the current color
> text" or even "you MUST use black" In fact "defined by a
> higher-level client" means that  I could define  a palette  such 
> that each glyph marked with 0xFFFF has its own color based on my
> palette ---  not necessarily the *same* color.

Sounds as if there is some room for interpretation ;-). But assume
that I want in my example the 0xFFFF to be interpretated as "the
current text color", so the currently blue glyphs should be black,
and if I add \color[red] before the text they should be red. Can and
if yes how this be setup? (Both in context and in generic)

 

-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-22 15:14                 ` Ulrike Fischer
@ 2018-11-22 15:34                   ` luigi scarso
  2018-11-22 17:19                     ` luigi scarso
  0 siblings, 1 reply; 13+ messages in thread
From: luigi scarso @ 2018-11-22 15:34 UTC (permalink / raw)
  To: Ulrike Fischer, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1227 bytes --]

On Thu, Nov 22, 2018 at 4:15 PM Ulrike Fischer <news3@nililand.de> wrote:

> Am Thu, 22 Nov 2018 14:46:57 +0100 schrieb luigi scarso:
>
> >> ====
> >> A palette entry index value of 0xFFFF is a special case indicating
> >> that the text foreground color (defined by a higher-level client)
> >> should be used and shall not be treated as actual index into CPAL
> >> ColorRecord array.
> >> ====
> >>
>
>
> > " the text foreground color (defined by a higher-level client)
> > should be used" doesn't mean   "you  MUST take the current color
> > text" or even "you MUST use black" In fact "defined by a
> > higher-level client" means that  I could define  a palette  such
> > that each glyph marked with 0xFFFF has its own color based on my
> > palette ---  not necessarily the *same* color.
>
> Sounds as if there is some room for interpretation ;-). But assume
> that I want in my example the 0xFFFF to be interpretated as "the
> current text color", so the currently blue glyphs should be black,
> and if I add \color[red] before the text they should be red. Can and
> if yes how this be setup? (Both in context and in generic)
>

no, at this moment is fixed,  but we are discussing just now how to
implement this.


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1814 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: font-ocl.lua:76: attempt to call a nil value (field 'register')
  2018-11-22 15:34                   ` luigi scarso
@ 2018-11-22 17:19                     ` luigi scarso
  0 siblings, 0 replies; 13+ messages in thread
From: luigi scarso @ 2018-11-22 17:19 UTC (permalink / raw)
  To: Ulrike Fischer, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3599 bytes --]

On Thu, Nov 22, 2018 at 4:34 PM luigi scarso <luigi.scarso@gmail.com> wrote:

>
> no, at this moment is fixed,  but we are discussing just now how to
> implement this.
>
>
kind of
\starttext

\definefontfeature[quran][mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
       ccmp=yes,locl=yes,calt=yes,
       liga=yes,clig=yes,dlig=yes,rlig=yes,
   mark=yes,mkmk=yes,kern=yes,curs=yes,
  colr=yes]
\definefont[quran][AmiriQuranColored*quran @ 18pt]

\definecolor[R][r=0.6]
\definecolor[G][g=1.0]
\definecolor[B][b=0.6]
\definefontcolorpalette [colorpalet] [R,G,B,red,textcolor]
\definefontfeature[quranA][mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
       ccmp=yes,locl=yes,calt=yes,
       liga=yes,clig=yes,dlig=yes,rlig=yes,
       mark=yes,mkmk=yes,kern=yes,curs=yes,
  colr=colorpalet]
\definefont[quranA][AmiriQuranColored*quranA @ 18pt]


\catcode`\^=7
\pardir TRT\textdir TRT
\externalfigure[gpoO7.jpg]
\quran
\baselineskip=2.6em
\parindent=0pt
\leftskip=0pt plus 1fil
\rightskip=0pt plus -1fil
\parfillskip=0pt plus 2fil
\def\aya#1{{\textdir TLT ^^^^06dd#1}}
^^^^fdfd~\aya{١}\par
ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ
ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ
وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ
ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ
غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par


\startcolor[orange]
^^^^fdfd~\aya{١}\par
ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ
ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ
وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ
ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ
غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par
\stopcolor

\quranA
^^^^fdfd~\aya{١}\par
ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ
ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ
وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ
ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ
غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par

\startcolor[gray]
^^^^fdfd~\aya{١}\par
ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ
ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ
وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ
ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ
غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par
\stopcolor

\stoptext

From the  font cache one can see the palette of the font.
-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 4756 bytes --]

[-- Attachment #2: test-001.pdf --]
[-- Type: application/pdf, Size: 114196 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2018-11-22 17:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 12:01 font-ocl.lua:76: attempt to call a nil value (field 'register') Ulrike Fischer
2018-11-21 12:37 ` Ulrike Fischer
2018-11-21 17:46   ` Hans Hagen
2018-11-21 18:04     ` Ulrike Fischer
2018-11-21 19:37       ` luigi scarso
2018-11-21 20:04         ` Ulrike Fischer
2018-11-22 12:50           ` Hans Hagen
2018-11-22 13:12             ` Ulrike Fischer
2018-11-22 13:46               ` luigi scarso
2018-11-22 15:14                 ` Ulrike Fischer
2018-11-22 15:34                   ` luigi scarso
2018-11-22 17:19                     ` luigi scarso
2018-11-22 14:09               ` 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).