Re: [NTG-context] How to use "fontsampler example" with Persian font

2016-10-12 Thread Mingranina Gingranina
Dear Mohammad,
Hello,

\pagenumbering is not defined or redined in XePersian. In fact, in
TeXLive 2016, it is only defined in the following files:

texmf-dist/tex/latex/base/latex.ltx
texmf-dist/tex/latex/feupphdteses/feupphdteses.sty
texmf-dist/tex/latex/kluwer/kluedit.sty
texmf-dist/tex/latex/kluwer/kluwer.cls
texmf-dist/tex/latex/pdfwin/pdfwin.sty
texmf-dist/tex/latex/romanneg/romanneg.sty
texmf-dist/tex/plain/gustlib/plmac218/plidxmac.tex
texmf-dist/tex/plain/makeindex/idxmac.tex

I think it would be better to look at arabluatex's code for solving the problem.

Regards,
Mingranina

On 10/11/16, Mohammad Hossein Bateni <bat...@gmail.com> wrote:
> This seems to not belong in the ConTeXt mailing list.  You'd be better off
> asking it on Stack Exchange or on luatex mailing list.  The short answer is
> it depends on the "format file" (and perhaps the LaTeX packages) you're
> using.  Most probably, you either use "plain" or "latex", and then you
> should see how they generate the page numbers and define a macro that
> provides the Persian numbers, etc.  See how XePersian package handles it.
>  (Search for \pagenumbering.)
>
> On Mon, Oct 10, 2016 at 11:44 PM, Mingranina Gingranina <
> mingran...@gmail.com> wrote:
>
>> Dear Wolfgang
>>  Hello,
>>
>> First of all, let me thank you very much for your informative answer.
>>
>> On 10/10/16, Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote:
>> >> Mingranina Gingranina <mailto:mingran...@gmail.com>
>> >> 7. Oktober 2016 um 17:41
>> >> Dear Mohammad,
>> >> Hi,
>> >>
>> >> Thank you very much for your reply. I forgot to mention that I had
>> >> modified the fontsampler codes so that I can use it in ConTeXt with
>> >> Dabeer module.
>> > 1. What is Dabeer?
>>
>> It is a module for Persian typesetting in ConTeXt. Please see:
>> https://github.com/bateni/dabeer
>>
>> >
>> > 2. You can access the list of known fonts with the "fonts.names.list"
>> > function:
>> >
>> > \setuppapersize[A4,landscape]
>> >
>> > \starttext
>> >
>> > \startluacode
>> >
>> > local fontlist = fonts.names.list("",true,true)
>> >
>> > context.starttabulate({"|l|l|"})
>> > for fontname, fontentry in next, fontlist do
>> >  context.NC()
>> >  context(fontentry["rawname"])
>> >  context.NC()
>> >  context(fontentry["filename"])
>> >  context.NC()
>> >  context.NR()
>> > end
>> > context.stoptabulate()
>> >
>> > \stopluacode
>> >
>> > \stoptext
>> >> However, inspired by your reply I could get it to work in LuaTeX but
>> >> not in ConTeXt with Dabeer module.
>> >>
>> >> Are there any other set of features that I can test?
>> > ConTeXt inludes a few modules which can be used to show font
>> > information
>> > (search for s-fonts-*.mkiv|mkvi and s-math-*.mkiv|mkvi), below is a
>> > example from s-fonts-tables.mkiv:
>> >
>> > \usemodule[fonts-tables]
>> >
>> > \setupbodyfont[pagella]
>> >
>> > \starttext
>> > \showfonttables[title={TeX Gyre Pagella}]
>> > \stoptext
>>
>> I am a novice in LuaTeX and ConTeXt and to learn these I tried to
>> modify FontSampler code (http://wiki.luatex.org/index.php/Fontsampler)
>> to get a sample of Persian fonts in a directory hierarchy too.
>>
>> BTW, at the moment my problem with LuaTeX is that the page numbering
>> is in english. Do you know how to change the page numbering to Persian
>> in LuaTeX?
>>
>>  Thanks,
>>  Mingranina
>> 
>> ___
>> 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://context.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://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] How to use "fontsampler example" with Persian font

2016-10-10 Thread Mingranina Gingranina
Dear Wolfgang
 Hello,

First of all, let me thank you very much for your informative answer.

On 10/10/16, Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote:
>> Mingranina Gingranina <mailto:mingran...@gmail.com>
>> 7. Oktober 2016 um 17:41
>> Dear Mohammad,
>> Hi,
>>
>> Thank you very much for your reply. I forgot to mention that I had
>> modified the fontsampler codes so that I can use it in ConTeXt with
>> Dabeer module.
> 1. What is Dabeer?

It is a module for Persian typesetting in ConTeXt. Please see:
https://github.com/bateni/dabeer

>
> 2. You can access the list of known fonts with the "fonts.names.list"
> function:
>
> \setuppapersize[A4,landscape]
>
> \starttext
>
> \startluacode
>
> local fontlist = fonts.names.list("",true,true)
>
> context.starttabulate({"|l|l|"})
> for fontname, fontentry in next, fontlist do
>  context.NC()
>  context(fontentry["rawname"])
>  context.NC()
>  context(fontentry["filename"])
>  context.NC()
>  context.NR()
> end
> context.stoptabulate()
>
> \stopluacode
>
> \stoptext
>> However, inspired by your reply I could get it to work in LuaTeX but
>> not in ConTeXt with Dabeer module.
>>
>> Are there any other set of features that I can test?
> ConTeXt inludes a few modules which can be used to show font information
> (search for s-fonts-*.mkiv|mkvi and s-math-*.mkiv|mkvi), below is a
> example from s-fonts-tables.mkiv:
>
> \usemodule[fonts-tables]
>
> \setupbodyfont[pagella]
>
> \starttext
> \showfonttables[title={TeX Gyre Pagella}]
> \stoptext

I am a novice in LuaTeX and ConTeXt and to learn these I tried to
modify FontSampler code (http://wiki.luatex.org/index.php/Fontsampler)
to get a sample of Persian fonts in a directory hierarchy too.

BTW, at the moment my problem with LuaTeX is that the page numbering
is in english. Do you know how to change the page numbering to Persian
in LuaTeX?

 Thanks,
 Mingranina
___
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://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] How to use "fontsampler example" with Persian font

2016-10-07 Thread Mingranina Gingranina
 Dear Mohammad,
 Hi,

 Thank you very much for your reply. I forgot to mention that I had
modified the fontsampler codes so that I can use it in ConTeXt with
Dabeer module.

 However, inspired by your reply I could get it to work in LuaTeX but
not in ConTeXt with Dabeer module.

 Are there any other set of features that I can test?

 Thanks,
 Mingranina

On 10/7/16, Mohammad Hossein Bateni <bat...@gmail.com> wrote:
> The following works for me:
>
> \input luaotfload.sty
> \font \myfont =
> file:HM_XNiloofar.ttf:language=dflt;script=arab;ccmp=yes;init=yes;medi=yes;fina=yes;rlig=yes
> \myfont Salam
>
> \pardir TRT
> \textdir TRT
> سلام
> حسن
> \bye
>
>
> On Fri, Oct 7, 2016 at 7:19 AM, Mohammad Hossein Bateni <bat...@gmail.com>
> wrote:
>
>> I don't know much about fontsampler but the commands you list here are
>> mostly irrelevant.  My guess is you will need to set the features in the
>> font to get proper shaping.  A good set of features that should do the
>> trick is called "arabic".
>>
>> When loading the font, you should do something like the following, but I
>> have not tried it myself.
>>
>> \font\myfont=file:font.otf:language=dflt;script=arab;
>> ccmp=yes;init=yes;medi=yes;fina=yes;rlig=yes
>>
>> —MHB
>>
>>
>> On Fri, Oct 7, 2016 at 7:01 AM, Mingranina Gingranina <
>> mingran...@gmail.com> wrote:
>>
>>> Dear All,
>>>  Hello,
>>>
>>>  I am trying to use "fontsampler example" with Persian fonts (please
>>> see below or "http://wiki.luatex.org/index.php/Fontsampler;
>>>  for fontsampler codes).
>>>  The problem is that Persian words apears as a string of separate
>>> glyphs, for example I get "ح‌س‌ن" instead of "حسن".
>>>  Do I have to use commands like the followings inside \directlua or
>>> tex.tprint to fix the problem? If yes, how can I do that?
>>>
>>> \installlanguage [fa][default=pe,date=\longjalalidatefmt]
>>> \mainlanguage[fa]
>>>
>>> \definefontfeature[tlig][tlig=yes]
>>> \definefontfeature[slanted][slant=.2]
>>> \definefontfeature[dlang][language=dflt]
>>> \definefontfeature[flang][language=far]
>>>
>>> Thanks
>>> Mingranina
>>>
>>>
>>> fontsampler.tex
>>> 
>>> =
>>> \input luaotfload.sty
>>> \overfullrule 0pt
>>> \font\mono = {file:lmmono8-regular.otf} at 6pt
>>> \parindent 0pt
>>>
>>> \def \samplestring {Sphinx of black quartz, judge my vow. 1234567890
>>> äÄöÖüÜ ß !"§\$\%\&()=?}
>>>
>>> \directlua{
>>>   dofile("fontsampler.lua")
>>>   fontsampler(arg[2])
>>> }
>>>
>>> \bye
>>> 
>>> =
>>> End Of fontsampler.tex
>>>
>>>
>>> fontsampler.lua
>>> 
>>> =
>>> function dirtree(dir)
>>>   assert(dir and dir ~= "", "directory parameter is missing or empty")
>>>   if string.sub(dir, -1) == "/" then
>>> dir=string.sub(dir, 1, -2)
>>>   end
>>>
>>>   local function yieldtree(dir)
>>> for entry in lfs.dir(dir) do
>>>   if not entry:match("^%.") then
>>> entry=dir.."/"..entry
>>>   if not lfs.isdir(entry) then
>>> coroutine.yield(entry,lfs.attributes(entry))
>>>   end
>>>   if lfs.isdir(entry) then
>>> yieldtree(entry)
>>>   end
>>>   end
>>> end
>>>   end
>>>
>>>   return coroutine.wrap(function() yieldtree(dir) end)
>>> end
>>>
>>>
>>> function fontsampler( dir )
>>>   for entry in dirtree(dir) do
>>> if entry:match(".otf","-4") then
>>>   tex.tprint({[[\mono ]]},{-2,entry},{[[
>>> (]]},{-2,fontloader.info(entry).fontname},{[[)\par\penalty
>>> 1\font\sample={file:]]},{-2,entry},{[[} at
>>> 12pt\sample\samplestring\par\penalty 1\vrule width \hsize height
>>> 0.25pt depth 0pt\par]]})
>>> end
>>>   end
>>> end
>>> 
>>> =
>>> End Of fontsampler.lua
>>> 
>>> ___
>>> 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/list
>>> info/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
___

[NTG-context] How to use "fontsampler example" with Persian font

2016-10-07 Thread Mingranina Gingranina
Dear All,
 Hello,

 I am trying to use "fontsampler example" with Persian fonts (please
see below or "http://wiki.luatex.org/index.php/Fontsampler;
 for fontsampler codes).
 The problem is that Persian words apears as a string of separate
glyphs, for example I get "ح‌س‌ن" instead of "حسن".
 Do I have to use commands like the followings inside \directlua or
tex.tprint to fix the problem? If yes, how can I do that?

\installlanguage [fa][default=pe,date=\longjalalidatefmt]
\mainlanguage[fa]

\definefontfeature[tlig][tlig=yes]
\definefontfeature[slanted][slant=.2]
\definefontfeature[dlang][language=dflt]
\definefontfeature[flang][language=far]

Thanks
Mingranina


fontsampler.tex
=
\input luaotfload.sty
\overfullrule 0pt
\font\mono = {file:lmmono8-regular.otf} at 6pt
\parindent 0pt

\def \samplestring {Sphinx of black quartz, judge my vow. 1234567890
äÄöÖüÜ ß !"§\$\%\&()=?}

\directlua{
  dofile("fontsampler.lua")
  fontsampler(arg[2])
}

\bye
=
End Of fontsampler.tex


fontsampler.lua
=
function dirtree(dir)
  assert(dir and dir ~= "", "directory parameter is missing or empty")
  if string.sub(dir, -1) == "/" then
dir=string.sub(dir, 1, -2)
  end

  local function yieldtree(dir)
for entry in lfs.dir(dir) do
  if not entry:match("^%.") then
entry=dir.."/"..entry
  if not lfs.isdir(entry) then
coroutine.yield(entry,lfs.attributes(entry))
  end
  if lfs.isdir(entry) then
yieldtree(entry)
  end
  end
end
  end

  return coroutine.wrap(function() yieldtree(dir) end)
end


function fontsampler( dir )
  for entry in dirtree(dir) do
if entry:match(".otf","-4") then
  tex.tprint({[[\mono ]]},{-2,entry},{[[
(]]},{-2,fontloader.info(entry).fontname},{[[)\par\penalty
1\font\sample={file:]]},{-2,entry},{[[} at
12pt\sample\samplestring\par\penalty 1\vrule width \hsize height
0.25pt depth 0pt\par]]})
end
  end
end
=
End Of fontsampler.lua
___
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
___

Re: [NTG-context] Problem with \leqalignno

2016-09-11 Thread Mingranina Gingranina
Dear Aditya, Otared, and Hans,
 Hello,

 Thank you all very much for your help. Your codes work fine. However when I use
 \setupformulas[location=right] the equation numbers apperar on the rightmost of
 the line, but with \setupformulas[location=left] the equation numbers
appear near
 the formulas and not on leftmost of the line. What should I do so
that in both cases
 the equation numbers appear near the formulas or with
\setupformulas[location=left]
 the equation numbers appear on the leftmost of the line?

 Thanks
 Mingranina

 --
 Luatex Version: 0.98.3
 ConTeXt Version: 2016.09.06 19:11 MKIV beta  fmt: 2016.9.9  int:
english/english


On 9/11/16, Hans Hagen  wrote:
> On 9/11/2016 11:28 AM, Otared Kavian wrote:
>> Hi Mingranina,
>>
>> For displayed aligned formulas it is better to use \startalign…\stopalign,
>> instead of the plain TeX construction \leqalignno.
>
> indeed, and at some point they might even get nilled .. we can't use
> them in complex cases anyway
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | 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  : 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
___

[NTG-context] Problem with \leqalignno

2016-09-10 Thread Mingranina Gingranina
 Hello All,

 I am trying to compile the following example (from
http://wiki.contextgarden.net/Math/Display) with context:

\starttext

\placeformula
\startformula
\leqalignno{c^2 &= a^2 + b^2  &\formulanumber{a} \cr
   a^2 + b^2 &= c^2  &\subformulanumber{b} \cr
   d^2 &= e^2&\formulanumber\cr}
\stopformula

\stoptext

 but I get the following error message: {{{
.
.
.
tex error   > tex error on line 7 in file
/home/user/math-example.tex: ! Undefined control sequence

 ...er {a} \cr a^2 + b^2 &= c^2 &\subformulanumber
  {b} \cr d^2 &= e^2 &\formu...
\math_both_eqalign_no_normal ...ratchtoks \crcr #2
  \crcr \egroup \math_finish...
l.7d^2 &= e^2&\formulanumber\cr}


 1 \starttext
 2
 3 \placeformula
 4 \startformula
 5 \leqalignno{c^2 &= a^2 + b^2  &\formulanumber{a} \cr
 6a^2 + b^2 &= c^2  &\subformulanumber{b} \cr
 7 >> d^2 &= e^2&\formulanumber\cr}
 8 \stopformula
 9
10 \stoptext
11


?
}}}

 Am I doing something wrong? Any help would be gratefully appreciated.

 Thanks
 Mingranina

 --
 Luatex Version: 0.98.3
 ConTeXt Version: 2016.09.06 19:11 MKIV beta  fmt: 2016.9.9  int:
english/english
___
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
___

Re: [NTG-context] Persian numbers for page numbering

2013-12-04 Thread Mingranina Gingranina
On 11/30/13, Wolfgang Schuster schuster.wolfg...@gmail.com wrote:

 Am 29.11.2013 um 16:49 schrieb Mingranina Gingranina
 mingran...@gmail.com:

 Dear All,
 Hello,

 How can I force ConTeXt to use Persian numbers for page numbering?

 \setuppagenumber[numberconversion=persiannumerals]

Dear Wolfgang,
Hello,

First of all let me thank you very much for your reply.

With the above command the page number is now typeset in Persian, but
it uses Persian letters not Persian digits. My code is:

\definefontfeature [persian] [arabic] % [...]

\usemodule[simplefonts]

\setmainfont[dejavusans][features=persian]

\mainlanguage[pe]

\setuppagenumbering[conversion=numbers]

\setuppagenumber[numberconversion=persiannumerals]

\starttext

\setupalign[r2l]

 \page[2]

\definedfont[dejavusans*persian]

این یک آزمایش است.

\setupalign[l2r]

This is a test.

\stoptext

The PDF output is also atteched to this message.

Yours
Mingranina

Persian


test.pdf
Description: Adobe PDF document
___
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
___

[NTG-context] Persian numbers for page numbering

2013-11-29 Thread Mingranina Gingranina
Dear All,
Hello,

How can I force ConTeXt to use Persian numbers for page numbering?

Thanks
Mingranina
___
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
___


Re: [NTG-context] Persian digits in math formulas

2013-08-17 Thread Mingranina Gingranina
On 8/17/13, Wolfgang Schuster schuster.wolfg...@gmail.com wrote:

 The following example from Hans worked in my system:

 \usetypescriptfile[mathdigits]

 \usetypescript [mathdigits] [xits-dejavu] [arabicindic]

 \setupbodyfont[dejavu]

 \starttext
$3+2=5 \quad \bf 3+2=5$
 \stoptext

 Dear Wolfgang Schuster,
 Hello

 The above code works on my system too, but in text mode the digits
are still in English.

 The DejaVu fonts are shipped with your context installation and you can use
 them
 with \setupbodyfont[dejavu], when you write \setupbodyfont[dejavusans]
 context
 uses Latin Modern because there is no typeface with the name “dejavusans”.

 Do you know in which files are these typefaces defined? I want to use
them as sample
 files and define my own typefaces (if I can at all).

 Thanks
 Migranina
___
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
___


[NTG-context] Persian digits in math formulas

2013-08-15 Thread Mingranina Gingranina
Dear All,
 Hello,

 I am trying to use Persian digits in math formulas. My document reads:

\font\4 = {name:dejavusans} at 10pt

\font\5 = {name:dejavusans} at 7pt

\font\6 = {name:dejavusans} at 5pt

\textfont4=\4 \scriptfont4=\5 \scriptscriptfont4=\6

\Umathcode`3=14`۳

\definefontfeature [persian] [arabic]

\mainlanguage[pe]

\starttext

  \definedfont[dejavusans*persian]

  \setupalign[r2l]

این یک آزمایش است.

  3+2=5

  $3+2=5$

\setupalign[l2r]

This is a test.

  3+2=5

  $3+2=5$

\stoptext

 However in the output the replaced digit 3 disappears.
 Any help is gratefully appreciated.

 Thanks,
 Mingranina
___
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
___

Re: [NTG-context] Persian digits in math formulas

2013-08-15 Thread Mingranina Gingranina
On 8/15/13, Hans Hagen pra...@wxs.nl wrote:
 On 8/15/2013 4:22 PM, Mingranina Gingranina wrote:
 Dear All,
   Hello,

   I am trying to use Persian digits in math formulas. My document reads:

 \font\4 = {name:dejavusans} at 10pt

 \font\5 = {name:dejavusans} at 7pt

 \font\6 = {name:dejavusans} at 5pt

 \textfont4=\4 \scriptfont4=\5 \scriptscriptfont4=\6

 \Umathcode`3=14`۳

 \definefontfeature [persian] [arabic]

 \mainlanguage[pe]

 \starttext

\definedfont[dejavusans*persian]

\setupalign[r2l]

  این یک آزمایش است.

3+2=5

$3+2=5$

  \setupalign[l2r]

  This is a test.

3+2=5

$3+2=5$

 \stoptext

   However in the output the replaced digit 3 disappears.
   Any help is gratefully appreciated.

 For a text font you can add:

 \definefontfeature [persian-fake-math] [arabic] [anum=yes]

 and say:

  \definedfont[dejavusans*persian-fake-math]

 but ... nicer is this:

 \mainlanguage[pe]

 \usetypescriptfile[dejavu]

 \definetypeface [dejavu] [rm] [serif] [dejavu]   [default]
 \definetypeface [dejavu] [ss] [sans]  [dejavu]   [default]
 \definetypeface [dejavu] [tt] [mono]  [dejavu]   [default]
 \definetypeface [dejavu] [mm] [math]  [xitsbidi] [default]
 [direction=both,rscale=1.2]

 \setuptypeface[dejavu]

 \starttext

  \start \setupalign[r2l] \setupmathematics[align=r2l] arabic: این یک
 آزمایش است. \par text: 3+2=5 \par math: $3+2=5$ $\sqrt{3+2=5}$ \par \stop

  \start \setupalign[l2r] \setupmathematics[align=l2r] latin:  This
 is a test.\par text: 3+2=5 \par math: $3+2=5$ $\sqrt{3+2=5}$\par \stop

 \stoptext

 (see bidi-001.tex in the test suite)

 Dear Hans,
 Hello

 Thank you very much for your reply.
 A math formula In Persian language is exactly the same as in English
language except that the
 digits should be written in Persian. So what I want to do is to
replace the English digits with
 Persian digits in a math formula. However, with your code not only
the formula is right aligned, but
 also the square root symbol is mirrored.

 By the way, I couldn't find bidi-001.tex on ConTeXt Site, would you
please let me know where can
 I get it?

 Thanks,
 Mingranina


 The problem wi



 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
___

[NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
 Dear All,
 Hello,

 I am completely new to ConTeXt and after searching and exploring the
 ConTeXt Garden wiki pages and other resources thoroughly, I decided
 to write my first document in Persian which reads:

\enableregime [utf-8]
\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]

\usemodule[simplefonts]
\setmainfont[arial][feature=persian]

\mainlanguage[pe]
\setupbodyfont[arial,12pt]

\starttext
\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT
این یک آزمایش است.
\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT
This is a test.
\stoptext

 As there are some UTF-8 characters in the document I have attached the
 document to this message too.

 The problem is that on my system the Persian part of the output is a set of
 Persian Isolated characters, but on http://live.contextgarden.net the Persian
 part does not appear at all.
 Could somebody please let me know what am I doing wrong?

 Thanks,
 Mingranina


my-first-doc.tex
Description: TeX document
___
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
___

Re: [NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
Dear Hans,
Hello,

Thank you very much for your reply. With your code the Persian part
disappears on my
system unless I insert the following two lines after \definefontfeature:
   \usemodule[simplefonts]
   \setmainfont[arial][feature=persian]

However the Persian characters still appears as isolated characters.

Thanks,
Mingranina

On 8/7/13, Hans Hagen pra...@wxs.nl wrote:
 On 8/7/2013 10:50 AM, Mingranina Gingranina wrote:
   Dear All,
   Hello,

   I am completely new to ConTeXt and after searching and exploring the
   ConTeXt Garden wiki pages and other resources thoroughly, I decided
   to write my first document in Persian which reads:

 \enableregime [utf-8]
 \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]

 \usemodule[simplefonts]
 \setmainfont[arial][feature=persian]

 \mainlanguage[pe]
 \setupbodyfont[arial,12pt]

 \starttext
 \pagedir TRT\bodydir TRT\pardir TRT\textdir TRT
 این یک آزمایش است.
 \pagedir TLT\bodydir TLT\pardir TLT\textdir TLT
 This is a test.
 \stoptext

   As there are some UTF-8 characters in the document I have attached the
   document to this message too.

   The problem is that on my system the Persian part of the output is a set
 of
   Persian Isolated characters, but on http://live.contextgarden.net the
 Persian
   part does not appear at all.
   Could somebody please let me know what am I doing wrong?

 Here is a more minimal test:

 \definefontfeature [persian] [arabic] % [...]

 \mainlanguage[pe]

 \starttext

  \definedfont[arial*persian]

  \setupalign[r2l]

  این یک آزمایش است.

  \setupalign[l2r]

  This is a test.

 \stoptext

 If that works, you can try the simplefonts variant. Keep in mind that
 you need to end a paragraph with an empty line or \par because otherwise
 the last settings apply.

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

Re: [NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
Dear Hans,
Hello again,

I just noticed that your code works fine with Dejavusans TrueType font, but
not with some other TrueType fonts.

Thanks,

On 8/7/13, Mingranina Gingranina mingran...@gmail.com wrote:
 Dear Hans,
 Hello,

 Thank you very much for your reply. With your code the Persian part
 disappears on my
 system unless I insert the following two lines after \definefontfeature:
\usemodule[simplefonts]
\setmainfont[arial][feature=persian]

 However the Persian characters still appears as isolated characters.

 Thanks,
 Mingranina

 On 8/7/13, Hans Hagen pra...@wxs.nl wrote:
 On 8/7/2013 10:50 AM, Mingranina Gingranina wrote:
   Dear All,
   Hello,

   I am completely new to ConTeXt and after searching and exploring the
   ConTeXt Garden wiki pages and other resources thoroughly, I decided
   to write my first document in Persian which reads:

 \enableregime [utf-8]
 \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]

 \usemodule[simplefonts]
 \setmainfont[arial][feature=persian]

 \mainlanguage[pe]
 \setupbodyfont[arial,12pt]

 \starttext
 \pagedir TRT\bodydir TRT\pardir TRT\textdir TRT
 این یک آزمایش است.
 \pagedir TLT\bodydir TLT\pardir TLT\textdir TLT
 This is a test.
 \stoptext

   As there are some UTF-8 characters in the document I have attached the
   document to this message too.

   The problem is that on my system the Persian part of the output is a
 set
 of
   Persian Isolated characters, but on http://live.contextgarden.net the
 Persian
   part does not appear at all.
   Could somebody please let me know what am I doing wrong?

 Here is a more minimal test:

 \definefontfeature [persian] [arabic] % [...]

 \mainlanguage[pe]

 \starttext

  \definedfont[arial*persian]

  \setupalign[r2l]

  این یک آزمایش است.

  \setupalign[l2r]

  This is a test.

 \stoptext

 If that works, you can try the simplefonts variant. Keep in mind that
 you need to end a paragraph with an empty line or \par because otherwise
 the last settings apply.

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

Re: [NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
On 8/7/13, Hans Hagen pra...@wxs.nl wrote:
 On 8/7/2013 2:38 PM, Mingranina Gingranina wrote:
 Dear Hans,
 Hello again,

 I just noticed that your code works fine with Dejavusans TrueType font,
 but
 not with some other TrueType fonts.

 in which case you use fonts that have no arabic shapes

For TrueType fonts which are in the directory '/usr/share/fonts/TTF/'
everything works fine,
but if the font is in '/usr/local/share/fonts/' then the code fails.
Please note that I have already
executed the commands:

OSFONTDIR=/usr/share/fonts;/usr/local/share/fonts;$HOME/.fonts
mtxrun --script fonts --reload
mtxrun --script fonts --list --all  --pattern=*

Thanks,
Mingranina
___
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
___


Re: [NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
On 8/7/13, Pablo Rodríguez oi...@web.de wrote:
 On 08/07/2013 04:09 PM, Mingranina Gingranina wrote:
 [...]
 For TrueType fonts which are in the directory '/usr/share/fonts/TTF/'
 everything works fine,
 but if the font is in '/usr/local/share/fonts/' then the code fails.
 Please note that I have already
 executed the commands:

 OSFONTDIR=/usr/share/fonts;/usr/local/share/fonts;$HOME/.fonts
 mtxrun --script fonts --reload
 mtxrun --script fonts --list --all  --pattern=*

 Hi Mingranina,

 are the fonts from /usr/local/share/fonts listed with the last command
 you mention?

No, they are not listed.

 If you don’t have other issues, you can always move all fonts from
 /usr/local/share/fonts to /usr/share/fonts. This is an easy fix.

You are right. I think this is the only way to fix this problem.

Thanks,
Mingranina
___
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
___


Re: [NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
On 8/7/13, Wolfgang Schuster schuster.wolfg...@gmail.com wrote:

 Am 07.08.2013 um 12:38 schrieb Mingranina Gingranina
 mingran...@gmail.com:

 Dear Hans,
 Hello,

 Thank you very much for your reply. With your code the Persian part
 disappears on my
 system unless I insert the following two lines after \definefontfeature:
   \usemodule[simplefonts]
   \setmainfont[arial][feature=persian]

 However the Persian characters still appears as isolated characters.

 The name of the key is “features” and not “feature”.

Thanks for reminding me of this mistake.

Regards,
Mingranina
___
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
___


Re: [NTG-context] problem with Persian feature

2013-08-07 Thread Mingranina Gingranina
On 8/7/13, Otared Kavian ota...@gmail.com wrote:

 As Wolfgang said, if I fix the name of the key in \setmainfont (from «
 feature » to « features », see below), then your test works fine here (using
 Mac OS X 10.8.4, and ConTeXt  ver: 2013.08.07 14:40 MKIV beta  fmt:
 2013.8.7).

Unfortunately, on my system it does not work.

 By the way in mkiv you don't need to add \enableregime[utf-8]: by default
 ConTeXt uses utf-8.

Thanks for this hint.

Regards,
Mingranina
___
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
___