ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metafun::followtokens : more than one path; possible enhancements; notes
@ 2001-01-28 21:02 Giuseppe Bilotta
  2001-01-29 12:51 ` Hans Hagen
  2001-01-29 16:26 ` Giuseppe Bilotta
  0 siblings, 2 replies; 3+ messages in thread
From: Giuseppe Bilotta @ 2001-01-28 21:02 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]

Hello,

as I've already said, I began to play with MetaFun. First of all, I solved the
problem of \MPprologues being undefined by defining it in my doc (setting it to
2), but it would be better if this patch was added to the distribution.

Secondly, I instantly found a limitation :-) in \followtokens: you cannot make
text follow two paths; let me explain with an example. I can build a full
circle, with the first half written clockwise, and the second half written
counterclockwise, by using two \followtokens tricks; by putting the drawings one
under the other I get the full circle. But what if I want the two halves to be
not the upper and lower, but some other (e.g., upper left and lower right)? You
cannot merge the two paths, since they don't touch, so ...

At first I designed a \doublefollowtokens; then I turned it in the couple
of macros that you might see in the attached file, together with a test.

A future enhancements could be a \longfollowtokens that automatically splits a
(single) token list into as much paths as necessary (the user should
preventively define enough paths), more like a parshape (actually, the splitting
could be done by parshaping the text using the lengths of the paths as
parshape...). But this is definitely too much for me, at least at the current
stage of knowledge of both TeX and ConTeXt.

Final note: I suspect that some fine tuning on these macro group could render
TeX--XeT useless. I mean, you can reflect a whole paragraph: first typeset it
to get the linebreaks, then apply \followtokens to each line ... you don't even
need a reflected font! Actually, any kind of rotatation/skewing/etc, normally
achieved with PSTricks, could be achieved this way, in a driver-independent way
(if Hans Hagen fixes the undefined \MPprologues with the DVI drivers).

And possibly even multidirectional typesetting could be implemented ... of
course, "native" multidirectional would be much much much faster, but ...
something like a "poor man's Omega" (ok, Omega does much more than that, with
the OCP lists etc ...)

Giuseppe Bilotta

[-- Attachment #2: fun.zip --]
[-- Type: application/x-zip-compressed, Size: 1323 bytes --]

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

* Re: Metafun::followtokens : more than one path; possible enhancements; notes
  2001-01-28 21:02 Metafun::followtokens : more than one path; possible enhancements; notes Giuseppe Bilotta
@ 2001-01-29 12:51 ` Hans Hagen
  2001-01-29 16:26 ` Giuseppe Bilotta
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2001-01-29 12:51 UTC (permalink / raw)
  Cc: ConTeXt

At 10:02 PM 1/28/01 +0100, Giuseppe Bilotta wrote:

>A future enhancements could be a \longfollowtokens that automatically
splits a
>(single) token list into as much paths as necessary (the user should
>preventively define enough paths), more like a parshape (actually, the
splitting
>could be done by parshaping the text using the lengths of the paths as
>parshape...). But this is definitely too much for me, at least at the current
>stage of knowledge of both TeX and ConTeXt.
>
>Final note: I suspect that some fine tuning on these macro group could render
>TeX--XeT useless. I mean, you can reflect a whole paragraph: first typeset it
>to get the linebreaks, then apply \followtokens to each line ... you don't
even
>need a reflected font! Actually, any kind of rotatation/skewing/etc, normally
>achieved with PSTricks, could be achieved this way, in a
driver-independent way

The current method would break on complicated tex code, since we (using
some tricks) work on token lists. Imagine languages where 4 chars become
one lig. 

However, i do have a slightly other alternatuve running here, but need to
finish it with regards to spacing. That one works ike : 

followtokens("some complicated string", path, offset); 

Technically it comes down to feeding the string into a btex/etex and
disassembling the resulting picture. Faster, less mem, more beautiful, but
less instructive -)

Concerning multiple path's, it should not be that hard to support auto
splitting. 

In your patch, i wonder why you don't use two followtokens, since you can
overlay pictures and by setting the boundingbox explicitly you can then
achieve the same results. I will look into your code later [maybe next
month, when i start revisioning the metafun manual]. 

Hans  

-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: Metafun::followtokens : more than one path; possible enhancements; notes
  2001-01-28 21:02 Metafun::followtokens : more than one path; possible enhancements; notes Giuseppe Bilotta
  2001-01-29 12:51 ` Hans Hagen
@ 2001-01-29 16:26 ` Giuseppe Bilotta
  1 sibling, 0 replies; 3+ messages in thread
From: Giuseppe Bilotta @ 2001-01-29 16:26 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

Hello,

for you MetaFun fanatics ... patched my patch ... (sorry if I'm filling up your
mails; maybe I should only send this to Hans Hagen, but since I know some other
people here enjoy metafun, I thought that they might like to test it ...)

This time you can choose a different RotFont and a different RotColor for each
path. Also removed some debug code still hanging around ... hope you like it.

Nothing to do with this but ... is there an official TeX logo (lion head)? And a
METAPOST logo (lioness head)? And a METAFUN logo (what' that, anyway?)?If they
do exist, do you know if they're available in vectorial format?

Giuseppe Bilotta

[-- Attachment #2: gb-fun.zip --]
[-- Type: application/x-zip-compressed, Size: 1932 bytes --]

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

end of thread, other threads:[~2001-01-29 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-28 21:02 Metafun::followtokens : more than one path; possible enhancements; notes Giuseppe Bilotta
2001-01-29 12:51 ` Hans Hagen
2001-01-29 16:26 ` Giuseppe Bilotta

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