Re: [NTG-context] double followtokens?

2019-01-01 Thread Hans Hagen

On 1/1/2019 7:17 PM, Hans van der Meer wrote:

Is followtext(“string”,path) not yet implemented?

Because I get an error when running:
\startMPcode
path p; p:=reverse halfcircle xyscaled 25mm; draw p;
followtext("some text but not that long",p); % <- causes error
\stopMPcode

Or do I need to call followtext in some other way that is not clear to me.

\starttext

\startMPcode

path p; p := reverse halfcircle xyscaled 25mm ; draw p;

draw followtext(p, "some text but not that long");

\stopMPcode

\stoptext


-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2019-01-01 Thread Hans van der Meer
Is followtext(“string”,path) not yet implemented?

Because I get an error when running:
\startMPcode
path p; p:=reverse halfcircle xyscaled 25mm; draw p;
followtext("some text but not that long",p); % <- causes error
\stopMPcode

Or do I need to call followtext in some other way that is not clear to me.

dr. Hans van der Meer


> On 8 Apr 2018, at 16:41, Hans Hagen  wrote:
> 
> On 4/8/2018 12:11 AM, Pablo Rodriguez wrote:
>> On 04/07/2018 11:25 PM, Hans Hagen wrote:
>>> On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:
 Dear list,
 
 I have the following sample:
 
\useMPlibrary[txt]
 
\starttext
 
\startuseMPgraphic{followtokens}
 path RotPath ; RotPath := reverse halfcircle ;
 % path RotPath ; RotPath := halfcircle rotatedaround (origin, 180) ;
\stopuseMPgraphic
 
\followtokens{Just follow the tokens}
\stoptext
 
 How can I get both paths (in diverse directions)?
 
 I would like to repeat the same text twice, separating both sentences
 with a character.
 
 I have to ask this, beause MetaPost is all Greek to me.
>>> i have no clue what you mean but this will change the direction
>> Many thanks for your reply, Hans.
>> I attach an image of what I mean.
>> I want a full circle in two halves with the same duplicated sentence.
>> The first one written clockwise and the second one written
>> counterclockwise (as in the commented path above).
>> I hope it is clearer now.
> 
>path p ; p := reverse halfcircle scaled 5cm ;
>path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
> 
>path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
> 
>\followtokens{~this way~}
>\followtokens{\reversedtext{~this way~}}
> 
> we will have this in metafun:
> 
>followtext("this way",p) ;
> 
> so that one can do it all in mp ... a nice gimmick for the ctx meeting
> 
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2018-04-09 Thread Pablo Rodriguez
On 04/08/2018 11:17 PM, Hans Hagen wrote:
> On 4/8/2018 8:10 PM, Pablo Rodriguez wrote:
>> [...]
>> \reversedtext is undefined (I’m using beta from 2018.04.04 00:51).
> 
> of course it is ... it's basically the lua snippet i sent a few mails ago

Now I know which one it was.

>> But even commenting that second command, \followtokens seems to require
>> that path is named RotPath to be used the text. I get the standard line.
> 
> sure, that's how it works (at least with that module ... that trickery 
> dates from mkii)
> 
>> What am I doing wrong here?
> 
> probably using a mechanism in a way that is a bit over the top
> 
> (so you can wait till the embedded variant shows up)

I’ll wait until MP includes it.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2018-04-08 Thread Hans Hagen

On 4/8/2018 8:10 PM, Pablo Rodriguez wrote:

On 04/08/2018 04:41 PM, Hans Hagen wrote:

On 4/8/2018 12:11 AM, Pablo Rodriguez wrote:

[...]
I want a full circle in two halves with the same duplicated sentence.
The first one written clockwise and the second one written
counterclockwise (as in the commented path above).

I hope it is clearer now.


  path p ; p := reverse halfcircle scaled 5cm ;
  path q ; q := reverse halfcircle scaled 5cm rotated 180 ;

  path q ; q := reverse halfcircle scaled 5cm rotated 180 ;

  \followtokens{~this way~}
  \followtokens{\reversedtext{~this way~}}


Many thanks for the reply, Hans.

I don’t know what I’m missing here, but I cannot get your code working.
Here you have the full sample:

   \useMPlibrary[txt]

   \starttext
   \startuseMPgraphic{followtokens}
  path p ; p := reverse halfcircle scaled 5cm ;
  path q ; q := reverse halfcircle scaled 5cm rotated 180 ;

  path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
   \stopuseMPgraphic

   \followtokens{~this way~}
   \followtokens{\reversedtext{~this way~}}
   \stoptext

\reversedtext is undefined (I’m using beta from 2018.04.04 00:51).


of course it it ... it's basically the lua snippet i sent a few mails ago


But even commenting that second command, \followtokens seems to require
that path is named RotPath to be used the text. I get the standard line.


sure, that's how it works (at least with that module ... that trickery 
dates from mkii)



What am I doing wrong here?


probably using a mechanism in away that is a bit ovet the top

(so you can wait till the embedded variant shows up)


we will have this in metafun:

  followtext("this way",p) ;

