ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Automatic replacement?
@ 2013-05-03 15:20 "H. Özoguz"
  2013-05-03 16:27 ` luigi scarso
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: "H. Özoguz" @ 2013-05-03 15:20 UTC (permalink / raw)
  To: ntg-context

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=string.gsub(buffer,"اللهِ","اللَّـه") return buffer end
callback.register("process_input_buffer",replace_txt)
}
\starttext
my text {\setupalign[r2l] \tradoa اللَّـه}
\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.

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

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

* Re: Automatic replacement?
  2013-05-03 15:20 Automatic replacement? "H. Özoguz"
@ 2013-05-03 16:27 ` luigi scarso
  2013-05-03 16:29 ` Keith J. Schultz
  2013-05-03 16:40 ` luigi scarso
  2 siblings, 0 replies; 10+ messages in thread
From: luigi scarso @ 2013-05-03 16:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Fri, May 3, 2013 at 5:20 PM, "H. Özoguz" <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-regular.ttf*... file:alq.ttf
>
> \directlua{ local function replace_txt (buffer)
> buffer=string.gsub(buffer,"**اللهِ","اللَّـه") return buffer end
> callback.register("process_**input_buffer",replace_txt)
> }
> \starttext
> my text {\setupalign[r2l] \tradoa اللَّـه}
> \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.
>
>
ok, I've installed  amiri-regular.ttf and it compiles, and as you say the
gsub doesn't work. I'm trying to see why.


-- 
luigi

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Automatic replacement?
  2013-05-03 15:20 Automatic replacement? "H. Özoguz"
  2013-05-03 16:27 ` luigi scarso
@ 2013-05-03 16:29 ` Keith J. Schultz
  2013-05-04 10:06   ` Arthur Reutenauer
  2013-05-04 10:20   ` luigi scarso
  2013-05-03 16:40 ` luigi scarso
  2 siblings, 2 replies; 10+ messages in thread
From: Keith J. Schultz @ 2013-05-03 16:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

HI Everybody,

If I remember correctly Lua is not rl-compatible. There the below code can not work!

regards
	Keith.

Am 03.05.2013 um 17:20 schrieb H. Özoguz <h.oezoguz@mmnetz.de>:

> 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=string.gsub(buffer,"اللهِ","اللَّـه") return buffer end
> callback.register("process_input_buffer",replace_txt)
> }
> \starttext
> my text {\setupalign[r2l] \tradoa اللَّـه}
> \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.
> 
> Huseyin
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

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

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

* Re: Automatic replacement?
  2013-05-03 15:20 Automatic replacement? "H. Özoguz"
  2013-05-03 16:27 ` luigi scarso
  2013-05-03 16:29 ` Keith J. Schultz
@ 2013-05-03 16:40 ` luigi scarso
  2013-05-03 16:44   ` luigi scarso
  2 siblings, 1 reply; 10+ messages in thread
From: luigi scarso @ 2013-05-03 16:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Fri, May 3, 2013 at 5:20 PM, "H. Özoguz" <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-regular.ttf*... file:alq.ttf
>
> \directlua{ local function replace_txt (buffer)
> buffer=string.gsub(buffer,"**اللهِ","اللَّـه") return buffer end
> callback.register("process_**input_buffer",replace_txt)
> }
> \starttext
> my text {\setupalign[r2l] \tradoa اللَّـه}
> \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...) .

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Automatic replacement?
  2013-05-03 16:40 ` luigi scarso
@ 2013-05-03 16:44   ` luigi scarso
  0 siblings, 0 replies; 10+ messages in thread
From: luigi scarso @ 2013-05-03 16:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

>
>
>
> On Fri, May 3, 2013 at 5:20 PM, "H. Özoguz" <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-regular.ttf*... file:alq.ttf
>>
>> \directlua{ local function replace_txt (buffer)
>> buffer=string.gsub(buffer,"**اللهِ","اللَّـه") return buffer end
>> callback.register("process_**input_buffer",replace_txt)
>> }
>> \starttext
>> my text {\setupalign[r2l] \tradoa اللَّـه}
>> \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


-- 
luigi

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Automatic replacement?
  2013-05-03 16:29 ` Keith J. Schultz
@ 2013-05-04 10:06   ` Arthur Reutenauer
  2013-05-04 10:20   ` luigi scarso
  1 sibling, 0 replies; 10+ messages in thread
From: Arthur Reutenauer @ 2013-05-04 10:06 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

