Dear all, I just read the thread started by Burak Emir about "Typesetting Arabic today", and tried to typeset the sample sent by Idris Samawi Hamid. One of the Arabic or Persian fonts that I have and LuaTeX can find is Nadeem (working on Mac OS X 10.5.3), but what I get after typesetting is the following attached PDF: all the characters are typeset with their isolated form. However typestting the same text with XeConTeXt or XeTeX gives a nice result. So my question is, what should I add or subtract from the font features parameters to get a correct result? The source file is as follows: % engine=luatex \starttext \definefontfeature [test] [analyze=yes, mode=node, language=dflt, script=arab, aalt=yes, init=yes, medi=yes, fina=yes, isol=yes, liga=yes, mset=yes] \font\TradArabic = Nadeem*test at 18pt \startbuffer[paragraph] الحمدلله حمد معترف بحمده، مغترف من بحار مجده، بلسان الثناۤء شاكرا، ولحسن الاۤئه ناشرا؛ الذي خلق الموت والحيوة، والخير والشر، والنفع والضر، والسكون والحركة، والأرواح والأجسام، والذكر والنسيان. \blank اَلْحَمْدُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ مَجْدِهٖ، بِلِسَانِ الثَّنَاۤءِ شَاكِرًا، وَلِحُسْنِ اٰلاۤئِهٖ نَاشِرًا؛ اَلَّذِيْ خَلَقَ الْمَوْتَ وَالْحَيٰوةَ، وَالْخَيْرَ وَالشَّرَّ، وَالنَّفْعَ وَالضَّرَّ، وَالسُّكُوْنَ وَالْحَرَكَةَ، وَالْأَرْوَاحَ وَالْأَجْسَامَ، وَالذِّكْرَ وَالنِّسْيَانَ. \stopbuffer \start \TradArabic \pardir TRT \textdir TRT \getbuffer[paragraph] \stop \stoptext
2008/6/9 Otared Kavian
Dear all,
I just read the thread started by Burak Emir about "Typesetting Arabic today", and tried to typeset the sample sent by Idris Samawi Hamid. One of the Arabic or Persian fonts that I have and LuaTeX can find is Nadeem (working on Mac OS X 10.5.3), but what I get after typesetting is the following attached PDF: all the characters are typeset with their isolated form. However typestting the same text with XeConTeXt or XeTeX gives a nice result.
So my question is, what should I add or subtract from the font features parameters to get a correct result?
The source file is as follows:
% engine=luatex \starttext
\definefontfeature [test] [analyze=yes, mode=node, language=dflt, script=arab, aalt=yes, init=yes, medi=yes, fina=yes, isol=yes, liga=yes, mset=yes]
What happens with the following setups from Idris. \definefontfeature [test] [mode=node,language=dflt,script=arab, init=yes,medi=yes,fina=yes,isol=yes, liga=yes,dlig=yes,rlig=yes,clig=yes, mark=yes,mkmk=yes,kern=yes,curs=yes]
\font\TradArabic = Nadeem*test at 18pt
Can you try Microsofts Arabtype font: http://groups.msn.com/MicrosoftVOLTuserscommunity/homepage.msnw
\startbuffer[paragraph] الحمدلله حمد معترف بحمده، مغترف من بحار مجده، بلسان الثناۤء شاكرا، ولحسن الاۤئه ناشرا؛ الذي خلق الموت والحيوة، والخير والشر، والنفع والضر، والسكون والحركة، والأرواح والأجسام، والذكر والنسيان.
\blank
اَلْحَمْدُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ مَجْدِهٖ، بِلِسَانِ الثَّنَاۤءِ شَاكِرًا، وَلِحُسْنِ اٰلاۤئِهٖ نَاشِرًا؛ اَلَّذِيْ خَلَقَ الْمَوْتَ وَالْحَيٰوةَ، وَالْخَيْرَ وَالشَّرَّ، وَالنَّفْعَ وَالضَّرَّ، وَالسُّكُوْنَ وَالْحَرَكَةَ، وَالْأَرْوَاحَ وَالْأَجْسَامَ، وَالذِّكْرَ وَالنِّسْيَانَ.
\stopbuffer
\start \TradArabic \pardir TRT \textdir TRT \getbuffer[paragraph] \stop
\stoptext
Wolfgang
On 9 juin 08, at 11:23, Wolfgang Schuster wrote:
[…] What happens with the following setups from Idris.
\definefontfeature [test] [mode=node,language=dflt,script=arab, init=yes,medi=yes,fina=yes,isol=yes, liga=yes,dlig=yes,rlig=yes,clig=yes, mark=yes,mkmk=yes,kern=yes,curs=yes]
Hi Wolfgang, Thank you for your attention. However this is exactly what I did.
\font\TradArabic = Nadeem*test at 18pt
Can you try Microsofts Arabtype font: http://groups.msn.com/MicrosoftVOLTuserscommunity/homepage.msnw
I couldn't find the font you are mentioning: since I am on a Mac running Mac OS X 10.5.3, I am not sure whether the links there allows me to install such fonts. Also I think that the issue is related to LuaTeX, or at least to my installation of LuaTeX…, and so probably the issue is not related to the font, since XeTeX and XeConTeXt both typeset correctly the same text. Best regards: OK
On Mon, Jun 9, 2008 at 1:38 PM, Otared Kavian
Hi Wolfgang,
Thank you for your attention. However this is exactly what I did.
\font\TradArabic = Nadeem*test at 18pt
Hi Otared, I also tried with Nadeem, and I had exactly the same problem.
Can you try Microsofts Arabtype font: http://groups.msn.com/MicrosoftVOLTuserscommunity/homepage.msnw
I couldn't find the font you are mentioning: since I am on a Mac running Mac OS X 10.5.3, I am not sure whether the links there allows me to install such fonts.
I was looking for arabtype.ttf too, but I did not want to jump through the MS group registration hoops, in the end I settled for this file of the same name IIRC http://www.4shared.com/file/40464607/d4ea457f/arabtype.html?s=1 installing a ttf on mac os is a matter of double-clicking (font book opens), and pressing the "install font" button. The font ends up in ~/Library/Fonts :D Burak -- Burak Emir -- http://burak.emir.googlepages.com
On 9 juin 08, at 17:09, Burak Emir wrote:
[…] Hi Otared, I also tried with Nadeem, and I had exactly the same problem.
Hi Burak, Thank you for testing that font. As a matter of fact I am not especially attracted to that font, but for some reason, unknwon to me, it is the only one (in Arabic at least…) that LuaTeX can typeset without complaining about "metric not found" and such.
[…] installing a ttf on mac os is a matter of double-clicking (font book opens), and pressing the "install font" button. The font ends up in ~/Library/Fonts :D
Burak
Indeed… it so simple! But how should one let LuaTeX know about those fonts? Best regards: OK
Otared Kavian wrote:
Indeed… it so simple! But how should one let LuaTeX know about those fonts?
set the OSFONTDIR environment variable ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 9 juin 08, at 18:07, Hans Hagen wrote:
Otared Kavian wrote:
Indeed… it so simple! But how should one let LuaTeX know about those fonts?
set the OSFONTDIR environment variable
Many thanks Hans: indeed that's what I did export OSFONTDIR=Library/Fonts export OSFONTDIR=System/Library/Fonts luatools --generate and out of ignorance (whether is it OSFONTDIR or OSFONTSDIR…) I tried also export ODFONTSDIR=Library/Fonts export ODFONTSDIR=System/Library/Fonts luatools --generate but LuaTeX cannot find the fonts in the fonts directory of my system, issuing the error message (this is for the font suggested by Wolfgang S.): […] define font | font with name "Arabic Typesetting is not found define font | unknown font "Arabic Typesetting, loading aborted ! Font \TradArabic="Arabic Typesetting*test" at 18pt not loadable: metric data not found or bad. <to be read again> \par Best regards: OK
On Mon, Jun 9, 2008 at 6:43 PM, Otared Kavian wrote:
On 9 juin 08, at 18:07, Hans Hagen wrote:
Otared Kavian wrote:
Indeed… it so simple! But how should one let LuaTeX know about those fonts?
set the OSFONTDIR environment variable
Many thanks Hans: indeed that's what I did
export OSFONTDIR=Library/Fonts export OSFONTDIR=System/Library/Fonts luatools --generate
You need to use export OSFONTDIR=/Library/Fonts;/System/Library/Fonts;~/Library/Fonts Not sure if LuaTeX handles the tilde; in case it doesn't, put the whole path there. Mojca
On 9 juin 08, at 18:53, Mojca Miklavec wrote:
[…] You need to use export OSFONTDIR=/Library/Fonts;/System/Library/Fonts;~/Library/ Fonts
Not sure if LuaTeX handles the tilde; in case it doesn't, put the whole path there.
Mojca
Hi Mojca and all, As a matter of fact here is what I have in a file named "ok-lua" which is sourced upon loging in: export TEXMFCACHE="/tmp" export TEXMFCNF="{/usr/local/gwTeX/texmf/web2c/,/usr/local/gwTeX/}" export TEXMF="{/Users/kavian/Library/texmf,/usr/local/gwTeX/ texmf.local,/usr/local/gwTeX/texmf.pkgs,/usr/local/gwTeX/texmf.gwtex,/ usr/local/gwTeX/texmf.texlive,/usr/local/gwTeX/texmf}" export LUAINPUTS="{/usr/local/gwTeX/texmf.local/scripts/context/lua,/ usr/local/gwTeX/texmf.local/tex/context/base,/usr/local/gwTeX/ texmf.texlive/tex/context/base}" export OSFONTDIR="{/System/Library/Fonts;/Library/Fonts;/Users/kavian/ Library/Fonts}" But despite this LuaTeX doesn't find any arabic, system wide font. (The shell I use is bash: would thi sbe a cause?). Best regards: OK
Otared Kavian wrote:
On 9 juin 08, at 18:53, Mojca Miklavec wrote:
[…] You need to use export OSFONTDIR=/Library/Fonts;/System/Library/Fonts;~/Library/ Fonts
Not sure if LuaTeX handles the tilde; in case it doesn't, put the whole path there.
Mojca
Hi Mojca and all,
As a matter of fact here is what I have in a file named "ok-lua" which is sourced upon loging in:
export TEXMFCACHE="/tmp" export TEXMFCNF="{/usr/local/gwTeX/texmf/web2c/,/usr/local/gwTeX/}" export TEXMF="{/Users/kavian/Library/texmf,/usr/local/gwTeX/ texmf.local,/usr/local/gwTeX/texmf.pkgs,/usr/local/gwTeX/texmf.gwtex,/ usr/local/gwTeX/texmf.texlive,/usr/local/gwTeX/texmf}" export LUAINPUTS="{/usr/local/gwTeX/texmf.local/scripts/context/lua,/ usr/local/gwTeX/texmf.local/tex/context/base,/usr/local/gwTeX/ texmf.texlive/tex/context/base}" export OSFONTDIR="{/System/Library/Fonts;/Library/Fonts;/Users/kavian/ Library/Fonts}"
can you try: export OSFONTDIR="{/System/Library/Fonts;/Library/Fonts,/Users/kavian/ Library/Fonts}" comma, no ; ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
You need to use export OSFONTDIR=/Library/Fonts;/System/Library/Fonts;~/Library/ Fonts
Actually, I think the order of the directories should be slightly different ... if LuaTeX wants to blend in nicely with the Mac file system domains it should search for the fonts in the following order: OSFONTDIR = $HOME/Library/Fonts:/Library/Fonts:/System/Library/Fonts Oliver
Otared Kavian wrote:
On 9 juin 08, at 18:07, Hans Hagen wrote:
Otared Kavian wrote:
Indeed… it so simple! But how should one let LuaTeX know about those fonts? set the OSFONTDIR environment variable
Many thanks Hans: indeed that's what I did
export OSFONTDIR=Library/Fonts export OSFONTDIR=System/Library/Fonts luatools --generate
and out of ignorance (whether is it OSFONTDIR or OSFONTSDIR…) I tried also export ODFONTSDIR=Library/Fonts export ODFONTSDIR=System/Library/Fonts luatools --generate
but LuaTeX cannot find the fonts in the fonts directory of my system, issuing the error message (this is for the font suggested by Wolfgang S.): […] define font | font with name "Arabic Typesetting is not found define font | unknown font "Arabic Typesetting, loading aborted ! Font \TradArabic="Arabic Typesetting*test" at 18pt not loadable: metric data not found or bad. <to be read again> \par
if you want access by name ... mtxrun --script font --reload which will regenerate the database with names ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Mon, Jun 9, 2008 at 6:43 PM, Otared Kavian
On 9 juin 08, at 18:07, Hans Hagen wrote:
Otared Kavian wrote:
Indeed… it so simple! But how should one let LuaTeX know about those fonts?
set the OSFONTDIR environment variable
Many thanks Hans: indeed that's what I did
export OSFONTDIR=Library/Fonts export OSFONTDIR=System/Library/Fonts luatools --generate
Use /Users/
On Mon, Jun 09, 2008 at 11:13:06AM +0200, Otared Kavian wrote:
Dear all,
I just read the thread started by Burak Emir about "Typesetting Arabic today", and tried to typeset the sample sent by Idris Samawi Hamid. One of the Arabic or Persian fonts that I have and LuaTeX can find is Nadeem (working on Mac OS X 10.5.3), but what I get after typesetting is the following attached PDF: all the characters are typeset with their isolated form. However typestting the same text with XeConTeXt or XeTeX gives a nice result.
May be the font is built with AAT tables and not OpenType, XeTeX supports AAT on mac but I don't think LuaTeX does. Khaled
So my question is, what should I add or subtract from the font features parameters to get a correct result?
The source file is as follows:
% engine=luatex \starttext
\definefontfeature [test] [analyze=yes, mode=node, language=dflt, script=arab, aalt=yes, init=yes, medi=yes, fina=yes, isol=yes, liga=yes, mset=yes]
\font\TradArabic = Nadeem*test at 18pt
\startbuffer[paragraph] الحمدلله حمد معترف بحمده، مغترف من بحار مجده، بلسان الثناۤء شاكرا، ولحسن الاۤئه ناشرا؛ الذي خلق الموت والحيوة، والخير والشر، والنفع والضر، والسكون والحركة، والأرواح والأجسام، والذكر والنسيان.
\blank
اَلْحَمْدُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ مَجْدِهٖ، بِلِسَانِ الثَّنَاۤءِ شَاكِرًا، وَلِحُسْنِ اٰلاۤئِهٖ نَاشِرًا؛ اَلَّذِيْ خَلَقَ الْمَوْتَ وَالْحَيٰوةَ، وَالْخَيْرَ وَالشَّرَّ، وَالنَّفْعَ وَالضَّرَّ، وَالسُّكُوْنَ وَالْحَرَكَةَ، وَالْأَرْوَاحَ وَالْأَجْسَامَ، وَالذِّكْرَ وَالنِّسْيَانَ.
\stopbuffer
\start \TradArabic \pardir TRT \textdir TRT \getbuffer[paragraph] \stop
\stoptext
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- Khaled Hosny Arabic localizer and member of Arabeyes.org team
2008/6/9 Khaled Hosny
On Mon, Jun 09, 2008 at 11:13:06AM +0200, Otared Kavian wrote:
Dear all,
I just read the thread started by Burak Emir about "Typesetting Arabic today", and tried to typeset the sample sent by Idris Samawi Hamid. One of the Arabic or Persian fonts that I have and LuaTeX can find is Nadeem (working on Mac OS X 10.5.3), but what I get after typesetting is the following attached PDF: all the characters are typeset with their isolated form. However typestting the same text with XeConTeXt or XeTeX gives a nice result.
May be the font is built with AAT tables and not OpenType, XeTeX supports AAT on mac but I don't think LuaTeX does.
This seem to be the answer, take a look at http://neowiki.neooffice.org/index.php/Problems_with_Fonts#Problems_when_usi... Wolfgang
Dear Otared,
Salaam
On Mon, 09 Jun 2008 03:13:06 -0600, Otared Kavian
Dear all,
I just read the thread started by Burak Emir about "Typesetting Arabic today", and tried to typeset the sample sent by Idris Samawi Hamid. One of the Arabic or Persian fonts that I have and LuaTeX can find is Nadeem (working on Mac OS X 10.5.3), but what I get after typesetting is the following attached PDF: all the characters are typeset with their isolated form. However typestting the same text with XeConTeXt or XeTeX gives a nice result.
Can you privately me that font Nadeem please? 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
Hi Otared and all,
On Mon, 09 Jun 2008 03:13:06 -0600, Otared Kavian
I just read the thread started by Burak Emir about "Typesetting Arabic today", and tried to typeset the sample sent by Idris Samawi Hamid. One of the Arabic or Persian fonts that I have and LuaTeX can find is Nadeem (working on Mac OS X 10.5.3), but what I get after typesetting is the following attached PDF: all the characters are typeset with their isolated form. However typestting the same text with XeConTeXt or XeTeX gives a nice result.
As Khaled and Wolfgang already intimated, the problem is that Nadeem is not an OpenType font, but rather AAT. XeTeX is mainly Mac-based so it's natural that it supports AAT. It should not be too hard to overload GSUB and GPOS features for this particular font using the fea file overload feature of luatex (not sure if that has been fixed.) I looked at the AAT code, and saved an fea file using FontForge: but the contextual analysis is not there, so I suspect that AAT fonts depend on something like uniscribe for certain basic features. We (=Hans) need to know what that is. But at this stage of development, only pure OpenType fonts will be supported out of the box. For example: Traditional Arabic, which comes with XP, has OpenType tables but depends on Uniscribe instead of OpenType for, eg, making marks exceptions to the contextual analysis. Since the mark exception was not added to the GSUB table, voweled text appears unjoined in Trad. Arabic processed by luaTeX. I suppose we (=Hans) could add some "spell-checking" to the otf analyzer, but that's dangerous and needs some careful thought. Maybe we can come up with various "spell-checking" options that could be turned on and off, so that old-technology (Nadeem is 1998), platform-dependent (like Nadeem and Trad. Ar.) fonts can be used. In any case, we want to stay as platform-independent as possible. So for AAT, we may need to wait at least till someone (maybe one of you?) can come up with a spec so that we can implement a cross-platform solution for AAT. 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 Samawi Hamid wrote:
But at this stage of development, only pure OpenType fonts will be supported out of the box. For example: Traditional Arabic, which comes with XP, has OpenType tables but depends on Uniscribe instead of OpenType for, eg, making marks exceptions to the contextual analysis. Since the mark exception was not added to the GSUB table, voweled text appears unjoined in Trad. Arabic processed by luaTeX.
one problem there is that the open type spec is not always clear which in turn can mean that apps do things different or maybe even know how to deal with certain fonts; another problem is that there is no prescribed behaviour ... ok, some dtp app can claim that version n+3 supports this or that feature, or adapts automatically to this or that situations but if that's then the 'standard' there is no reason why version n+1 should not have supported it (or should have been tagged as bugged)
I suppose we (=Hans) could add some "spell-checking" to the otf analyzer, but that's dangerous and needs some careful thought. Maybe we can come up with various "spell-checking" options that could be turned on and off, so that old-technology (Nadeem is 1998), platform-dependent (like Nadeem and Trad. Ar.) fonts can be used.
we can add all kind of checking and compensation and make them pseudo features and then have them enabled based on info that we keep in a font database (like .. this font lacks this or that and therefore we need to enable such or so; of this feature in font foo is bugged so we disable it)
In any case, we want to stay as platform-independent as possible. So for AAT, we may need to wait at least till someone (maybe one of you?) can come up with a spec so that we can implement a cross-platform solution for AAT.
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (8)
-
Burak Emir
-
Hans Hagen
-
Idris Samawi Hamid
-
Khaled Hosny
-
Mojca Miklavec
-
Oliver Buerschaper
-
Otared Kavian
-
Wolfgang Schuster