seeking 'hello world' example for Arabic typesetting with conTeXt
Dear all, I'm gradually getting my head around using ConTeXt to typeset texts marked up in TEI/XML. I'm trying to typeset an English/Arabic text and I keep breaking my teeth on the Arabic. I'm trying to do what I can with the macTeX 2010 distribution, but the documentation on the conTeXt wiki has me confused. The amount I don't know about TeX is truly daunting, but clearly there are some basic things about font management that I don't understand. I thought I had found a minimal example in http://wiki.contextgarden.net/Arabic_and_Hebrew that I could use as a starting point. After saving it locally as ara-sty.tex I tried to typeset: % engine=luatex \environment ara-sty \starttext \setarabic أهلا بالعالم! \stoptext a PDF was produced but it contained no text save for !. Among the things that conTeXt told me was: !define font : font with name arabtype is not found !define font : unknown font arabtype, loading aborted !define font : unable to define arabtype as \*Arabic20ptrmtf* Where should I look for this font? Where is conTeXt looking for it? If I were to find it, where should I put it? I gather that fonts on my system can be used, but font metric files for them have to be generated. How to do that? Apologies for the unfocused tyro questions, but the TeX world has become so much larger than it was when I last used it that I feel quite at sea with all the available documentation. thanks, Jon
Hi Jon,
On Sun, 28 Nov 2010 14:48:32 -0700, Jon Crump
Dear all,
I'm gradually getting my head around using ConTeXt to typeset texts marked up in TEI/XML. I'm trying to typeset an English/Arabic text and I keep breaking my teeth on the Arabic. I'm trying to do what I can with the macTeX 2010 distribution, but the documentation on the conTeXt wiki has me confused. The amount I don't know about TeX is truly daunting, but clearly there are some basic things about font management that I don't understand.
In this case it's not the font management, at least not yet ...
I thought I had found a minimal example in http://wiki.contextgarden.net/Arabic_and_Hebrew that I could use as a starting point. After saving it locally as ara-sty.tex I tried to typeset:
% engine=luatex \environment ara-sty \starttext \setarabic
أهلا بالعالم! \stoptext
a PDF was produced but it contained no text save for !. Among the things that conTeXt told me was:
!define font : font with name arabtype is not found !define font : unknown font arabtype, loading aborted !define font : unable to define arabtype as \*Arabic20ptrmtf*
Where should I look for this font? Where is conTeXt looking for it? If I were to find it, where should I put it?
arabtype is a windows font. It's free-beer with windows but try a search or two and you may find it stand-alone somewhere...
I gather that fonts on my system can be used, but font metric files for them have to be generated. How to do that?
Thankfully, with MkIV one [thankfully] no longer needs to concern oneself with metric files
Apologies for the unfocused tyro questions, but the TeX world has become so much larger than it was when I last used it that I feel quite at sea with all the available documentation.
NP, and that page needs updating anyway. For example, forget about \setcharactermirroring[1] and use \setupdirections[bidi=global] or \setupdirections[bidi=local] as needed. And no need for % engine=luatex Right now you need a font. Try the free and unicode-complete scheherezade from SIL and replace [name:arabtype] with [name:scheherezade] or whatever the exact font name is. There is an modified version of scheherezade for TeX distros (Khaled and I played with it once upon a time) but I don't know where it is at the moment, as it's been ages since I worked on it. I thought it was part of the ConTeXt distro already but I could not find it. I'll check into it later. Khaled, do you have that modified scheherezade somewhere? There is a simpler way to approach this, I'll try to post an example in the coming days. Best wishes Idris -- Professor Idris Samawi Hamid, Editor-in-Chief International Journal of Shīʿī Studies Department of Philosophy Colorado State University Fort Collins, CO 80523
On Sun, 28 Nov 2010 21:47:08 -0700, Idris Samawi Hamid ادريس سماوي حامد
There is an modified version of scheherezade for TeX distros (Khaled and I played with it once upon a time) but I don't know where it is at the moment, as it's been ages since I worked on it. I thought it was part of the ConTeXt distro already but I could not find it. I'll check into it later. Khaled, do you have that modified scheherezade somewhere?
The modified Scheherezade is called SimpleNaskhi.ttf, I assume Khaled has the latest version. Hans, Mojca: I suggest going ahead and making SimpleNaskhi the default arabic-script unicode fallback for MkIV: \definefontfeature[simplearabic] [mode=node,language=dflt,script=arab, init=yes,medi=yes,fina=yes,calt=yes, rlig=yes,curs=yes,mark=yes,mkmk=yes] It is a very unicode-complete font, while -- as the name suggests -- quite simple in features. For fallbacks we need: [arabic,arabicpresentationformsa,arabicpresentationformsb, arabicsupplement,0x200C,0x200D] we have to play with rscale to get the right balance with LM I guess... If SimpleNaskhi is somehow broken or unavailable then we just go with ScheherazadeRegOT.ttf as the default font. [BTW: I think we discussed this 18 months or so ago...] Best wishes Idris -- Professor Idris Samawi Hamid, Editor-in-Chief International Journal of Shīʿī Studies Department of Philosophy Colorado State University Fort Collins, CO 80523
On 29-11-2010 6:14, Idris Samawi Hamid ادريس سماوي حامد wrote:
\definefontfeature[simplearabic] [mode=node,language=dflt,script=arab, init=yes,medi=yes,fina=yes,calt=yes, rlig=yes,curs=yes,mark=yes,mkmk=yes]
added ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, Nov 28, 2010 at 09:47:08PM -0700, Idris Samawi Hamid ادريس سماوي حامد wrote:
There is an modified version of scheherezade for TeX distros (Khaled and I played with it once upon a time) but I don't know where it is at the moment, as it's been ages since I worked on it. I thought it was part of the ConTeXt distro already but I could not find it. I'll check into it later.
Khaled, do you have that modified scheherezade somewhere?
I've to dig for it, I'm sure it is there somewhere. However, I've long abandoned the idea of improving Scheherezade and instead concentrating on my own (Amiri) font, but it does not work with MkIV right now (and vowel marks are half done), so it is not a replacement yet. I do plan for a simplified version of Amiri that would fulfil the original goal of the modified Scheherezade font (and also developed in a way that works with most of the current broken OpenType implementations, unlike the current Amiri) and that one would be suitable as a default font, but this is months away at best. P.S. If any one interested in that Amiri font: http://amiri.sourceforge.net Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer
On Mon, 29 Nov 2010 11:03:06 -0700, Khaled Hosny
I've to dig for it, I'm sure it is there somewhere. However, I've long abandoned the idea of improving Scheherezade and instead concentrating on my own (Amiri) font, but it does not work with MkIV right now (and vowel marks are half done), so it is not a replacement yet. I do plan for a simplified version of Amiri that would fulfil the original goal of the modified Scheherezade font (and also developed in a way that works with most of the current broken OpenType implementations, unlike the current Amiri) and that one would be suitable as a default font, but this is months away at best.
OK: In that case, let's include the standard Scheharezade as is in the minimals until another unicode-complete font comes along. It has an Open Font License so should be no problem. Miojca: Till then, where do you suggest placing Scheharezade in the tree? Best wishes Idris -- Professor Idris Samawi Hamid, Editor-in-Chief International Journal of Shiʿi Studies Department of Philosophy Colorado State University Fort Collins, CO 80523
2010/11/29 Idris Samawi Hamid ادريس سماوي حامد
On Mon, 29 Nov 2010 11:03:06 -0700, Khaled Hosny
wrote: I've to dig for it, I'm sure it is there somewhere. However, I've long abandoned the idea of improving Scheherezade and instead concentrating on my own (Amiri) font, but it does not work with MkIV right now (and vowel marks are half done), so it is not a replacement yet. I do plan for a simplified version of Amiri that would fulfil the original goal of the modified Scheherezade font (and also developed in a way that works with most of the current broken OpenType implementations, unlike the current Amiri) and that one would be suitable as a default font, but this is months away at best.
OK: In that case, let's include the standard Scheharezade as is in the minimals until another unicode-complete font comes along. It has an Open Font License so should be no problem.
Miojca: Till then, where do you suggest placing Scheharezade in the tree?
tex/texmf/fonts/truetype/public/scheharezade ? -- luigi
On 29-11-2010 8:23, luigi scarso wrote:
2010/11/29 Idris Samawi Hamid ادريس سماوي حامد
: On Mon, 29 Nov 2010 11:03:06 -0700, Khaled Hosny
wrote: I've to dig for it, I'm sure it is there somewhere. However, I've long abandoned the idea of improving Scheherezade and instead concentrating on my own (Amiri) font, but it does not work with MkIV right now (and vowel marks are half done), so it is not a replacement yet. I do plan for a simplified version of Amiri that would fulfil the original goal of the modified Scheherezade font (and also developed in a way that works with most of the current broken OpenType implementations, unlike the current Amiri) and that one would be suitable as a default font, but this is months away at best.
OK: In that case, let's include the standard Scheharezade as is in the minimals until another unicode-complete font comes along. It has an Open Font License so should be no problem.
Miojca: Till then, where do you suggest placing Scheharezade in the tree?
tex/texmf/fonts/truetype/public/scheharezade ?
fonts/data/sil/scheharezade ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
2010/11/29 Idris Samawi Hamid ادريس سماوي حامد wrote:
On Mon, 29 Nov 2010 11:03:06 -0700, Khaled Hosny wrote:
OK: In that case, let's include the standard Scheharezade as is in the minimals until another unicode-complete font comes along. It has an Open Font License so should be no problem.
Mojca: Till then, where do you suggest placing Scheharezade in the tree?
If we make some font the default one ... it makes sense to put it on CTAN and include it in TeX Live as well, right? Mojca But then ... I somehow find it a bit weird to have Arabic fallback inside Latin Modern unless a user requests that explicitely and also says which font he wants to use. That it: I would suggest to have some setting that would tell exactly which glyphs to replace in the main font, which features to use ... but then the user would say that this font needs to be added. That is: are we also going to add Chinese, Japanese, Korean, Ethiopic, ... etc. scripts, all inside the one default font?
On 30-11-2010 12:50, Mojca Miklavec wrote:
But then ... I somehow find it a bit weird to have Arabic fallback inside Latin Modern unless a user requests that explicitely and also
that will not be a default (but one can of course configure that in cont-sys.tex)
says which font he wants to use. That it: I would suggest to have some setting that would tell exactly which glyphs to replace in the main font, which features to use ... but then the user would say that this font needs to be added.
That is: are we also going to add Chinese, Japanese, Korean, Ethiopic, ... etc. scripts, all inside the one default font?
no Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, 30 Nov 2010 04:50:58 -0700, Mojca Miklavec
2010/11/29 Idris Samawi Hamid ادريس سماوي حامد wrote:
On Mon, 29 Nov 2010 11:03:06 -0700, Khaled Hosny wrote:
OK: In that case, let's include the standard Scheharezade as is in the minimals until another unicode-complete font comes along. It has an Open Font License so should be no problem.
Mojca: Till then, where do you suggest placing Scheharezade in the tree?
If we make some font the default one ... it makes sense to put it on CTAN and include it in TeX Live as well, right?
Well, I only use ConTeXt;-) but TeXLive could use a default Arabic font as well for XeTeX (a fellow SIL project); surprised it's not there already ...
But then ... I somehow find it a bit weird to have Arabic fallback inside Latin Modern unless a user requests that explicitely and also says which font he wants to use. That it: I would suggest to have some setting that would tell exactly which glyphs to replace in the main font, which features to use ... but then the user would say that this font needs to be added.
What we need is for new users to be able to say, eg, \setmainlanguage[arabic] \setupdirections[bidi=global] % maybe this should be implied by \setmainlanguage[arabic] \starttext أهلا بالعالم! \stoptext And get Scheharezade without doing anything else. Indeed, especially once bidi is fully tested etc, one should be able to do just \starttext أهلا بالعالم! \stoptext and get correct Arabic output, with an implied \setupdirections[bidi=local] In other words, users need to be able to invoke default Arabic without doing really much of anything, just as they currently do with LM. Then users can switch fonts, adjust bidi controls, change features etc. Since LM has no Arabic, "replacement" of glyphs is not an issue, and Scheharezade is simple enough that a default feature set will suffice. Default Arabic boosts moral, attracts more users, saves time on the list, helps to focus on bugs and tweaks [as opposed to "How can I get Arabic-script working"], is a Good Idea (TM) etc :-) Best wishes Idris -- Professor Idris Samawi Hamid, Editor-in-Chief International Journal of Shīʿī Studies Department of Philosophy Colorado State University Fort Collins, CO 80523
2010/11/30 Idris Samawi Hamid ادريس سماوي حامد
What we need is for new users to be able to say, eg,
\setmainlanguage[arabic] \setupdirections[bidi=global] % maybe this should be implied by \setmainlanguage[arabic]
\starttext أهلا بالعالم! \stoptext
And get Scheharezade without doing anything else. Maybe we can put the fonts as an extra module .
-- luigi
On Wed, 01 Dec 2010 02:48:13 -0700, luigi scarso
2010/11/30 Idris Samawi Hamid ادريس سماوي حامد
: What we need is for new users to be able to say, eg,
\setmainlanguage[arabic] \setupdirections[bidi=global] % maybe this should be implied by \setmainlanguage[arabic]
\starttext أهلا بالعالم! \stoptext
And get Scheharezade without doing anything else. Maybe we can put the fonts as an extra module .
Why a seperate module? It's an Open Font License. Why add unnecessary extra work for users, especially new ones? Best wishes Idris -- Professor Idris Samawi Hamid, Editor-in-Chief International Journal of Shiʿi Studies Department of Philosophy Colorado State University Fort Collins, CO 80523
Idris, Khaled, et alia,
Many, many thanks! Failing to find SimpleNaskhi.ttf anywhere, I
downloaded ScheherazadeRegOT.ttf from SIL. I have the font in the same
directory as my tei file apr.xml; along with my ara-sty.tex file
suitably edited with the font name for the \definefontsynonym
commands; and the environment file svo-tei.tex, in which I assert at
the top: \environment ara-sty, and call in a \startxmlsetups command
thus:
\startxmlsetups xml:div:month
\blank[line]\midaligned{\xmlatt{#1}{n}}\blank[medium]
\setarabic
\stopxmlsetups
Now, when I invoke context at the command-line:
context --environment=svo-tei.tex apr.xml
I'm finally seeing some Arabic text, and it's beautiful! It's a great
pity I don't actually read Arabic ;-(
It remains now to define my xmlsetups in such a way as to be able to
distinguish between the Arabic and Roman sections; my tei file is a
bit idiosyncratic, and I've much to do still in grasping the necessary
lpath expressions, but at last I'm making some progress! My heartfelt
thanks and profound admiration for all that you and your colleagues
have accomplished. I hope you'll not mind further simple-minded
questions down the road as I progress with this project.
Best,
Jon
2010/11/28 Idris Samawi Hamid ادريس سماوي حامد
Hi Jon, Thankfully, with MkIV one [thankfully] no longer needs to concern oneself with metric files
Amen!
NP, and that page needs updating anyway. For example, forget about
\setcharactermirroring[1]
and use
\setupdirections[bidi=global] or \setupdirections[bidi=local]
not sure how to use these yet, but it's working.
There is a simpler way to approach this, I'll try to post an example in the coming days.
I'll look forward to any guidance for tyros that you may care to share J
On Sun, Nov 28, 2010 at 01:48:32PM -0800, Jon Crump wrote:
Dear all,
I'm gradually getting my head around using ConTeXt to typeset texts marked up in TEI/XML. I'm trying to typeset an English/Arabic text and I keep breaking my teeth on the Arabic. I'm trying to do what I can with the macTeX 2010 distribution, but the documentation on the conTeXt wiki has me confused. The amount I don't know about TeX is truly daunting, but clearly there are some basic things about font management that I don't understand.
I thought I had found a minimal example in http://wiki.contextgarden.net/Arabic_and_Hebrew that I could use as a starting point. After saving it locally as ara-sty.tex I tried to typeset:
This page is a bit outdated, things can be done in simpler ways now. I've typeset a small Arabic book in ConTeXt last year (and should be working on a small one now) but I use my own BiDi implementation so my setup is a bit different than the "standard" way. If I got that book done in ConTeXt I'll try to write some updated examples and publish the TeX files of the book for anyone interested. Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer
participants (7)
-
Hans Hagen
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Idris Samawi Hamid ادريس سماوي حامد
-
Jon Crump
-
Khaled Hosny
-
luigi scarso
-
Mojca Miklavec