From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36689 Path: news.gmane.org!not-for-mail From: Duane Johnson Newsgroups: gmane.comp.tex.context Subject: Re: externalfigure rotation Date: Wed, 19 Sep 2007 16:31:46 -0600 Message-ID: <69F8A9DE-67BD-495E-BB06-2781FD20C7A8@gmail.com> References: <6703815B292B664DBAEC55EE3192386A20BB70@poseidon.in.dynetics.com> <20070919135532.de5137de.schuster.wolfgang@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1190243313 8040 80.91.229.12 (19 Sep 2007 23:08:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2007 23:08:33 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Sep 20 01:08:31 2007 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 lo.gmane.org with esmtp (Exim 4.50) id 1IY8el-0002SP-1r for gctc-ntg-context-518@m.gmane.org; Thu, 20 Sep 2007 01:08:31 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5D5181FE1B; Thu, 20 Sep 2007 01:08:18 +0200 (CEST) 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 14510-02-3; Thu, 20 Sep 2007 01:08:18 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0454320107; Thu, 20 Sep 2007 00:32:27 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DDDA020103 for ; Thu, 20 Sep 2007 00:32:18 +0200 (CEST) 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 10630-01 for ; Thu, 20 Sep 2007 00:32:01 +0200 (CEST) Original-Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by ronja.ntg.nl (Postfix) with ESMTP id C2423200DD for ; Thu, 20 Sep 2007 00:32:00 +0200 (CEST) Original-Received: by nz-out-0506.google.com with SMTP id m7so350090nzf for ; Wed, 19 Sep 2007 15:31:59 -0700 (PDT) Original-Received: by 10.114.14.1 with SMTP id 1mr439695wan.1190241118726; Wed, 19 Sep 2007 15:31:58 -0700 (PDT) Original-Received: from ?192.168.1.101? ( [166.70.59.18]) by mx.google.com with ESMTPS id v25sm1446138wah.2007.09.19.15.31.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Sep 2007 15:31:57 -0700 (PDT) In-Reply-To: <20070919135532.de5137de.schuster.wolfgang@googlemail.com> X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:36689 Archived-At: Thanks for sharing this, Wolfgang. Very nice effects! Duane Johnson (canadaduane) On Sep 19, 2007, at 5:55 AM, Wolfgang Schuster wrote: > Hi Mike, > > you can control the rotation placement with the location key and the > value middle for location seems to be what you want but the the result > looks to me weird or broken and tried to fix this with the new value > center, you can see the results in small example below. > > \unprotect > > \def\dodorotatenextbox#1#2% quite some trial and error -) > {\dontshowcomposition > \dontcomplain > \ifnum#2=\plusfour > % new, location=middle > \!!widthb \nextboxwd > \!!heightb\nextboxht > \!!depthb \nextboxdp > \setbox\nextbox\vbox{\vskip.5\nextboxht\hskip-.5\nextboxwd > \flushnextbox}% \smashbox\nextbox > \else\ifnum#2=\plusfive > % wolf: location=center > \!!widthb \nextboxwd > \!!heightb\nextboxht > \!!depthb \nextboxdp > \setbox\nextbox\vbox{\vskip.5\nextboxht\hskip-.5\nextboxwd > \flushnextbox}% \smashbox\nextbox > \fi\fi > \!!widtha \nextboxwd > \!!heighta\nextboxht > \!!deptha \nextboxdp > \!!doneafalse > \!!donebfalse > \ifcase#2\or > % 1: fit > \or > % 2: depth, not fit > \!!doneatrue > \!!donebtrue > \or > % 3: depth, fit > \!!donebtrue > \fi > \setbox\nextbox\vbox{\hbox{\raise\nextboxdp\flushnextbox}}% > \!!dimena \nextboxht > \calculatecos\@@rorotation\edef\cos{\calculatedcos\@@rorotation}% > \calculatesin\@@rorotation\edef\sin{\calculatedsin\@@rorotation}% > \@@layerxpos\zeropoint > \@@layerypos\zeropoint > \@@layerxoff\zeropoint > \@@layeryoff\zeropoint > \ifdim\sin\points>\zeropoint > \ifdim\cos\points>\zeropoint > \@@layerxsiz \cos\!!widtha > \@@layerysiz \sin\!!widtha > \advance\@@layerxsiz \sin\!!dimena > \advance\@@layerysiz \cos\!!dimena > \@@layerypos \cos\!!dimena > \if!!donea > \@@layerxoff \negated\sin\!!dimena > \advance\@@layerxoff \sin\!!deptha > \fi > \if!!doneb > \@@layeryoff \cos\!!deptha > \fi > \dododorotatenextbox > \else > \@@layerxsiz \negated\cos\!!widtha > \@@layerysiz \sin\!!widtha > \advance\@@layerxsiz \sin\!!dimena > \advance\@@layerysiz \negated\cos\!!dimena > \@@layerxpos \negated\cos\!!widtha > \if!!donea > \@@layerxoff -\@@layerxsiz > \advance\@@layerxoff \sin\!!deptha > \fi > \if!!doneb > \@@layeryoff \negated\cos\!!heighta > \fi > \dododorotatenextbox > \wd\nextbox\if!!donea\sin\!!deptha\else\@@layerxsiz\fi > \fi > \else > \ifdim\cos\points<\zeropoint > \@@layerxsiz \negated\cos\!!widtha > \@@layerysiz \negated\sin\!!widtha > \advance\@@layerxsiz \negated\sin\!!dimena > \advance\@@layerysiz \negated\cos\!!dimena > \@@layerxpos \@@layerxsiz > \@@layerypos \negated\sin\!!widtha > \if!!donea > \@@layerxoff -\@@layerxsiz > \advance\@@layerxoff \negated\sin\!!heighta > \fi > \if!!doneb > \@@layeryoff \@@layerysiz > \advance\@@layeryoff \cos\!!deptha > \fi > \dododorotatenextbox > \wd\nextbox\if!!donea\negated\sin\!!heighta\else\@@layerxsiz\fi > \else > \@@layerxsiz \cos\!!widtha > \@@layerysiz \negated\sin\!!widtha > \advance\@@layerxsiz \negated\sin\!!dimena > \advance\@@layerysiz \cos\!!dimena > \ifdim\sin\points=\zeropoint > \@@layerxpos \zeropoint > \@@layerxoff \zeropoint > \@@layerypos \@@layerysiz > \if!!doneb > \@@layeryoff \!!deptha > \fi > \else > \@@layerypos \@@layerysiz > \@@layerxpos \negated\sin\!!dimena > \if!!donea > \@@layerxoff -\@@layerxsiz > \advance\@@layerxoff \negated\sin\!!heighta > \fi > \if!!doneb > \@@layeryoff \negated\sin\!!deptha > \fi > \fi > \dododorotatenextbox > \ifdim\sin\points=\zeropoint > \else > \wd\nextbox\if!!donea\negated\sin\!!heighta\else > \@@layerxsiz\fi > \fi > \fi > \fi > % new, location=middle > \ifnum#2=\plusfour > \setbox\nextbox\vbox{\vskip-.5\!!heightb\hskip.5\!!heightb > \flushnextbox}% \nextboxwd\!!widthb > \nextboxht\!!heightb > \nextboxdp\!!depthb > \else\ifnum#2=\plusfive > % wolf: location=center > \setbox\nextbox\vbox{\vskip.5\!!heightb\ifnum#1=270\relax > \hskip2\!! > heightb\fi\flushnextbox}% \nextboxwd\!!widthb > \nextboxht\!!heightb > \nextboxdp\!!depthb > \fi\fi} > > \def\complexrotate[#1]% framed met diepte ! > {\getparameters[\??ro][#1]% > \processaction > [\@@rolocation] > [ \v!depth=>\!!counta\plusthree\donefalse,% depth fit - raw > box \v!fit=>\!!counta\plustwo \donefalse,% depth tight - raw box > \v!broad=>\!!counta\plusone \donefalse,% nodepth fit - raw > box \v!high=>\!!counta\plusone \donetrue ,% nodepth fit - framed > \v!middle=>\!!counta\plusfour \donefalse,% centered, keep > dimensions \v!center=>\!!counta\plusfive \donefalse,% > \s!default=>\!!counta\plusthree\donetrue ,% depth fit - > framed > \s!unknown=>\!!counta\plusthree\donetrue ]% depth fit - > framed > \ifdone > \def\docommand{\localframed[\??ro][#1,\c!location=]}% > \else > \let\docommand\relax > \fi > \dowithnextbox{\dorotatenextbox\@@rorotation\!!counta\egroup}\vbox > \docommand} > > \protect > > \setuppapersize[A4,landscape][A4,landscape] > > \starttext > > \input knuth > \rotate[rotation=0]{\framed[width=4cm,height=2cm,align={middle,lohi}] > {Text}} text \rotate[rotation=90,location=center]{\framed > [width=4cm,height=2cm,align={middle,lohi}]{Text}} text \rotate > [rotation=180]{\framed[width=4cm,height=2cm,align={middle,lohi}] > {Text}} > text \rotate[rotation=270,location=center]{\framed > [width=4cm,height=2cm,align={middle,lohi}]{Text}} text %\rotate > [rotation=270]{\framed[width=4cm,height=2cm,align={middle,lohi}] > {Text}} > \input knuth > > \stoptext > > Wolfgang > ______________________________________________________________________ > _____________ > 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 : https://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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________