ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: substitutions
Date: Tue, 7 Oct 2008 12:53:40 +0200	[thread overview]
Message-ID: <6faad9f00810070353h170387fm234b5b6a5c75b8c6@mail.gmail.com> (raw)
In-Reply-To: <op.uikstrb8fkrasx@your-b27fb1c401>

On Mon, Oct 6, 2008 at 1:57 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Dear gang,
>
> Sometimes I use the following for simple substitutions:
>
> \defineactivecharacter  '  {\otfchar{quoteright}}
>
> But is there a more general mechanism to do things
>
> \definesubstitution{<string1>}{<string2>}
>
> eg
>
> \definesubstitution{--}{–}
>
> Of course ConTeXt already provides this particular substitution

In mkii it doesn't. Fonts do that substitution. In mkiv a hack is
applied to fonts (not to TeX macros), so that this particular
substitution works.

> but I'm
> interested in such a mechanism for more general purposes.

In mkii this is not possible, except with some ugly hacks. You can
easily substitute a single character by making it active. To
substitute whole words, you either need to modify fonts, or write some
dirty macros.

In mkiv you can either apply some "patches" to fonts (search for tlig
in ConTeXt source, for example font-otf.lua, also, there are some fea
files in fonts/fea/context capable of doing that), or change input
text while reading/digesting some TeX file.

Hans and Taco can probably tell you more.

Mojca
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2008-10-07 10:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-05 23:57 substitutions Idris Samawi Hamid ادريس سماوي حامد
2008-10-07 10:53 ` Mojca Miklavec [this message]
2008-10-07 18:16   ` substitutions Hans Hagen
2008-10-08 12:41     ` substitutions Idris Samawi Hamid ادريس سماوي حامد
2008-10-08 14:46       ` substitutions Mojca Miklavec
2008-10-08 15:43         ` substitutions Idris Samawi Hamid
2008-10-08 22:53       ` substitutions Mojca Miklavec
2009-03-27 12:05         ` substitutions Khaled Hosny
2009-03-29  1:27           ` substitutions: can i send this? Idris Samawi Hamid ادريس سماوي حامد
2009-03-29 17:25             ` Khaled Hosny
2009-03-29 17:37               ` Hans Hagen
2008-10-08 12:34   ` substitutions Idris Samawi Hamid ادريس سماوي حامد

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=6faad9f00810070353h170387fm234b5b6a5c75b8c6@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --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).