ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Loop and graphictext (Metafun)
@ 2015-10-05 16:28 Fabrice Couvreur
  2015-10-05 17:48 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Couvreur @ 2015-10-05 16:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,
I tried to write a loop to display the title, but it does not. How to do ?
Thank you,
Fabrice

\setuppagenumbering[location=]

\setupcolors
  [state=start]

\definecolor[pagecolor][s=.6]
\definecolor[textcolor][r=.6]


\startMPinclusions
  color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
  color textcolor ; textcolor := \MPcolor{textcolor} ;
\stopMPinclusions

\setMPtext{title}{Serie statistiques à deux variables}

\startuseMPgraphic{Title}

  path p ; p := OverlayBox  ;
  fill OverlayBox withcolor pagecolor ;
  setbounds currentpicture to OverlayBox ;

\stopuseMPgraphic

\defineoverlay[Title][\useMPgraphic{Title}]

\defineframedtext
  [MyTitle]
  [before={\blank[line,halfline]},
   after={\blank},
   frame=off,
   background=Title,
   width=\textwidth,
   height=fit,
   ]

\starttext

\startMyTitle

\startMPcode

numeric k ; k :=0 ;
string s ; s := \MPstring{title} ;
picture r ;
r := image (graphictext
        substring (k,k+1) of s
        randomized .5pt
        scaled 5pt
        withfillcolor textcolor
        withpen pencircle scaled 1pt ; ) ;
  draw r ;

\stopMPcode

\stopMyTitle

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1639 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] 5+ messages in thread

* Re: Loop and graphictext (Metafun)
  2015-10-05 16:28 Loop and graphictext (Metafun) Fabrice Couvreur
@ 2015-10-05 17:48 ` Hans Hagen
  2015-10-05 18:11   ` Fabrice Couvreur
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2015-10-05 17:48 UTC (permalink / raw)
  To: ntg-context

On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
> Hi,
> I tried to write a loop to display the title, but it does not. How to do ?
> Thank you,
> Fabrice
>
> \setuppagenumbering[location=]
>
> \setupcolors
>    [state=start]
>
> \definecolor[pagecolor][s=.6]
> \definecolor[textcolor][r=.6]
>
>
> \startMPinclusions
>    color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>    color textcolor ; textcolor := \MPcolor{textcolor} ;
> \stopMPinclusions
>
> \setMPtext{title}{Serie statistiques à deux variables}
>
> \startuseMPgraphic{Title}
>
>    path p ; p := OverlayBox  ;
>    fill OverlayBox withcolor pagecolor ;
>    setbounds currentpicture to OverlayBox ;
>
> \stopuseMPgraphic
>
> \defineoverlay[Title][\useMPgraphic{Title}]
>
> \defineframedtext
>    [MyTitle]
>    [before={\blank[line,halfline]},
>     after={\blank},
>     frame=off,
>     background=Title,
>     width=\textwidth,
>     height=fit,
>     ]
>
> \starttext
>
> \startMyTitle
>
> \startMPcode
>
> numeric k ; k :=0 ;
> string s ; s := \MPstring{title} ;
> picture r ;
> r := image (graphictext
>          substring (k,k+1) of s
>          randomized .5pt
>          scaled 5pt
>          withfillcolor textcolor
>          withpen pencircle scaled 1pt ; ) ;
>    draw r ;
>
> \stopMPcode
>
> \stopMyTitle
>
> \stoptext

i see no loop, why not just

