From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82308 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: Automatic replacement? Date: Fri, 3 May 2013 18:44:58 +0200 Message-ID: References: <5183D5B6.8040204@mmnetz.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0568241506==" X-Trace: ger.gmane.org 1367599520 16675 80.91.229.3 (3 May 2013 16:45:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 May 2013 16:45:20 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri May 03 18:45:21 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UYJ6h-0005sJ-QF for gctc-ntg-context-518@m.gmane.org; Fri, 03 May 2013 18:45:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 175DD101EA; Fri, 3 May 2013 18:45:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iu8vVgt38DrB; Fri, 3 May 2013 18:45:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E3C33101E5; Fri, 3 May 2013 18:45:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1972E101E5 for ; Fri, 3 May 2013 18:45:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YTxWOIsDusN3 for ; Fri, 3 May 2013 18:45:10 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 17CDE101E4 for ; Fri, 3 May 2013 18:45:00 +0200 (CEST) Original-Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r43GixmA023448 for ; Fri, 3 May 2013 18:44:59 +0200 Original-Received: by mail-lb0-f173.google.com with SMTP id t10so1732955lbi.18 for ; Fri, 03 May 2013 09:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=vyjzkkRl4e1sus/e7zTX5mgtBo6BL+3WniAEfowSfU8=; b=v/J6kC1P5pL6N60Th+O2jOO6slANMlZ1jItsPPgYnM+8DI7XSvuf+9eAZfm3WouFF+ 97oav8vL2v4fsVZgl3C77UPyAmKy35vPgAIIiy9i1J3UcvKS0gEnoM7Ql8PvWMcEogWE 8s1fymwP13LSX0zL15BP2/mNxTBperHpSmfsRpSTA6hhYsTAzPOXIsWuUf8LUEOxIf1P TpVox1tQfEqqFxfVmMVrlWT+UtZrfiPGGmoCLMFLAMnoSExPN6dF6M6gWPk+x/UflM0I gQut9lcz/E+wZspuOmFLpuhWmg4IXL/IC5ADoIiLWRpeDaiIn/zoFN40x9JimGJSpfyl fJJQ== X-Received: by 10.112.161.38 with SMTP id xp6mr4555574lbb.32.1367599498829; Fri, 03 May 2013 09:44:58 -0700 (PDT) Original-Received: by 10.114.187.69 with HTTP; Fri, 3 May 2013 09:44:58 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.217.173; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VJvsIXW6 - a4497edfb3b6 - 20130503 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:82308 Archived-At: --===============0568241506== Content-Type: multipart/alternative; boundary=001a11c264fe52a7e904dbd3127c --001a11c264fe52a7e904dbd3127c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, May 3, 2013 at 6:40 PM, luigi scarso wrote= : > > > > On Fri, May 3, 2013 at 5:20 PM, "H. =C3=96zoguz" wr= ote: > >> Thanks luigi, but it does not work for my characters, see here: >> >> \definefont[tradoa][name:**trado*arabic at 20pt] % or >> file:amiri-regular.ttf*... file:alq.ttf >> >> \directlua{ local function replace_txt (buffer) >> buffer=3Dstring.gsub(buffer,"**=D8=A7=D9=84=D9=84=D9=87=D9=90","=D8=A7= =D9=84=D9=84=D9=91=D9=8E=D9=80=D9=87") return buffer end >> callback.register("process_**input_buffer",replace_txt) >> } >> \starttext >> my text {\setupalign[r2l] \tradoa =D8=A7=D9=84=D9=84=D9=91=D9=8E=D9=80= =D9=87} >> \stoptext >> >> "trado" ist just the font "traditional arabic", nearly every system have >> it, so you should be able to compile this. It does not replace the >> character. >> >> my fault, sorry. > In the string library the function are not unicode aware (of course, I > should say...) . > > it should be lpeg.replacer, but I've no time now to check --=20 luigi --001a11c264fe52a7e904dbd3127c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Fri, May 3, 2013 at 6:40 PM, luigi scarso <= luigi.scarso@gm= ail.com> wrote:



On Fri, May 3, 201= 3 at 5:20 PM, "H. =C3=96zoguz" <h.oezoguz@mmnetz.de> wrote:
Thanks luigi, but it= does not work for my characters, see here:

\definefont[tradoa][name:trado*arabic at 20pt] % or file:amiri-regul= ar.ttf*... file:alq.ttf

\directlua{ local function replace_txt (buffer)
buffer=3Dstring.gsub(buffer,"=D8=A7=D9=84=D9=84=D9=87=D9=90&quo= t;,"=D8=A7=D9=84=D9=84=D9=91=D9=8E=D9=80=D9=87") return buffer en= d
callback.register("process_input_buffer",replace_txt)
}
\starttext
my text {\setupalign[r2l] \tradoa =D8=A7=D9=84=D9=84=D9=91=D9=8E=D9=80=D9= =87}
\stoptext

"trado" ist just the font "traditional arabic", nearly = every system have it, so you should be able to compile this. It does not re= place the character.

my fault, sorry.
In the=C2=A0 string = library=C2=A0 the function are not unicode aware (of course, I should say..= .) .

it should be lpeg.replacer, but I've no time now to = check


--
luig= i
--001a11c264fe52a7e904dbd3127c-- --===============0568241506== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0568241506==--