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
On Fri, May 3, 2013 at 5:20 PM, "H. Özoguz"
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
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
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 ___________________________________________________________________________________
On Fri, May 3, 2013 at 6:29 PM, Keith J. Schultz
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
On Fri, May 3, 2013 at 5:20 PM, "H. Özoguz"
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...) .
On Fri, May 3, 2013 at 6:40 PM, luigi scarso
On Fri, May 3, 2013 at 5:20 PM, "H. Özoguz"
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
participants (4)
-
"H. Özoguz"
-
Arthur Reutenauer
-
Keith J. Schultz
-
luigi scarso