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

2016-10-07 Thread Mohammad Hossein Bateni
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  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  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
> >>> 

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

Re: [NTG-context] Recommendations on presentations

2016-10-07 Thread Aditya Mahajan

On Thu, 6 Oct 2016, Jan U. Hasecke wrote:


Am 05.10.2016 um 11:15 schrieb Nicola:

On 2016-10-05 08:25:03 +, Otared Kavian said:



Is it better to simply define the layout from scratch?


For me, yes. I have found this step-by-step guide good to start with:

https://github.com/adityam/context-slides-example


From a quick glance I'd say that this is a better start for me too. At
least I find my way through the code.


It is instructive to step through the git commits to understand the code 
better. One way to do so is:


https://randomdeterminism.wordpress.com/2013/01/13/creating-a-clean-presentation-style-in-40-commits/

Aditya
___
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] How do I compile a "flat" pdf?

2016-10-07 Thread Hans Hagen

On 10/7/2016 4:50 PM, Henning Hraban Ramm wrote:


The only way to "protect" contents from editing are the password settings. 
There are free tools to set them, but AFAIK no open source tools except maybe libraries.


qpdf and mutools


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

Re: [NTG-context] How do I compile a "flat" pdf?

2016-10-07 Thread Henning Hraban Ramm
Am 2016-10-07 um 10:39 schrieb Bomber K. :

> I am trying to create a pdf which contains some graphics that I created. I 
> want to pass my PDF digitally but I don't want users to be able to 
> right-click on a gfx and save it. I think this is called "flattening".

No. Flattening PDFs means to "burn in" comments and the contents of form fields 
from editable to page content.

> Is there a way in CTX to create such a file or do I have to recompile the PDF 
> with 3rd party software?

The only way to "protect" contents from editing are the password settings. 
There are free tools to set them, but AFAIK no open source tools except maybe 
libraries.
There’s also pdfcrack to find out passwords.

> Is there maybe even a way to flatten only specific objects like, only one 
> picture of many or all, and leave form fields unflattened?

Not at all.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)
GPG Key ID 1C9B22FD

___
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] Bug in \usetikzlibrary{datavisualization}?

2016-10-07 Thread Florian Leupold

> On 06.10.16, at 00:27, Hans Hagen  wrote:
> 
> On 10/5/2016 9:51 PM, Florian Leupold wrote:
>> Dear list,
>> 
>> Sorry for posting a duplicate, but I guess my previous post got lost during 
>> the conference...
>> 
>> When one tries to load the TikZ data visualization library, the documents 
>> does not compile anymore. The error is 
>> “.../tikzlibrarydatavisualization.code.tex: ! Missing number, treated as 
>> zero”.
>> 
>> I have also tried this using ConTeXt online, to the same end:
>> http://live.contextgarden.net/cgi-bin/output.cgi?id=jSjLZO
>> 
>> \usemodule[tikz]
>> \usetikzlibrary{datavisualization}
>> \starttext
>> Hello world!
>> \stoptext
>> 
>> Is this a known bug or could I somehow fix this to get data visualization to 
>> work?
> 
> \unprotect
> \usetikzlibrary{datavisualization}
> \protect
> 
> 
>> Best,
>> Florian
>> 
>> 
>> 
>> ___
>> 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
>> ___
>> 
> 
> 
> --
> 
> -
>  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
> ___


The \unprotect\protect changes something, but does not do the whole trick. 
Please see the error messages below.


### Start: without \unprotect\protect
tex error   > tex error on line 682 in file 
/Users/Florian/context/tex/texmf-modules/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex:
 ! Missing number, treated as zero