> If I remember correctly

  You don't.

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


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

* Re: Automatic replacement?
  2013-05-03 16:29 ` Keith J. Schultz
  2013-05-04 10:06   ` Arthur Reutenauer
@ 2013-05-04 10:20   ` luigi scarso
  1 sibling, 0 replies; 10+ messages in thread
From: luigi scarso @ 2013-05-04 10:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Fri, May 3, 2013 at 6:29 PM, Keith J. Schultz <keithjschultz@web.de>wrote:

> HI Everybody,
>
> If I remember correctly Lua is not rl-compatible. There the below code can
> not work!
>
>
The solution from Wolfgang is ok, as I can see (I've checked with  some
small examples in arabic)
The callback "process_input_buffer" is not enabled in MkIV (this is my
second fault,could be that gsub works)
which is ok because in general is better to modify the source .


-- 
luigi

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Automatic replacement?
  2013-05-03 14:05 ` luigi scarso
@ 2013-05-04  7:11   ` Wolfgang Schuster
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2013-05-04  7:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 03.05.2013 um 16:05 schrieb luigi scarso <luigi.scarso@gmail.com>:

> 
> 
> 
> On Fri, May 3, 2013 at 3:24 PM, "H. Özoguz" <h.oezoguz@mmnetz.de> wrote:
> Is it possible to define an automatic replacement?
> 
> I want to replace every
> 
> اللَّـه
> by
> اللهِ
> 
> First is a combination of letters, second is the correct arabic one-symbol for the name "Allah". I know, I can do this in the editor, but would helpful, if it is possible in the compiling.
> 
> Huseyin
> 
> 
> \directlua{ local function replace_txt (buffer) buffer=string.gsub(buffer,"A","BB") return buffer end 
> callback.register("process_input_buffer",replace_txt)
> }
> 
> \starttext my text A \stoptext 
> 
> copied & pasted in real time at 16:04 on friday May 3 from the Hans's talk at bachotek 2013 about luatex and plain tex.
> Please test with your characters.

\usemodule[translate]

\starttext

\translateinput[Apple][Orange]

\enableinputtranslation

Apple, Banana and Strawberry.

\stoptext

Wolfgang


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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Automatic replacement?
  2013-05-03 13:24 "H. Özoguz"
@ 2013-05-03 14:05 ` luigi scarso
  2013-05-04  7:11   ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: luigi scarso @ 2013-05-03 14:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Fri, May 3, 2013 at 3:24 PM, "H. Özoguz" <h.oezoguz@mmnetz.de> wrote:

> Is it possible to define an automatic replacement?
>
> I want to replace every
>
> اللَّـه
> by
> اللهِ
>
> First is a combination of letters, second is the correct arabic one-symbol
> for the name "Allah". I know, I can do this in the editor, but would
> helpful, if it is possible in the compiling.
>
> Huseyin
>
>
\directlua{ local function replace_txt (buffer)
buffer=string.gsub(buffer,"A","BB") return buffer end
callback.register("process_input_buffer",replace_txt)
}

\starttext my text A \stoptext

copied & pasted in real time at 16:04 on friday May 3 from the Hans's talk
at bachotek 2013 about luatex and plain tex.
Please test with your characters.

--
luigi

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Automatic replacement?
@ 2013-05-03 13:24 "H. Özoguz"
  2013-05-03 14:05 ` luigi scarso
  0 siblings, 1 reply; 10+ messages in thread
From: "H. Özoguz" @ 2013-05-03 13:24 UTC (permalink / raw)
  To: ntg-context

Is it possible to define an automatic replacement?

I want to replace every

اللَّـه
by
اللهِ

First is a combination of letters, second is the correct arabic 
one-symbol for the name "Allah". I know, I can do this in the editor, 
but would helpful, if it is possible in the compiling.

Huseyin

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

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

end of thread, other threads:[~2013-05-04 10:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03 15:20 Automatic replacement? "H. Özoguz"
2013-05-03 16:27 ` luigi scarso
2013-05-03 16:29 ` Keith J. Schultz
2013-05-04 10:06   ` Arthur Reutenauer
2013-05-04 10:20   ` luigi scarso
2013-05-03 16:40 ` luigi scarso
2013-05-03 16:44   ` luigi scarso
  -- strict thread matches above, loose matches on Subject: below --
2013-05-03 13:24 "H. Özoguz"
2013-05-03 14:05 ` luigi scarso
2013-05-04  7:11   ` Wolfgang Schuster

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).