r := image (graphictext
         s
        ....


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

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

* Re: Loop and graphictext (Metafun)
  2015-10-05 17:48 ` Hans Hagen
@ 2015-10-05 18:11   ` Fabrice Couvreur
  2015-10-05 18:31     ` Fabrice Couvreur
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Couvreur @ 2015-10-05 18:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Hans,
In fact, as the loop does not work, I have not added to the code.
It's true that your solution is simple !
Thank you,
Fabrice

2015-10-05 19:48 GMT+02:00 Hans Hagen <pragma@wxs.nl>:

> On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
>
>> Hi,
>> I tried to write a loop to display the title, but it does not. How to do ?
>> Thank you,
>> Fabrice
>>
>> \setuppagenumbering[location=]
>>
>> \setupcolors
>>    [state=start]
>>
>> \definecolor[pagecolor][s=.6]
>> \definecolor[textcolor][r=.6]
>>
>>
>> \startMPinclusions
>>    color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>    color textcolor ; textcolor := \MPcolor{textcolor} ;
>> \stopMPinclusions
>>
>> \setMPtext{title}{Serie statistiques à deux variables}
>>
>> \startuseMPgraphic{Title}
>>
>>    path p ; p := OverlayBox  ;
>>    fill OverlayBox withcolor pagecolor ;
>>    setbounds currentpicture to OverlayBox ;
>>
>> \stopuseMPgraphic
>>
>> \defineoverlay[Title][\useMPgraphic{Title}]
>>
>> \defineframedtext
>>    [MyTitle]
>>    [before={\blank[line,halfline]},
>>     after={\blank},
>>     frame=off,
>>     background=Title,
>>     width=\textwidth,
>>     height=fit,
>>     ]
>>
>> \starttext
>>
>> \startMyTitle
>>
>> \startMPcode
>>
>> numeric k ; k :=0 ;
>> string s ; s := \MPstring{title} ;
>> picture r ;
>> r := image (graphictext
>>          substring (k,k+1) of s
>>          randomized .5pt
>>          scaled 5pt
>>          withfillcolor textcolor
>>          withpen pencircle scaled 1pt ; ) ;
>>    draw r ;
>>
>> \stopMPcode
>>
>> \stopMyTitle
>>
>> \stoptext
>>
>
> i see no loop, why not just
>
> r := image (graphictext
>         s
>        ....
>
>
> -----------------------------------------------------------------
>                                           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
>
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 4398 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] 5+ messages in thread

* Re: Loop and graphictext (Metafun)
  2015-10-05 18:11   ` Fabrice Couvreur
@ 2015-10-05 18:31     ` Fabrice Couvreur
  2015-10-05 18:54       ` Fabrice Couvreur
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Couvreur @ 2015-10-05 18:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

How to center the title ?

2015-10-05 20:11 GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com>:

> Hi Hans,
> In fact, as the loop does not work, I have not added to the code.
> It's true that your solution is simple !
> Thank you,
> Fabrice
>
> 2015-10-05 19:48 GMT+02:00 Hans Hagen <pragma@wxs.nl>:
>
>> On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
>>
>>> Hi,
>>> I tried to write a loop to display the title, but it does not. How to do
>>> ?
>>> Thank you,
>>> Fabrice
>>>
>>> \setuppagenumbering[location=]
>>>
>>> \setupcolors
>>>    [state=start]
>>>
>>> \definecolor[pagecolor][s=.6]
>>> \definecolor[textcolor][r=.6]
>>>
>>>
>>> \startMPinclusions
>>>    color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>>    color textcolor ; textcolor := \MPcolor{textcolor} ;
>>> \stopMPinclusions
>>>
>>> \setMPtext{title}{Serie statistiques à deux variables}
>>>
>>> \startuseMPgraphic{Title}
>>>
>>>    path p ; p := OverlayBox  ;
>>>    fill OverlayBox withcolor pagecolor ;
>>>    setbounds currentpicture to OverlayBox ;
>>>
>>> \stopuseMPgraphic
>>>
>>> \defineoverlay[Title][\useMPgraphic{Title}]
>>>
>>> \defineframedtext
>>>    [MyTitle]
>>>    [before={\blank[line,halfline]},
>>>     after={\blank},
>>>     frame=off,
>>>     background=Title,
>>>     width=\textwidth,
>>>     height=fit,
>>>     ]
>>>
>>> \starttext
>>>
>>> \startMyTitle
>>>
>>> \startMPcode
>>>
>>> numeric k ; k :=0 ;
>>> string s ; s := \MPstring{title} ;
>>> picture r ;
>>> r := image (graphictext
>>>          substring (k,k+1) of s
>>>          randomized .5pt
>>>          scaled 5pt
>>>          withfillcolor textcolor
>>>          withpen pencircle scaled 1pt ; ) ;
>>>    draw r ;
>>>
>>> \stopMPcode
>>>
>>> \stopMyTitle
>>>
>>> \stoptext
>>>
>>
>> i see no loop, why not just
>>
>> r := image (graphictext
>>         s
>>        ....
>>
>>
>> -----------------------------------------------------------------
>>                                           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
>>
>> ___________________________________________________________________________________
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 4832 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] 5+ messages in thread

* Re: Loop and graphictext (Metafun)
  2015-10-05 18:31     ` Fabrice Couvreur
@ 2015-10-05 18:54       ` Fabrice Couvreur
  0 siblings, 0 replies; 5+ messages in thread
From: Fabrice Couvreur @ 2015-10-05 18:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

\startmidaligned

\startMPcode

...

\stopMPcode

\stopmidaligned

2015-10-05 20:31 GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com>:

> How to center the title ?
>
> 2015-10-05 20:11 GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com>:
>
>> Hi Hans,
>> In fact, as the loop does not work, I have not added to the code.
>> It's true that your solution is simple !
>> Thank you,
>> Fabrice
>>
>> 2015-10-05 19:48 GMT+02:00 Hans Hagen <pragma@wxs.nl>:
>>
>>> On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
>>>
>>>> Hi,
>>>> I tried to write a loop to display the title, but it does not. How to
>>>> do ?
>>>> Thank you,
>>>> Fabrice
>>>>
>>>> \setuppagenumbering[location=]
>>>>
>>>> \setupcolors
>>>>    [state=start]
>>>>
>>>> \definecolor[pagecolor][s=.6]
>>>> \definecolor[textcolor][r=.6]
>>>>
>>>>
>>>> \startMPinclusions
>>>>    color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>>>    color textcolor ; textcolor := \MPcolor{textcolor} ;
>>>> \stopMPinclusions
>>>>
>>>> \setMPtext{title}{Serie statistiques à deux variables}
>>>>
>>>> \startuseMPgraphic{Title}
>>>>
>>>>    path p ; p := OverlayBox  ;
>>>>    fill OverlayBox withcolor pagecolor ;
>>>>    setbounds currentpicture to OverlayBox ;
>>>>
>>>> \stopuseMPgraphic
>>>>
>>>> \defineoverlay[Title][\useMPgraphic{Title}]
>>>>
>>>> \defineframedtext
>>>>    [MyTitle]
>>>>    [before={\blank[line,halfline]},
>>>>     after={\blank},
>>>>     frame=off,
>>>>     background=Title,
>>>>     width=\textwidth,
>>>>     height=fit,
>>>>     ]
>>>>
>>>> \starttext
>>>>
>>>> \startMyTitle
>>>>
>>>> \startMPcode
>>>>
>>>> numeric k ; k :=0 ;
>>>> string s ; s := \MPstring{title} ;
>>>> picture r ;
>>>> r := image (graphictext
>>>>          substring (k,k+1) of s
>>>>          randomized .5pt
>>>>          scaled 5pt
>>>>          withfillcolor textcolor
>>>>          withpen pencircle scaled 1pt ; ) ;
>>>>    draw r ;
>>>>
>>>> \stopMPcode
>>>>
>>>> \stopMyTitle
>>>>
>>>> \stoptext
>>>>
>>>
>>> i see no loop, why not just
>>>
>>> r := image (graphictext
>>>         s
>>>        ....
>>>
>>>
>>> -----------------------------------------------------------------
>>>                                           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
>>>
>>> ___________________________________________________________________________________
>>
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 5360 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] 5+ messages in thread

end of thread, other threads:[~2015-10-05 18:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 16:28 Loop and graphictext (Metafun) Fabrice Couvreur
2015-10-05 17:48 ` Hans Hagen
2015-10-05 18:11   ` Fabrice Couvreur
2015-10-05 18:31     ` Fabrice Couvreur
2015-10-05 18:54       ` Fabrice Couvreur

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