^
l.682 {\catcode`\^^
 M=\active%

672   padding/.style={padding min={-#1},padding max={#1}},
673   label/.code={%
674 \def\pgf@temp{#1}%
675 \ifx\pgf@temp\tikz@lib@dv@auto@attribute%
676   
\tikzdatavisualizationset{\tikz@dv@axis/label/.expanded=$\noexpand\mathit{\pgfkeysvalueof{\tikz@dv@axis/attribute}}$}%
677 \else
678   \tikzdatavisualizationset{\tikz@dv@axis/label={#1}}%
679 \fi
680   },
681   label/.default=\tikz@lib@dv@auto@attribute,
682 >>%
683   % Strategies
684   %
685   tick placement strategy/.style={\tikz@dv@axis/@compute at 
positions={#1}},
686   linear steps/.style={tick placement 
strategy=\tikz@lib@dv@compute@at@linear},
687   %
688   % Attribute setter
689   %
690   goto/.code={\tikz@dv@goto{\tikz@dv@axis}{#1}},
691   goto pos/.code={\tikz@dv@goto@pos{\tikz@dv@axis}{#1}},
692   anchor at 
min/.code={\tikz@lib@dv@special@at{\tikz@dv@axis}{\tikz@dv@min@anchor}},
### Stop: without \unprotect\protect


### Start: with \unprotect\protect
tex error   > tex error on line 2410 in file 
/Users/Florian/context/tex/texmf-modules/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex:
 ! Undefined control sequence


\tikzdvdeclarestylesheetcolorseries ...olorseries
  {tikzdvcolorseries#1}{#2}{...
l.2410 ...eries{vary hue}{hsb}{.4,0.9,0.8}{.213,0,0}


2400   \resetcolorseries{tikzdvcolorseries#1}
2401   \pgfdvdeclarestylesheet{#1}
2402   {
2403 default style/.style={
2404   
/utils/exec=\colorlet{tikz@dv@temp}[rgb]{tikzdvcolorseries#1!![##1]},
2405   visualizer color=tikz@dv@temp
2406 }
2407   }
2408 }
2409
2410 >>  \tikzdvdeclarestylesheetcolorseries{vary 
hue}{hsb}{.4,0.9,0.8}{.213,0,0}
2411 \tikzdvdeclarestylesheetcolorseries{shades of 
blue}{hsb}{.65,1.4,1}{0,-.4,-.0}
2412 \tikzdvdeclarestylesheetcolorseries{shades of 
red}{hsb}{0,1.4,1}{0,-.4,-.0}
2413 \tikzdvdeclarestylesheetcolorseries{gray scale}{hsb}{0,0,-.34}{0,0,.34}
2414
2415
2416
2417
2418
2419 %
2420 % Basic Axes & Coordinate Systems
### Stop: with \unprotect\protect


signature.asc
Description: Message signed with OpenPGP using GPGMail

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

2016-10-07 Thread Mohammad Hossein Bateni
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 
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
___

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

2016-10-07 Thread Mohammad Hossein Bateni
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 
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/
> 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] 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
___

[NTG-context] How do I compile a "flat" pdf?

2016-10-07 Thread Bomber K.

Hi guys,

I am trying to create a pdf which contains some graphics that I created. 
I want to pass my PDF digitally but I don't want users to be able to 
right-click on a gfx and save it. I think this is called "flattening".
Is there a way in CTX to create such a file or do I have to recompile 
the PDF with 3rd party software?
Is there maybe even a way to flatten only specific objects like, only 
one picture of many or all, and leave form fields unflattened?


Thanks, Sebastian
___
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] "marking=one" with marks on more than the first page

2016-10-07 Thread Pablo Rodriguez
Hans,

the following sample puts the cut marks on each page:

\showframe
\setuppapersize[A5][A4]
\setuplayout
[marking=one,
location=middle]
\starttext
\ctxlua{for i=1,10 do
tex.print("\\startpagemakeup\\filterpages[setup-en.pdf][" .. i ..
"][width=0cm]\\stoppagemakeup") end}
\stoptext

Page makeups is the only way I have to get full pages imposed. But with
those, "marking=one" doesn’t work.

Is there a way to solve this?

Many thanks for your help

Pablo
-- 
http://www.ousia.tk
___
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
___