ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to use "fontsampler example" with Persian font
@ 2016-10-07 11:01 Mingranina Gingranina
  2016-10-07 11:19 ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 9+ messages in thread
From: Mingranina Gingranina @ 2016-10-07 11:01 UTC (permalink / raw)
  To: ntg-context

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
10000\font\sample={file:]]},{-2,entry},{[[} at
12pt\sample\samplestring\par\penalty 10000\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-07 11:01 How to use "fontsampler example" with Persian font Mingranina Gingranina
@ 2016-10-07 11:19 ` Mohammad Hossein Bateni
  2016-10-07 11:24   ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 9+ messages in thread
From: Mohammad Hossein Bateni @ 2016-10-07 11:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3712 bytes --]

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 <mingranina@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
> 10000\font\sample={file:]]},{-2,entry},{[[} at
> 12pt\sample\samplestring\par\penalty 10000\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
> ____________________________________________________________
> _______________________

[-- Attachment #1.2: Type: text/html, Size: 5214 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-07 11:19 ` Mohammad Hossein Bateni
@ 2016-10-07 11:24   ` Mohammad Hossein Bateni
  2016-10-07 15:41     ` Mingranina Gingranina
  0 siblings, 1 reply; 9+ messages in thread
From: Mohammad Hossein Bateni @ 2016-10-07 11:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4175 bytes --]

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 <bateni@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 <
> mingranina@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
>> 10000\font\sample={file:]]},{-2,entry},{[[} at
>> 12pt\sample\samplestring\par\penalty 10000\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
>> ____________________________________________________________
>> _______________________
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 6039 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-07 11:24   ` Mohammad Hossein Bateni
@ 2016-10-07 15:41     ` Mingranina Gingranina
  2016-10-07 15:48       ` Mohammad Hossein Bateni
  2016-10-10  9:38       ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Mingranina Gingranina @ 2016-10-07 15:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

 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 <bateni@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 <bateni@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 <
>> mingranina@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
>>> 10000\font\sample={file:]]},{-2,entry},{[[} at
>>> 12pt\sample\samplestring\par\penalty 10000\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-07 15:41     ` Mingranina Gingranina
@ 2016-10-07 15:48       ` Mohammad Hossein Bateni
  2016-10-10  9:38       ` Wolfgang Schuster
  1 sibling, 0 replies; 9+ messages in thread
From: Mohammad Hossein Bateni @ 2016-10-07 15:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 5816 bytes --]

In ConTeXt, use \definedfont[font-name*arabic] instead of the following two
commands:

\font\myfont=blah blah
\myfont

On Fri, Oct 7, 2016 at 11:41 AM, Mingranina Gingranina <mingranina@gmail.com
> wrote:

>  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 <bateni@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 <
> bateni@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 <
> >> mingranina@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
> >>> 10000\font\sample={file:]]},{-2,entry},{[[} at
> >>> 12pt\sample\samplestring\par\penalty 10000\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
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 9130 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-07 15:41     ` Mingranina Gingranina
  2016-10-07 15:48       ` Mohammad Hossein Bateni
@ 2016-10-10  9:38       ` Wolfgang Schuster
  2016-10-11  3:44         ` Mingranina Gingranina
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2016-10-10  9:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1211 bytes --]

> Mingranina Gingranina <mailto:mingranina@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?

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

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2678 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-10  9:38       ` Wolfgang Schuster
@ 2016-10-11  3:44         ` Mingranina Gingranina
  2016-10-11 10:44           ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 9+ messages in thread
From: Mingranina Gingranina @ 2016-10-11  3:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Wolfgang
 Hello,

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

On 10/10/16, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
>> Mingranina Gingranina <mailto:mingranina@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-11  3:44         ` Mingranina Gingranina
@ 2016-10-11 10:44           ` Mohammad Hossein Bateni
  2016-10-12 14:07             ` Mingranina Gingranina
  0 siblings, 1 reply; 9+ messages in thread
From: Mohammad Hossein Bateni @ 2016-10-11 10:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3120 bytes --]

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 <
mingranina@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.wolfgang@gmail.com> wrote:
> >> Mingranina Gingranina <mailto:mingranina@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
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 4835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 489 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to use "fontsampler example" with Persian font
  2016-10-11 10:44           ` Mohammad Hossein Bateni
@ 2016-10-12 14:07             ` Mingranina Gingranina
  0 siblings, 0 replies; 9+ messages in thread
From: Mingranina Gingranina @ 2016-10-12 14:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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 <bateni@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 <
> mingranina@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.wolfgang@gmail.com> wrote:
>> >> Mingranina Gingranina <mailto:mingranina@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-10-12 14:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 11:01 How to use "fontsampler example" with Persian font Mingranina Gingranina
2016-10-07 11:19 ` Mohammad Hossein Bateni
2016-10-07 11:24   ` Mohammad Hossein Bateni
2016-10-07 15:41     ` Mingranina Gingranina
2016-10-07 15:48       ` Mohammad Hossein Bateni
2016-10-10  9:38       ` Wolfgang Schuster
2016-10-11  3:44         ` Mingranina Gingranina
2016-10-11 10:44           ` Mohammad Hossein Bateni
2016-10-12 14:07             ` Mingranina Gingranina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).