ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl, jfbu@free.fr
Subject: Re: alternate to font feature file for glyph substitution ?
Date: Tue, 10 May 2016 16:25:53 +0200	[thread overview]
Message-ID: <96e5f462-4e56-6e7b-cb3c-c56a77accf40@wxs.nl> (raw)
In-Reply-To: <CEDA41B6-8FAB-4106-8511-78AE534C9451@free.fr>

On 4/28/2016 4:08 PM, jfbu wrote:
> Hi,
>
> how should I go at the Plain TeX level about implementing
> the following glyph substitution which I formerly expressed
> in a font feature file:
>
> languagesystem DFLT dflt;
> languagesystem latn dflt;
>
> feature oneb {
>   sub one by one.ss01;
> } oneb;
>
> The font is Vollkorn, a Plain LuaTeX file which worked in TL2015 would be
>
> \input luaotfload.sty
> \font\x="Vollkorn:script=latn;language=DFLT;+tlig;featurefile=vollkornlua.fff;+oneb;"
> \x 123
> \bye
> % Local Variables:
> % TeX-engine: luatex
> % End:
>
> The glyph for digit 1 is modified and picked in stylistic set 1. I don't want
> to globally switch to that stylistic set, I am only interested into digit 1.

\starttext

\startluacode
     fonts.handlers.otf.addfeature {
         name = "oneb",
         type = "substitution",
         data = {
             ["one"] = "one.ss01",
         }
     }
\stopluacode

% context

\definefontfeature[default-oneb][default][oneb=yes]
\definefontfeature[default-ss01][default][ss01=yes]

\definedfont[name:vollkorn*default]      123\par
\definedfont[name:vollkorn*default-oneb] 123\par
\definedfont[name:vollkorn*default-ss01] 123\par

% non context

\font\foo=name:vollkorn:mode=node;kern=yes;liga=yes;          \foo 123\par
\font\foo=name:vollkorn:mode=node;kern=yes;liga=yes;oneb=yes; \foo 123\par

\stoptext

> My use case is more with LuaLaTeX+fontspec, but if I am explained
> a Plain LuaTeX approach I can at least forward to Will Robertson
> who maintains fontspec and cross my fingers that it trickles down
> back to me at some point via update of fontspec, or luatex, or luaotfload,
> ...

I don't know how they do it there but you need to define some lua (as 
above) and then enable that feature when defining the font.

> Please CC to me as although I asked for (temporary) list inscription
> I might not yet be registered.
>
> I am aware of https://mailman.ntg.nl/pipermail/ntg-context/2016/083952.html
> but can't work it out from there.
>
> Jean-François
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

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

      parent reply	other threads:[~2016-05-10 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 14:08 jfbu
2016-05-05  8:55 ` luigi scarso
2016-05-05  9:19   ` jfbu
2016-05-10 14:25 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96e5f462-4e56-6e7b-cb3c-c56a77accf40@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=jfbu@free.fr \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).