On 6 janv. 09, at 10:53, Ilda Khaki wrote:
can someone send me a sample file to type farsi?
Hi Ilda, Here is a sample file for writing Faarsi with XeConTeXt (that is XeTeX + ConTeXt). In principle one can also use ConTeXt-mkiv, that is ConTeXt with the LuaTeX engine, but at this point I have not been able to solve some problems with the Persian fonts available. Best regards: OK
Otared Kavian wrote:
On 6 janv. 09, at 10:53, Ilda Khaki wrote:
can someone send me a sample file to type farsi?
Hi Ilda,
Here is a sample file for writing Faarsi with XeConTeXt (that is XeTeX + ConTeXt). In principle one can also use ConTeXt-mkiv, that is ConTeXt with the LuaTeX engine, but at this point I have not been able to solve some problems with the Persian fonts available.
i can look into it if i have samples + fonts + expected output a few remakrs concerning your test doc: \everypar={\setbox0=\lastbox \beginR \box0 } ^^ this is dangerous, either do this locally or use \EveryPar{...} otherwise you loose quite some functionality \font\title="X Kerman:script=arab" at 28pt \font\heading="X Kerman:script=arab" at 18pt \font\body="X Kerman:script=arab" at 10pt \body ^^^ don't use names for fonts that can conflict with existing macros ... \titlefont, \TitleFont etc are better choices \def\Hemi#1{% \start \beginR #1 \par \endR \stop} ^^ here you use a % to avoid a space \Hemi{ ای دل زجان گذر کن، تا جان جان ببینی } ^^ but here you introduce one (potentially, depends on the state tex's in) \stopnarrower \stoptext \endinput ^^ no endinput needed, since \stoptext ends the job already ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Otared Kavian wrote:
On 6 janv. 09, at 10:53, Ilda Khaki wrote:
can someone send me a sample file to type farsi?
Hi Ilda,
Here is a sample file for writing Faarsi with XeConTeXt (that is XeTeX + ConTeXt). In principle one can also use ConTeXt-mkiv, that is ConTeXt with the LuaTeX engine, but at this point I have not been able to solve some problems with the Persian fonts available.
mkiv variant \definefontfeature [arab-default] [mode=node,language=dflt,script=arab, init=yes,medi=yes,fina=yes,isol=yes, locl=yes,calt=yes,clig=yes,ccmp=yes, liga=yes,dlig=yes,rlig=yes,clig=yes, mark=yes,mkmk=yes,kern=yes,curs=yes] \definefont[testfont][arabtype*arab-default at 18pt] \definestartstop[Hemi][style=\textdir TRT\testfont] \starttext \setupalign[left] \startlines \Hemi{ای دل زجان گذر کن، تا جان جان ببینی} \Hemi{بگذار این جهان را، تا آن جهان ببینی} \Hemi{تا نگذری ز دنیا، هرگز رسی بعقبی؟} \Hemi{آزاد شو از اینجا، تا بی گمان ببینی} \Hemi{گر تو نشان بجویی، ای یار اندر این ره} \Hemi{از خویش بی نشان شو٬ تا تو نشان ببینی} \Hemi{از چار و پنج بگذر در شش و هفت منگر} \Hemi{چون از زمین برآیی، هفت آسمان ببینی} \Hemi{هفت آسمان چو دیدی درهشتمین فلک شو} \Hemi{پا برسر مکان نه، تا لا مکان ببینی} \Hemi{در لامکان چو دیدی جانهای نازنینان} \Hemi{بی تن نهاده سر ها، در آستان ببینی} \Hemi{بربند چشم دعوی، بگشای چشم معنی} \Hemi{یکدم زخود نهان شو، او را عیان ببینی} \Hemi{ای نانهاده گامی، در راه نامرادی} \Hemi{بی رنچ گنج وحدت، کی رایگان ببینی} \Hemi{هی های شمس تبریز، خاموش باش ناطق} \Hemi{تا جان خویشتن را، زان شادمان ببینی} \stoplines \stoptext ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Dear Hans, Thank your very much for your attention and your remarks about the sample Faarsi file I sent. Thanks also for your valuable time you spend on such questions from non experts… On 7 janv. 09, at 09:38, Hans Hagen wrote:
[…] i can look into it if i have samples + fonts + expected output
I uploaded a few fonts, as well as three sample tex files and the corresponding PDF outputs on http://www.kavian.fr/tex/mkiv-persian/ The files contain the same persian text with a few words in english in order to show how mkiv behaves wrongly compared with XeTeX and XeConTeXt (which are fine). It is possible that the fonts which are used are not totally compliant, but I don't see why XeTeX and XeConTeXt (that is XeTeX + ConTeXt mkii) give good outputs. To begin with, here are a couple of issues with mkiv: 1) When using "Arabic short vowels" such as U+064F (ARABIC DAMMA) U+0650 (ARABIC KASRA) U+0651 (ARABIC SHADDA) the ligatures between characters breaks down. For instance compare the typesetting of the following words in XeTeX, XeConTeXt and mkiv (actually, in mkiv, this wrong behavior depends also on the font…): مغان. مُغان. تولد. تَوّلد 2) With the font IranNastaliq, when in the midst of persian words one writes an english word, then the words after the english one are garbled in mkiv, while in XeTeX and XeConTeXt there is no such problem. With my best regards: OK
Otared Kavian wrote:
1) When using "Arabic short vowels" such as U+064F (ARABIC DAMMA) U+0650 (ARABIC KASRA) U+0651 (ARABIC SHADDA) the ligatures between characters breaks down. For instance compare the typesetting of the following words in XeTeX, XeConTeXt and mkiv (actually, in mkiv, this wrong behavior depends also on the font…):
مغان. مُغان. تولد. تَوّلد
can you test this with the alpha from our website? this afternoon taco and i deduced some logic from fontforge (we're currently not sure if al info is save right/available, for instance it seems to be possible to selectively ignore marks in matches, but we have no font that uses that) also, fonts are rather picky to what features are turned on by default (and there is no info in the font about what is supposed to be on by default) 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 -----------------------------------------------------------------
On 8 janv. 09, at 01:29, Hans Hagen wrote:
[…] […] can you test this with the alpha from our website?
Hi Hans, I compiled a brand new version of LuaTeX from the SVN repository, having now LuaTeX revision 0, (LuaTeX date stamp 2009010808), ConTeXt version 2008.11.10 21:40, This is LuaTeX, Version snapshot-0.32.0-2009010808, but the problem remains. Or have I misunderstood what you mean by "alpha from our ebsite"? Or is it that my ConTeXt version 2008.11.10 21:40 has to be updated? (The one I have is from the minimals on Contextgarden). Thank you again: OK
Otared Kavian wrote:
On 8 janv. 09, at 01:29, Hans Hagen wrote:
[…] […] can you test this with the alpha from our website?
Hi Hans,
I compiled a brand new version of LuaTeX from the SVN repository, having now LuaTeX revision 0, (LuaTeX date stamp 2009010808), ConTeXt version 2008.11.10 21:40, This is LuaTeX, Version snapshot-0.32.0-2009010808, but the problem remains. Or have I misunderstood what you mean by "alpha from our ebsite"? Or is it that my ConTeXt version 2008.11.10 21:40 has to be updated? (The one I have is from the minimals on Contextgarden).
It is useful to have the latest luatex as well, but Hans was certainly talking about the context release: http://www.pragma-ade.com/context/alpha/cont-tmf.zip Iirc, that alpha version is also usable via minimals, with a switch like --context-experimental or so (but I do not know exactly). Best wishes, Taco
On 8 janv. 09, at 09:13, Taco Hoekwater wrote:
Otared Kavian wrote:
On 8 janv. 09, at 01:29, Hans Hagen wrote:
[…] […] can you test this with the alpha from our website? Hi Hans, I compiled a brand new version of LuaTeX from the SVN repository, having now LuaTeX revision 0, (LuaTeX date stamp 2009010808), ConTeXt version 2008.11.10 21:40, This is LuaTeX, Version snapshot-0.32.0-2009010808, but the problem remains. Or have I misunderstood what you mean by "alpha from our ebsite"? Or is it that my ConTeXt version 2008.11.10 21:40 has to be updated? (The one I have is from the minimals on Contextgarden).
It is useful to have the latest luatex as well, but Hans was certainly talking about the context release:
http://www.pragma-ade.com/context/alpha/cont-tmf.zip
Iirc, that alpha version is also usable via minimals, with a switch like --context-experimental or so (but I do not know exactly).
Best wishes, Taco
Hi Taco, Thanks for the hint. I did install a new directory with the alpha version (using the key --context-experimental, and in another directory with the key --context=alpha) together with the latest LuaTeX which I compiled from the SVN repository. However I get this (trying for instance context --make): […] LuaTools | running command: luatex --ini --lua="plain.luc" "/Volumes/ OK-10.4/context-minimal/alpha/tex/texmf/tex/plain/base/plain.tex" \\dump ?:0: attempt to index global 'trackers' (a nil value) LuaTools | LuaTools | runtime: 0.210 seconds MtxRun | total runtime: 0.898 and trying to typeset a basic file results in: ...638d8f1fcc981c391b85bb7e80b0dd82/formats/cont-en.lua:3252: attempt to index global 'trackers' (a nil value) MtxRun | loading configuration for /Volumes/OK-10.4/context-minimal/ alpha/tex/texmf/web2c from /Volumes/OK-10.4/context-minimal/alpha/tex/ texmf-cache/luatex-cache/context/638d8f1fcc981c391b85bb7e80b0dd82/ trees/682fff8caf3d61973c170a6f807cbed7 MtxRun | run 1: luatex --fmt="/Volumes/OK-10.4/context-minimal/alpha/ tex/texmf-cache/luatex-cache/context/638d8f1fcc981c391b85bb7e80b0dd82/ formats/cont-en" --lua="/Volumes/OK-10.4/context-minimal/alpha/tex/ texmf-cache/luatex-cache/context/638d8f1fcc981c391b85bb7e80b0dd82/ formats/cont-en.lua" "./basic-test.tex" MtxRun | fatal error, code: 1 The versions I have now are: ConTeXt: current version: 2009.01.08 01:38 LuaTeX: Version snapshot-0.32.0-2009010808 Best regards: OK
Am 08.01.2009 um 11:44 schrieb Otared Kavian:
Hi Taco,
Thanks for the hint. I did install a new directory with the alpha version (using the key --context-experimental, and in another directory with the key --context=alpha) together with the latest LuaTeX which I compiled from the SVN repository.
However I get this (trying for instance context --make):
[…] LuaTools | running command: luatex --ini --lua="plain.luc" "/Volumes/ OK-10.4/context-minimal/alpha/tex/texmf/tex/plain/base/plain.tex" \ \dump
?:0: attempt to index global 'trackers' (a nil value) LuaTools | LuaTools | runtime: 0.210 seconds
luatools --selfupdate mtxrun --selfupdate Wolfgang
On Thu, Jan 8, 2009 at 9:13 AM, Taco Hoekwater wrote:
Otared Kavian wrote:
It is useful to have the latest luatex as well, but Hans was certainly talking about the context release:
http://www.pragma-ade.com/context/alpha/cont-tmf.zip
Iirc, that alpha version is also usable via minimals, with a switch like --context-experimental or so (but I do not know exactly).
The true alpha (http://www.pragma-ade.com/context/alpha/cont-tmf.zip) is accessible via --context=alpha but Hans almost never uses/uploads it (so most of the time that one will resolve to beta or current if there is no beta). The version 'experimental' equals the 'taco' version, I think. (= The one that is being updated more frequently than you can download from the server.) Mojca
Mojca Miklavec wrote:
On Thu, Jan 8, 2009 at 9:13 AM, Taco Hoekwater wrote:
Otared Kavian wrote:
It is useful to have the latest luatex as well, but Hans was certainly talking about the context release:
http://www.pragma-ade.com/context/alpha/cont-tmf.zip
Iirc, that alpha version is also usable via minimals, with a switch like --context-experimental or so (but I do not know exactly).
The true alpha (http://www.pragma-ade.com/context/alpha/cont-tmf.zip) is accessible via --context=alpha but Hans almost never uses/uploads it (so most of the time that one will resolve to beta or current if there is no beta).
That's the one Otared needs. When Hans announces an alpha on the mailing list, it is that one.
The version 'experimental' equals the 'taco' version, I think. (= The one that is being updated more frequently than you can download from the server.)
Those are the ones on the private ftp site. A few people have access, but the code there usually only works for Hans and me ;-) Best wishes, Taco
Is it possible to import functionalities of XePersian into ConTeXt. Xepersian now is excellent in Persian typesetting and you can do all you want in Persian typography. but I hate LaTeX. its main author unfortunately is anti-ConTeXt.
Ilda Khaki wrote:
Is it possible to import functionalities of XePersian into ConTeXt. Xepersian now is excellent in Persian typesetting and you can do all you want in Persian typography. but I hate LaTeX. its main author unfortunately is anti-ConTeXt.
i have no clue what xepersian is but if you can describe what you want (and coordinate with idris cum suis) i can look into it; 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 -----------------------------------------------------------------
No, Xepersian is a macro package for xelatex. MKIV is also excellent for
typesseting persian.
You can use the following module for persian or arabic
%-------------------------persian-env.tex-----------------------------------
%This file is designed by Mehdi Omidali for easy typesetting persian in
Context
%File Versin:2008-7-20
\startenvironment persian-env
\usemodule[lang-pe]
\mainlanguage[pe]
% Font setup
\definefontfeature
[persian]
[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]
\starttypescript [serif] [persian]
\definefontsynonym [Persian-Regular] [name:XB Zar.ttf] [features=persian]
\definefontsynonym [Persian-Bold] [name:XB Zar Bd.ttf] [features=persian]
\definefontsynonym [Persian-Italic] [name:XB Zar It.ttf] [features=persian]
\definefontsynonym [Persian-BoldItalic] [name:XB Zar BdIt.ttf]
[features=persian]
\stoptypescript
\starttypescript [sans] [persian]
\definefontsynonym [Persian-Regular-sans] [name:XM Traffic.ttf]
[features=persian]
\definefontsynonym [Persian-Bold-sans] [name:XM Traffic Bd.ttf]
[features=persian]
\definefontsynonym [Persian-Italic-sans] [name:XM Traffic It.ttf]
[features=persian]
\definefontsynonym [Persian-BoldItalic-sans] [name:XM Traffic BdIt.ttf]
[features=persian]
\stoptypescript
\starttypescript [mono] [persian]
\definefontsynonym [Persian-Regular-mono] [name:XB Roya.ttf]
[features=persian]
\definefontsynonym [Persian-Bold-mono] [name:XB Roya Bd.ttf]
[features=persian]
\definefontsynonym [Persian-Italic-mono] [name:XB Roya It.ttf]
[features=persian]
\definefontsynonym [Persian-BoldItalic-mono] [name:XB Roya BdIt.ttf]
[features=persian]
\stoptypescript
\starttypescript [serif][persian][name]
\usetypescript[serif][persian]
\definefontsynonym [Serif] [Persian-Regular] [features=persian]
\definefontsynonym [SerifBold] [Persian-Bold] [features=persian]
\definefontsynonym [SerifItalic] [Persian-Italic] [features=persian]
\definefontsynonym [SerifBoldItalic] [Persian-BoldItalic] [features=persian]
\stoptypescript
\starttypescript [sans][persian][name]
\usetypescript[sans][persian]
\definefontsynonym [Sans] [Persian-Regular-sans] [features=persian]
\definefontsynonym [SansBold] [Persian-Bold-sans] [features=persian]
\definefontsynonym [SansItalic] [Persian-Italic-sans] [features=persian]
\definefontsynonym [SansBoldItalic] [Persian-BoldItalic-sans]
[features=persian]
\stoptypescript
\starttypescript [mono][persian][name]
\usetypescript[mono][persian]
\definefontsynonym [Mono] [Persian-Regular-mono] [features=persian]
\definefontsynonym [MonoBold] [Persian-Bold-mono] [features=persian]
\definefontsynonym [MonoItalic] [Persian-Italic-mono] [features=persian]
\definefontsynonym [MonoBoldItalic] [Persian-BoldItalic-mono]
[features=persian]
\stoptypescript
\starttypescript [Persian]
\definetypeface[Persian][rm][serif][persian][default]
\definetypeface[Persian][rm][sans][persian][default]
\definetypeface[Persian][rm][mono][persian][default]
\stoptypescript
\def\PersianGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT}
\def\PersianParDir {\textdir TRT\pardir TRT}
\def\PersianTextDir {\textdir TRT}
\def\LatinParDir {\textdir TLT\pardir TLT}
\def\LatinTextDir {\textdir TLT}
\def\LatinGlobalDir {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT}
\definestartstop[persiandocument][commands={\usetypescript[Persian]%
\setupbodyfont[Persian,12pt]%
\PersianGlobalDir}]
\definestartstop
[persianpar]
[commands=\Persian\PersianParDir]
\define[1]\RT
{{\Persian\PersianTextDir#1}}
\define\setlatin
{\LatinGlobalDir%
\usetypescript[lm]%
\setupbodyfont[lm,18pt]}
\definestartstop
[latinpar]
[commands=\Persian\LatinParDir]
\define[1]\LT
{{\LatinTextDir#1}}
% \setuphead
% [chapter]
% [ page=yes,
% before=\hairline\blank,
% after=\nowhitespace\hairline,
% header=nomarking,
% textstyle=bold,
% numberstyle=bold,
% ]
\setupheads[separator=\LT{--}]
\setupheadertexts[]%We put here because we want to define headertexts next.
\setupheadertexts[][pagenumber]
\setupsection [chapter][conversion=persiannumerals]
\setupsection [section][conversion=persiannumerals]
\setupsection [subsection][conversion=persiannumerals]
\setupsection [subsubsection][conversion=persiannumerals]
\setupfootnotes[conversion=persiannumerals]
\setupnumbering[conversion=persiannumerals]
\setupformulas[conversion=persiannumerals]
\setuppagenumbering[conversion=persiannumerals]
\setupcaptions[conversion=persiannumerals]
\setupdirections[bidi=global]
\stopenvironment
---------------------------------------------end--------------------
A sample is this
%%%%%%%%sample.tex%%%%%%%%%%%
\starttext
\startpersiandocument
من بی می ناب زیستن نتوانم
بی باده کشید بار تن نتوانم
\placeformula[Eq:eq1]$$x^2+2x$$
\stoppersiandocument
\stoptext
On 1/9/09, Hans Hagen
Ilda Khaki wrote:
Is it possible to import functionalities of XePersian into ConTeXt. Xepersian now is excellent in Persian typesetting and you can do all you want in Persian typography. but I hate LaTeX. its main author unfortunately is anti-ConTeXt.
i have no clue what xepersian is but if you can describe what you want (and coordinate with idris cum suis) i can look into it;
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 -----------------------------------------------------------------
___________________________________________________________________________________ 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
___________________________________________________________________________________
I resend the file %-------------------------persian-env.tex----------------------------------- %This file is designed by Mehdi Omidali for easy typesetting persian in Context %File Versin:2008-7-20 \startenvironment persian-env \usemodule[lang-pe] \mainlanguage[pe] % Font setup \definefontfeature [persian] [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] \starttypescript [serif] [persian] \definefontsynonym [Persian-Regular] [name:XB Zar.ttf] [features=persian] \definefontsynonym [Persian-Bold] [name:XB Zar Bd.ttf] [features=persian] \definefontsynonym [Persian-Italic] [name:XB Zar It.ttf] [features=persian] \definefontsynonym [Persian-BoldItalic] [name:XB Zar BdIt.ttf] [features=persian] \stoptypescript \starttypescript [sans] [persian] \definefontsynonym [Persian-Regular-sans] [name:XM Traffic.ttf] [features=persian] \definefontsynonym [Persian-Bold-sans] [name:XM Traffic Bd.ttf] [features=persian] \definefontsynonym [Persian-Italic-sans] [name:XM Traffic It.ttf] [features=persian] \definefontsynonym [Persian-BoldItalic-sans] [name:XM Traffic BdIt.ttf] [features=persian] \stoptypescript \starttypescript [mono] [persian] \definefontsynonym [Persian-Regular-mono] [name:XB Roya.ttf] [features=persian] \definefontsynonym [Persian-Bold-mono] [name:XB Roya Bd.ttf] [features=persian] \definefontsynonym [Persian-Italic-mono] [name:XB Roya It.ttf] [features=persian] \definefontsynonym [Persian-BoldItalic-mono] [name:XB Roya BdIt.ttf] [features=persian] \stoptypescript \starttypescript [serif][persian][name] \usetypescript[serif][persian] \definefontsynonym [Serif] [Persian-Regular] [features=persian] \definefontsynonym [SerifBold] [Persian-Bold] [features=persian] \definefontsynonym [SerifItalic] [Persian-Italic] [features=persian] \definefontsynonym [SerifBoldItalic] [Persian-BoldItalic] [features=persian] \stoptypescript \starttypescript [sans][persian][name] \usetypescript[sans][persian] \definefontsynonym [Sans] [Persian-Regular-sans] [features=persian] \definefontsynonym [SansBold] [Persian-Bold-sans] [features=persian] \definefontsynonym [SansItalic] [Persian-Italic-sans] [features=persian] \definefontsynonym [SansBoldItalic] [Persian-BoldItalic-sans] [features=persian] \stoptypescript \starttypescript [mono][persian][name] \usetypescript[mono][persian] \definefontsynonym [Mono] [Persian-Regular-mono] [features=persian] \definefontsynonym [MonoBold] [Persian-Bold-mono] [features=persian] \definefontsynonym [MonoItalic] [Persian-Italic-mono] [features=persian] \definefontsynonym [MonoBoldItalic] [Persian-BoldItalic-mono] [features=persian] \stoptypescript \starttypescript [Persian] \definetypeface[Persian][rm][serif][persian][default] \definetypeface[Persian][rm][sans][persian][default] \definetypeface[Persian][rm][mono][persian][default] \stoptypescript \def\PersianGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT} \def\PersianParDir {\textdir TRT\pardir TRT} \def\PersianTextDir {\textdir TRT} \def\LatinParDir {\textdir TLT\pardir TLT} \def\LatinTextDir {\textdir TLT} \def\LatinGlobalDir {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT} \definestartstop[persiandocument][commands={\usetypescript[Persian]% \setupbodyfont[Persian,12pt]% \PersianGlobalDir}] \definestartstop [persianpar] [commands=\Persian\PersianParDir] \define[1]\RT {{\Persian\PersianTextDir#1}} \define\setlatin {\LatinGlobalDir% \usetypescript[lm]% \setupbodyfont[lm,18pt]} \definestartstop [latinpar] [commands=\Persian\LatinParDir] \define[1]\LT {{\LatinTextDir#1}} % \setuphead % [chapter] % [ page=yes, % before=\hairline\blank, % after=\nowhitespace\hairline, % header=nomarking, % textstyle=bold, % numberstyle=bold, % ] \setupheads[separator=\LT{--}] \setupheadertexts[]%We put here because we want to define headertexts next. %\setupheadertexts[][pagenumber] \setupsection [chapter][conversion=persiannumerals] \setupsection [section][conversion=persiannumerals] \setupsection [subsection][conversion=persiannumerals] \setupsection [subsubsection][conversion=persiannumerals] \setupfootnotes[conversion=persiannumerals] \setupnumbering[conversion=persiannumerals] \setupformulas[conversion=persiannumerals] \setuppagenumbering[conversion=persiannumerals] \setupcaptions[conversion=persiannumerals] \setupwhitespace[none] \setupdirections[bidi=global] \stopenvironment ---------------------------------------------end--------------------
Sorry, something is wrong with my email setting. %-------------------------persian-env.tex----------------------------------- %This file is designed by Mehdi Omidali for easy typesetting persian in Context %File Versin:2008-7-20 \startenvironment persian-env \usemodule[lang-pe] \mainlanguage[pe] % Font setup \definefontfeature [persian] [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] \starttypescript [serif] [persian] \definefontsynonym [Persian-Regular] [name:XB Zar.ttf] [features=persian] \definefontsynonym [Persian-Bold] [name:XB Zar Bd.ttf] [features=persian] \definefontsynonym [Persian-Italic] [name:XB Zar It.ttf] [features=persian] \definefontsynonym [Persian-BoldItalic] [name:XB Zar BdIt.ttf] [features=persian] \stoptypescript \starttypescript [sans] [persian] \definefontsynonym [Persian-Regular-sans] [name:XM Traffic.ttf] [features=persian] \definefontsynonym [Persian-Bold-sans] [name:XM Traffic Bd.ttf] [features=persian] \definefontsynonym [Persian-Italic-sans] [name:XM Traffic It.ttf] [features=persian] \definefontsynonym [Persian-BoldItalic-sans] [name:XM Traffic BdIt.ttf] [features=persian] \stoptypescript \starttypescript [mono] [persian] \definefontsynonym [Persian-Regular-mono] [name:XB Roya.ttf] [features=persian] \definefontsynonym [Persian-Bold-mono] [name:XB Roya Bd.ttf] [features=persian] \definefontsynonym [Persian-Italic-mono] [name:XB Roya It.ttf] [features=persian] \definefontsynonym [Persian-BoldItalic-mono] [name:XB Roya BdIt.ttf] [features=persian] \stoptypescript \starttypescript [serif][persian][name] \usetypescript[serif][persian] \definefontsynonym [Serif] [Persian-Regular] [features=persian] \definefontsynonym [SerifBold] [Persian-Bold] [features=persian] \definefontsynonym [SerifItalic] [Persian-Italic] [features=persian] \definefontsynonym [SerifBoldItalic] [Persian-BoldItalic] [features=persian] \stoptypescript \starttypescript [sans][persian][name] \usetypescript[sans][persian] \definefontsynonym [Sans] [Persian-Regular-sans] [features=persian] \definefontsynonym [SansBold] [Persian-Bold-sans] [features=persian] \definefontsynonym [SansItalic] [Persian-Italic-sans] [features=persian] \definefontsynonym [SansBoldItalic] [Persian-BoldItalic-sans] [features=persian] \stoptypescript \starttypescript [mono][persian][name] \usetypescript[mono][persian] \definefontsynonym [Mono] [Persian-Regular-mono] [features=persian] \definefontsynonym [MonoBold] [Persian-Bold-mono] [features=persian] \definefontsynonym [MonoItalic] [Persian-Italic-mono] [features=persian] \definefontsynonym [MonoBoldItalic] [Persian-BoldItalic-mono] [features=persian] \stoptypescript \starttypescript [Persian] \definetypeface[Persian][rm][serif][persian][default] \definetypeface[Persian][rm][sans][persian][default] \definetypeface[Persian][rm][mono][persian][default] \stoptypescript \def\PersianGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT} \def\PersianParDir {\textdir TRT\pardir TRT} \def\PersianTextDir {\textdir TRT} \def\LatinParDir {\textdir TLT\pardir TLT} \def\LatinTextDir {\textdir TLT} \def\LatinGlobalDir {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT} \definestartstop[persiandocument][commands={\usetypescript[Persian]% \setupbodyfont[Persian,12pt]% \PersianGlobalDir}] \definestartstop [persianpar] [commands=\Persian\PersianParDir] \define[1]\RT {{\Persian\PersianTextDir#1}} \define\setlatin {\LatinGlobalDir% \usetypescript[lm]% \setupbodyfont[lm,18pt]} \definestartstop [latinpar] [commands=\Persian\LatinParDir] \define[1]\LT {{\LatinTextDir#1}} % \setuphead % [chapter] % [ page=yes, % before=\hairline\blank, % after=\nowhitespace\hairline, % header=nomarking, % textstyle=bold, % numberstyle=bold, % ] \setupheads[separator=\LT{--}] \setupheadertexts[]%We put here because we want to define headertexts next. %\setupheadertexts[][pagenumber] \setupsection [chapter][conversion=persiannumerals] \setupsection [section][conversion=persiannumerals] \setupsection [subsection][conversion=persiannumerals] \setupsection [subsubsection][conversion=persiannumerals] \setupfootnotes[conversion=persiannumerals] \setupnumbering[conversion=persiannumerals] \setupformulas[conversion=persiannumerals] \setuppagenumbering[conversion=persiannumerals] \setupcaptions[conversion=persiannumerals] \setupwhitespace[none] \setupdirections[bidi=global] \stopenvironment ---------------------------------------------end--------------------
And here is lang-pe.tex %%%%%%%%%%%%% %-----------------------------lang-pe.tex------------------------------------ \writestatus{loading}{Persian Languages} \unprotect \setupheadtext [content=فهرست مطالب] \setupheadtext [tables=ليست جداول] \setupheadtext [figures=ليست تصاوير] \setupheadtext [graphics=ليست اشکال] \setupheadtext [index=نمايه] \setupheadtext [abbreviations=اختصارات] \setupheadtext [units=واحدها] \setuplabeltext [table=جدول ] \setuplabeltext [figure=شكل ] \setuplabeltext [graphic=طرح ] %D We don't set these here. One can do that in a style. \setuplabeltext [chapter=فصل ] % Chapter \setuplabeltext [section=بخش ] \setuplabeltext [subsection=زيربخش ] \setuplabeltext [subsubsection=زيرزيربخش ] \setuplabeltext [subsubsubsection=زيرزيرزيربخش ] \setuplabeltext [appendix=پيوست ] % Appendix \setuplabeltext [part=قسمت ] \setuplabeltext [line=خط ] \setuplabeltext [lines=خطهاي ] \setuplabeltext [january=ژانويه] \setuplabeltext [february=فوريه] \setuplabeltext [march=مارس] \setuplabeltext [april=آوريل] \setuplabeltext [may=مي] \setuplabeltext [june=ژوئن] \setuplabeltext [july=ژوييه] \setuplabeltext [august=آگوست] \setuplabeltext [september=سپتامبر] \setuplabeltext [october=اکتبر] \setuplabeltext [november=نوامبر] \setuplabeltext [december=دسامبر] \setuplabeltext [sunday=يکشنبه] \setuplabeltext [monday=دوشنبه] \setuplabeltext [tuesday=سهشنبه] \setuplabeltext [wednesday=چهارشنبه] \setuplabeltext [thursday=پنجشنبه] \setuplabeltext [friday=جمعه] \setuplabeltext [saturday=شنبه] %D Rather new ... \setuplabeltext [page=صفحه] \setuplabeltext [atpage=در صفحهٔ ] %\setuplabeltext [hencefore=كما وضحنا سابقا] %\setuplabeltext [hereafter=كما نوضح لاحقا] \setuplabeltext [see=نگاه کنيد به] %D ... and to be completed! \protect \endinput %-----------------------------end----------------------------
thanks. but this file looks like a textbook. it is too long. can not be shorter? I have not tried your sample but 1) will this produce farsi maths? (2) I want irani date, is it possible? (3) From otared samples, i can see that luatex can not handle fonts well, is the issue solved? 4) how footnote rules are? 5) can I make a farsi presentation?6) can I create farsi magazine? 7) does this work with beamer?
Ilda Khaki wrote:
thanks. but this file looks like a textbook. it is too long. can not be shorter? I have not tried your sample but 1) will this produce farsi maths? (2) I want irani date, is it possible? (3) From otared samples, i can see that luatex can not handle fonts well, is the issue solved? 4) how footnote rules are? 5) can I make a farsi presentation?6) can I create farsi magazine? 7) does this work with beamer?
(1) what is farsi math ... what makes it special? (2) one can plug in converters (it might already be there) (3) it's not an luatex issue since it only provides the mechanisms, but afaik context/mkiv can do a reasonable job (4) i dunno, this is a layout issue and i cannot implement something specific if i have no specs (5) sure, not special about presentations (6) sure (7) no, because it's not latex anyhow, handling farsi boils down to: - fonts: these should work ok and if not, we can solve it given examples and fonts - layouts: you need to communicate that with idris since he's in charge of investigating specific features needed for r/l typesetting; it's mostly a configuration issue, but i can imagine some more r/l direction keys (in that respect i'd rather not talk about farsi but more in general terms of lr vs rl typesetting/layout) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
1) numbers in maths formula is Persian, possible? 2) is it hard to write a converter? 4) there are two footnote commands. one for persian and one for english. persian footnotes will be on left and persian footnotes on right. also if the first footnote in a page is persian, footnote rule is on the right and if first footnote is english, footnote rule is on left. who is idris?
In Luatex one can define font for math equations. So it is possible to have
persian numerals in math formulas. But for Jalali calendar we have to write
a macro (maybe Idris has done this). Font handling: currently luatex can not
handle IranNastliq font but other fonts are ok. About footnote rule:
\pagedir TRT makes everithing from right to left so the footnoterule is in
the right position; but for an automatic footnoterule I will do that via lua
in the future. Now I am very busy with the translation of "context an
excursion" and the persian interface.
The module is the one that I am using for the translation of "Context an
excursion" and it is suitable thought not complete.
On Fri, Jan 9, 2009 at 2:57 PM, Ilda Khaki
1) numbers in maths formula is Persian, possible?
2) is it hard to write a converter?
4) there are two footnote commands. one for persian and one for english. persian footnotes will be on left and persian footnotes on right. also if the first footnote in a page is persian, footnote rule is on the right and if first footnote is english, footnote rule is on left.
who is idris?
___________________________________________________________________________________ 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
___________________________________________________________________________________
Mehdi Omidali wrote:
In Luatex one can define font for math equations. So it is possible to have persian numerals in math formulas. But for Jalali calendar we have to write a macro (maybe Idris has done this). Font handling: currently luatex can not handle IranNastliq font but other fonts are ok. About
so maybe that font is broken?
footnote rule: \pagedir TRT makes everithing from right to left so the footnoterule is in the right position; but for an automatic footnoterule
footnotes will be done differently in mkiv so best wait with patching till we have the new structure code in place (which reminds me that we also need to store directional info with info that is traveling around] 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 -----------------------------------------------------------------
Hans Hagen wrote:
Mehdi Omidali wrote:
In Luatex one can define font for math equations. So it is possible to have persian numerals in math formulas. But for Jalali calendar we have to write a macro (maybe Idris has done this). Font handling: currently luatex can not handle IranNastliq font but other fonts are ok. About
so maybe that font is broken?
The font is mentioned in the wiki page http://wiki.contextgarden.net/Arabic_fonts#Iran_Nastaliq so it could be a regression in the latest luatex. I cannot test myself because the font download link is broken... Best wishes, Taco
Please download the font from
www.omidali.com/Fonts/IranNastaliq.rar
On 1/9/09, Taco Hoekwater
Hans Hagen wrote:
Mehdi Omidali wrote:
In Luatex one can define font for math equations. So it is possible to have persian numerals in math formulas. But for Jalali calendar we have to write a macro (maybe Idris has done this). Font handling: currently luatex can not handle IranNastliq font but other fonts are ok. About
so maybe that font is broken?
The font is mentioned in the wiki page
http://wiki.contextgarden.net/Arabic_fonts#Iran_Nastaliq
so it could be a regression in the latest luatex. I cannot test myself because the font download link is broken...
Best wishes, Taco
___________________________________________________________________________________ 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 ___________________________________________________________________________________
Very Good news. Thanks.
On Fri, Jan 9, 2009 at 5:58 PM, Taco Hoekwater
Mehdi Omidali wrote:
Please download the font from www.omidali.com/Fonts/IranNastaliq.rar
Found it (and we found the associated bug in font-otf.lua also).
Best wishes, Taco
___________________________________________________________________________________ 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
___________________________________________________________________________________
Ilda Khaki wrote:
1) numbers in maths formula is Persian, possible?
luatex will have unicode math and then we can look into that (it does not make sense to do that in traditional tex math)
2) is it hard to write a converter?
no, it's done in core-con.lua etc
4) there are two footnote commands. one for persian and one for english. persian footnotes will be on left and persian footnotes on right. also if the first footnote in a page is persian, footnote rule is on the right and if first footnote is english, footnote rule is on left.
is that persian or general rl ?
who is idris?
Idris Samawi Hamid
Mehdi Omidali wrote:
And here is lang-pe.tex
if i need to add/patch things, just send me the files directly 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)
-
Hans Hagen
-
Ilda Khaki
-
Khaled Hosny
-
Mehdi Omidali
-
Mojca Miklavec
-
Otared Kavian
-
Taco Hoekwater
-
Wolfgang Schuster