* [NTG-context] new way to do \addff?
@ 2025-04-12 0:35 Mohammad Hossein Bateni
2025-04-12 7:38 ` [NTG-context] " Hans Hagen via ntg-context
0 siblings, 1 reply; 3+ messages in thread
From: Mohammad Hossein Bateni @ 2025-04-12 0:35 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 498 bytes --]
Hello,
\addff (and \doaddfeature) no longer seem to work. What's the alternative
to add/remove features on the fly?
MNWE:
===
\starttext
\startluacode
fonts.handlers.otf.addfeature{
name = "fanum",
type = "substitution",
data = {
[0x30] = 0x41 -- '0' => 'A'
}
}
\stopluacode
\definefontfeature[fanum][fanum=yes]
{0123
%\addff{fanum}
\doaddfeature{fanum}
0123 %% does not work
\definedfont[dejavusans*fanum]
0123 %% works
} 0123
\stoptext
===
[-- Attachment #1.2: Type: text/html, Size: 759 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: new way to do \addff?
2025-04-12 0:35 [NTG-context] new way to do \addff? Mohammad Hossein Bateni
@ 2025-04-12 7:38 ` Hans Hagen via ntg-context
2025-04-12 11:41 ` Mohammad Hossein Bateni
0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2025-04-12 7:38 UTC (permalink / raw)
To: ntg-context; +Cc: Hans Hagen
On 4/12/2025 2:35 AM, Mohammad Hossein Bateni wrote:
> Hello,
>
> \addff (and \doaddfeature) no longer seem to work. What's the
> alternative to add/remove features on the fly?
nothing changed there
move the luacode before the \starttext or any place before the main font
is defined because features are bound to fonts so new ones have to be
defined beforehanbd
> MNWE:
>
> ===
> \starttext
> \startluacode
> fonts.handlers.otf.addfeature{
> name = "fanum",
> type = "substitution",
> data = {
> [0x30] = 0x41 -- '0' => 'A'
> }
> }
> \stopluacode
> \definefontfeature[fanum][fanum=yes]
> {0123
> %\addff{fanum}
> \doaddfeature{fanum}
> 0123 %% does not work
> \definedfont[dejavusans*fanum]
> 0123 %% works
> } 0123
> \stoptext
> ===
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___________________________________________________________________________________
--
-----------------------------------------------------------------
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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: new way to do \addff?
2025-04-12 7:38 ` [NTG-context] " Hans Hagen via ntg-context
@ 2025-04-12 11:41 ` Mohammad Hossein Bateni
0 siblings, 0 replies; 3+ messages in thread
From: Mohammad Hossein Bateni @ 2025-04-12 11:41 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2499 bytes --]
Thanks a lot!
On Sat, Apr 12, 2025 at 3:38 AM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:
> On 4/12/2025 2:35 AM, Mohammad Hossein Bateni wrote:
> > Hello,
> >
> > \addff (and \doaddfeature) no longer seem to work. What's the
> > alternative to add/remove features on the fly?
>
> nothing changed there
>
> move the luacode before the \starttext or any place before the main font
> is defined because features are bound to fonts so new ones have to be
> defined beforehanbd
>
> > MNWE:
> >
> > ===
> > \starttext
> > \startluacode
> > fonts.handlers.otf.addfeature{
> > name = "fanum",
> > type = "substitution",
> > data = {
> > [0x30] = 0x41 -- '0' => 'A'
> > }
> > }
> > \stopluacode
> > \definefontfeature[fanum][fanum=yes]
> > {0123
> > %\addff{fanum}
> > \doaddfeature{fanum}
> > 0123 %% does not work
> > \definedfont[dejavusans*fanum]
> > 0123 %% works
> > } 0123
> > \stoptext
> > ===
> >
> >
> ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> > archive : https://github.com/contextgarden/context
> > wiki : https://wiki.contextgarden.net
> >
> ___________________________________________________________________________________
>
>
> --
>
> -----------------------------------------------------------------
> 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 /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 4227 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-12 11:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-12 0:35 [NTG-context] new way to do \addff? Mohammad Hossein Bateni
2025-04-12 7:38 ` [NTG-context] " Hans Hagen via ntg-context
2025-04-12 11:41 ` Mohammad Hossein Bateni
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).