so that one can do it all in mp ... a nice gimmick for the ctx meeting


This will be incredibly handy.


i wonder, not many users run into this feature (kind of coincidence that 
we have two reports this month) .. it's mostly that i was curious if it 
could be integrated that i looked into it



Many thanks for your help,

Pablo




--

-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2018-04-08 Thread Pablo Rodriguez
On 04/08/2018 04:41 PM, Hans Hagen wrote:
> On 4/8/2018 12:11 AM, Pablo Rodriguez wrote:
>> [...]
>> I want a full circle in two halves with the same duplicated sentence.
>> The first one written clockwise and the second one written
>> counterclockwise (as in the commented path above).
>>
>> I hope it is clearer now.
> 
>  path p ; p := reverse halfcircle scaled 5cm ;
>  path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
> 
>  path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
> 
>  \followtokens{~this way~}
>  \followtokens{\reversedtext{~this way~}}

Many thanks for the reply, Hans.

I don’t know what I’m missing here, but I cannot get your code working.
Here you have the full sample:

  \useMPlibrary[txt]

  \starttext
  \startuseMPgraphic{followtokens}
 path p ; p := reverse halfcircle scaled 5cm ;
 path q ; q := reverse halfcircle scaled 5cm rotated 180 ;

 path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
  \stopuseMPgraphic

  \followtokens{~this way~}
  \followtokens{\reversedtext{~this way~}}
  \stoptext

\reversedtext is undefined (I’m using beta from 2018.04.04 00:51).

But even commenting that second command, \followtokens seems to require
that path is named RotPath to be used the text. I get the standard line.

What am I doing wrong here?

> we will have this in metafun:
> 
>  followtext("this way",p) ;
> 
> so that one can do it all in mp ... a nice gimmick for the ctx meeting

This will be incredibly handy.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2018-04-08 Thread Hans Hagen

On 4/8/2018 12:11 AM, Pablo Rodriguez wrote:

On 04/07/2018 11:25 PM, Hans Hagen wrote:

On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

\useMPlibrary[txt]

\starttext

\startuseMPgraphic{followtokens}
 path RotPath ; RotPath := reverse halfcircle ;
 % path RotPath ; RotPath := halfcircle rotatedaround (origin, 180) ;
\stopuseMPgraphic

\followtokens{Just follow the tokens}
\stoptext

How can I get both paths (in diverse directions)?

I would like to repeat the same text twice, separating both sentences
with a character.

I have to ask this, beause MetaPost is all Greek to me.

i have no clue what you mean but this will change the direction


Many thanks for your reply, Hans.

I attach an image of what I mean.

I want a full circle in two halves with the same duplicated sentence.
The first one written clockwise and the second one written
counterclockwise (as in the commented path above).

I hope it is clearer now.


path p ; p := reverse halfcircle scaled 5cm ;
path q ; q := reverse halfcircle scaled 5cm rotated 180 ;

path q ; q := reverse halfcircle scaled 5cm rotated 180 ;

\followtokens{~this way~}
\followtokens{\reversedtext{~this way~}}

we will have this in metafun:

followtext("this way",p) ;

so that one can do it all in mp ... a nice gimmick for the ctx meeting

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2018-04-07 Thread Pablo Rodriguez
On 04/07/2018 11:25 PM, Hans Hagen wrote:
> On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:
>> Dear list,
>>
>> I have the following sample:
>>
>>\useMPlibrary[txt]
>>
>>\starttext
>>
>>\startuseMPgraphic{followtokens}
>> path RotPath ; RotPath := reverse halfcircle ;
>> % path RotPath ; RotPath := halfcircle rotatedaround (origin, 180) ;
>>\stopuseMPgraphic
>>
>>\followtokens{Just follow the tokens}
>>\stoptext
>>
>> How can I get both paths (in diverse directions)?
>>
>> I would like to repeat the same text twice, separating both sentences
>> with a character.
>>
>> I have to ask this, beause MetaPost is all Greek to me.
> i have no clue what you mean but this will change the direction

Many thanks for your reply, Hans.

I attach an image of what I mean.

I want a full circle in two halves with the same duplicated sentence.
The first one written clockwise and the second one written
counterclockwise (as in the commented path above).

I hope it is clearer now.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk


just-follow.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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] double followtokens?

2018-04-07 Thread Hans Hagen

On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \useMPlibrary[txt]

   \starttext

   \startuseMPgraphic{followtokens}
path RotPath ; RotPath := reverse halfcircle ;
% path RotPath ; RotPath := halfcircle rotatedaround (origin, 180) ;
   \stopuseMPgraphic

   \followtokens{Just follow the tokens}
   \stoptext

How can I get both paths (in diverse directions)?

I would like to repeat the same text twice, separating both sentences
with a character.

I have to ask this, beause MetaPost is all Greek to me.

i have no clue what you mean but this will change the direction

\followtokens{\cldcontext{
table.concat (
table.reverse (
utf.totable (
"Just fillow the öëps tokens"
)
)
)
}}

because you want to get kerning and ligatures etc right although fonts 
might lack the kern pair for weird words



-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___