From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25148 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: followtokens Date: Fri, 13 Jan 2006 19:09:44 +0100 Message-ID: <43C7ECE8.1010802@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1137175824 5821 80.91.229.2 (13 Jan 2006 18:10:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2006 18:10:24 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 13 19:10:22 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1ExTN4-0003DG-ER for gctc-ntg-context-518@m.gmane.org; Fri, 13 Jan 2006 19:09:54 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 46D4B12820; Fri, 13 Jan 2006 19:09:53 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05196-01-2; Fri, 13 Jan 2006 19:09:50 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 387FE127DC; Fri, 13 Jan 2006 19:09:50 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 22B0F127E2 for ; Fri, 13 Jan 2006 19:09:48 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05186-01-2 for ; Fri, 13 Jan 2006 19:09:46 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id C736C127DC for ; Fri, 13 Jan 2006 19:09:46 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 502 for ; Fri, 13 Jan 2006 13:20:21 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:25148 Archived-At: Alexandre Billon wrote: > Dear all, > > I am quite new to context (but love it) and i am trying tind a way to > typeset texts "properly kerned" in such a way that the characters be > all rotated with tiny randomized angle (strange project indeed). I > tried to do it by writing a macro inspired by \followtokens. I have > two questions : > > 1. It works but just for text within a single line : I have no clue > how to manage the line breaking, and I have to admit that I don't > know eanough TeX ConTeXt to find out. > > 2. In playing with the macro followtoken I happened to write two files > with no apparent significant difference (I mean for me) but which give > quite different results : one properly kerned, and another that is > not. Could someone explain me what's happening here ? (files attached) > \startMPenvironment[global] \definefont[RotFont][RegularBold] \stopMPenvironment \def\whatever#1% {\appendtoks#1\to\MPtoks \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}% \startMPdrawing n := n + 1 ; len[n] := \the\wd\MPbox ; \stopMPdrawing \startMPdrawing[-] pic[n] := btex \RotFont\setstrut\strut#1 etex ; \stopMPdrawing} \def\funnywriting#1% {\bgroup \resetMPdrawing \startMPdrawing picture pic[] ; numeric wid[], len[], pos[], n ; wid[0] := len[0] := pos[0] := n := 0 ; \stopMPdrawing \handletokens#1\with\whatever \startMPdrawing for i=1 upto n : wid[i] := abs(xpart lrcorner pic[i] - xpart llcorner pic[i]) ; pos[i] := len[i]-wid[i] ; pic[i] := pic[i] rotatedaround(origin, -10 randomized 20) ; pic[i] := pic[i] shifted (pos[i],0) ; draw pic[i]; endfor ; \stopMPdrawing \MPdrawingdonetrue \getMPdrawing \resetMPdrawing \egroup} \starttext \funnywriting{La vie est belle} \stoptext watch the rotatedaround: you have to provide a pair as first argument (so both your files failed) Hans