ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Renaud AUBIN <aubin@nibua-r.org>
Subject: Re: Context and CD labels
Date: Fri, 20 Oct 2006 09:45:50 +0200	[thread overview]
Message-ID: <45387EAE.2090209@nibua-r.org> (raw)
In-Reply-To: <eh9cff$c17$1@sea.gmane.org>

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

Maurí­cio a écrit :

>   It's working now, I've just downloaded that file. I belive that paper 
>is letter, although A4 is usually a lot more common here.
>   Sections are not that important, as long as I can have different 
>formats for some lines of text, and I'm sure that's not a problem. For 
>sure, an example would be great!
>  
>

I'll let you do the job for positionning. You'll find as attached an
example... Since it's not obvious to me to make a shapetext with a holed
shape (I have tried some tricks but failed), I reserved 2 text areas:
1. (test 1) song list for example
2. (test 2|framedtext) Author & title

This example assumes that :
- the first label is centered on x=.5\paperwidth y=.75\paperwidth
- the second is centered on x=.5\paperwidth y=.25\paperheight

You can even put a background image if you want, using overlay and clip...

Renaud

[-- Attachment #2: cdlabels.tex --]
[-- Type: text/x-tex, Size: 3052 bytes --]

\setuppapersize[A4][A4]
\setuppagenumbering[state=stop]
\setupcolors[state=start]

\useMPlibrary[txt]

\startuseMPgraphic{test 1}
path p;
numeric orad, irad; orad := 6cm; irad := 2cm;
path outercircle; outercircle := fullcircle scaled 2orad;
path innercircle; innercircle := fullcircle scaled 2irad;
path outershape; 
outershape := outercircle cutbefore((0,irad)--(orad,irad))
cutafter((0,-irad)--(orad,-irad));
path innershape;
innershape := reverse (innercircle cutbefore((0,irad)--(irad,irad))
cutafter((0,-irad)--(irad,-irad)));
p:= outershape--innershape--cycle;
build_parshape(p,6pt,0,0,\baselinedistance,\strutheight,\strutdepth,\strutheight) ;
%draw p withpen pencircle scaled 1pt ;
\stopuseMPgraphic

\startuseMPgraphic{test 2}
path p;
numeric orad, irad; orad := 6cm; irad := 2cm;
path outercircle; outercircle := fullcircle scaled 2orad;
path innercircle; innercircle := fullcircle scaled 2irad;
path outershape; 
outershape := outercircle rotated 90
cutbefore((0,-irad)--(orad,-irad))
cutafter((0,irad)--(orad,irad));
path innershape;
innershape := reverse (innercircle rotated 90
cutbefore((0,-irad)--(irad,-irad))
cutafter((0,irad)--(irad,irad)));
p:= outershape--innershape--cycle;
build_parshape(p,6pt,0,0,\baselinedistance,\strutheight,\strutdepth,\strutheight) ;
%draw p withpen pencircle scaled 1pt ;
\stopuseMPgraphic

\defineoverlay[test 1][\useMPgraphic{test 1}]
\defineoverlay[test 2][\useMPgraphic{test 2}]

\startuseMPgraphic{CDShape}
draw fullcircle scaled 12cm;
draw fullcircle scaled 4cm;
\stopuseMPgraphic

\starttext

\setupframed[offset=overlay,align=normal,frame=off,width=\parwidth,height=\parheight]

\startproperty[hidden]
I need some text to get the page... but also need to hide this text !
\stopproperty

\definelayer[PageLayer][position=yes]
\setupbackgrounds[page][background=PageLayer]
\setuplayer[PageLayer][position=no,corner=bottom,height=\paperheight]

%% check-up shape
\setlayer[PageLayer][x=.5\paperwidth,y=.75\paperheight,location=c]{\useMPgraphic{CDShape}}

%% text
\startshapetext[test 1]
\input tufte
\stopshapetext
% x = .5\paperwidth (210mm) - orad
\setlayer[PageLayer][x=45mm,y=.75\paperheight,location=r]{\framed[background=test 1]{\getshapetext}}

\startshapetext[test 2]
\input knuth
\stopshapetext
% x = .5\paperwidth (210mm) + orad
%\setlayer[PageLayer][x=165mm,y=.75\paperheight,location=l]{\framed[background=test 2]{\getshapetext}}

\setlayer[PageLayer][x=145mm,y=.75\paperheight,location=c]{\framedtext[width=4cm,align=middle,frame=off]{Author \& Title\crlf and more if you want}}

%% check-up shape
\setlayer[PageLayer][x=.5\paperwidth,y=.25\paperheight,location=c]{\useMPgraphic{CDShape}}

% text
\startshapetext[test 1]
\input zapf
\stopshapetext
% x = .5\paperwidth (210mm) - orad
\setlayer[PageLayer][x=45mm,y=.25\paperheight,location=r]{\framed[background=test 1]{\getshapetext}}

\startshapetext[test 2]
\input knuth
\stopshapetext
% x = .5\paperwidth (210mm) + orad
\setlayer[PageLayer][x=165mm,y=.25\paperheight,location=l]{\framed[background=test 2]{\getshapetext}}


\stoptext

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

  reply	other threads:[~2006-10-20  7:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-18 18:34 Maurício
2006-10-18 20:45 ` Henning Hraban Ramm
2006-10-19  2:36   ` Maurí­cio
2006-10-18 21:00 ` Renaud AUBIN
2006-10-19  2:51   ` Maurí­cio
2006-10-19 12:12     ` Renaud AUBIN
2006-10-20  2:32       ` Maurí­cio
2006-10-20  7:45         ` Renaud AUBIN [this message]
2006-10-20 12:31           ` Maurício

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45387EAE.2090209@nibua-r.org \
    --to=aubin@nibua-r.org \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).