| The following is another liner producer, this time POSTSCRIPT for
the LPS40. Originally posted in the SCRIPTPRINTERS notesfile.
Instructions are in the text (its well commented). It produces 6 liners
to an A4 page and allows some customisation of the presentation. You
just add the titles and the play lists to the end of the file in the
format used in this example.
Have fun,
Scott
%!
% Created in 1988 by David B. Miller.
% No rights reserved. No liabilities assumed.
%
% This file MUST be printed with the qualifier:
% /SETUP=(LPS$DECMCSENCODING,LPS$FINDFONT_ISOLATIN1_DECMCS_V40)
%
% For debugging purposes, add LPS$ERRORHANDLER to the /SETUP list
%
% This file is made especially for the DEC LPS40, and uses the DEC
% Multinational Character Set to obtain the Greek letter "mu" without
% switching fonts.
%
%
/inch {72 mul} def
/fhi 2.625 inch def % Front side height
/ehi 0.5 inch def % End height
/bhi 0.625 inch def % Back side height
/thi fhi ehi bhi add add def % Total height of liner
/tlen 4 inch def % Total width of liner
/shi 20 def % Height of "Side #" box
/slen tlen 2 div def % Width of one side
/lhi ehi def % Height of Logo
/llen .75 inch def % Width of Logo
/sscale .9 def % Amount to scale each level of song titles
/tscale 1 sscale div def % Amount to scale text by when songs are scaled
/wordbreak ( ) def
/landscape
{ 8.5 inch 0.25 inch translate % Move the coordinate system
90 rotate } def % and rotate the axis.
/boldfont
/NewCenturySchlbk-Bold-DECMCS findfont 13 scalefont def
/romanfont
/NewCenturySchlbk-Roman-DECMCS findfont def
/larger % Stack: n1 n2 => n3
% Returns larger of two numbers
{ 2 copy lt {exch} if pop } def
/smaller % Stack: n1 n2 => n3
% Returns smaller of two numbers
{ 2 copy gt {exch} if pop } def
%
% The `logo' macro. Change this as you desire
% The placement and size of the text was derived via FM.
/logo % Draws the `logo' on the liner
{ gsave
0 bhi translate
newpath
0 0 moveto
llen 0 lineto
llen lhi lineto
0 lhi lineto
closepath 0 setgray fill % Make the black box
1 setgray % Now work in white
0 lhi .7 mul moveto % Put "Cecil B" at the top...
romanfont lhi 4 div scalefont setfont
(Cecil B) lhi 4 div llen cbox
0 lhi 3 div moveto % "D'Miller" in the middle...
romanfont lhi .35 mul scalefont setfont
(D'Miller) lhi .4 mul llen cbox
0 lhi 12 div moveto % and "Productions" at the bottom
romanfont lhi 4 div scalefont setfont
(Productions) lhi 4 div llen cbox
grestore
} def
/mypathbbox % stack: string => sw sh
% Determines stringwidth and font-height
{ stringwidth pop % Find width
gsave
0 0 moveto
(A) true charpath % Use an "A" for the height of all strings.
flattenpath pathbbox
4 1 roll pop pop pop
grestore
} def
%
%
% The following routines are kludges to get multiple section
% titles to work. Each section within a section is reduced
% by the amount specified by sscale.
%
/mylength2 % stack: array => length
{ 0 exch
{ dup type /arraytype eq
{ mylength2 sscale mul add }
{ pop 1 add } ifelse
} forall
} def
/mylength
{ dup type /arraytype eq
{ mylength2 }{ pop 1 } ifelse
} def
/power % stack: n1 n2 => n1^n2
{ 1 1 1 4 -1 roll
{ pop 1 index mul } for
exch pop
} def
% Scale multi-line song titles.
%
/scalesongs
{ /depth depth 1 add def
gsave
dup sscale dup scale
5 tscale depth power mul 0 rmoveto
{ dup mylength 1 eq
{ 0 temp1 neg rmoveto
gsave
temp1 slen 10 sub tscale depth power mul lbox
grestore }
{ scalesongs } ifelse
} forall
grestore
mylength sscale mul temp1 mul neg 0 exch rmoveto
/depth depth 1 sub def
} def
%
/cbox % stack: string box-height box-width
% Centers string in specified box
{ gsave
currentpoint translate
newpath
0 0 moveto
2 index mypathbbox % () bh bw sw sh
3 1 roll % () bh sh bw sw
2 copy lt % Squeeze the text if its too wide...
{ div /temp3 exch def
currentfont [temp3 0 0 1 0 0] makefont setfont 1 1
} if
sub 2 div 3 1 roll sub 2 div
moveto show
grestore
} def
/lbox % stack: string box-height box-width
% Centers string VERTICALLY in box
{ gsave
currentpoint translate
newpath
0 0 moveto
2 index mypathbbox % () bh bw sw sh
3 1 roll % () bh sh bw sw
2 copy lt % Squeeze the text if its too wide...
{ div /temp3 exch def
currentfont [temp3 0 0 1 0 0] makefont setfont
}{pop pop} ifelse
sub 2 div 0 exch moveto show
grestore
} def
%
/newline % stack: LM line-sep
{ currentpoint exch pop sub neg moveto } def
% This line-breaking algorith is crude, but works *most* of the time.
/breakline
{ /breakproc exch def
/linewidth exch def
/textstring exch def
/breakwidth wordbreak stringwidth pop def
/curwidth 0 def
/lastwordbreak 0 def
/startchar 0 def
/restoftext textstring def
{ restoftext wordbreak search
{ /nextword exch def pop
/restoftext exch def
/wordwidth nextword stringwidth pop def
curwidth wordwidth add linewidth gt
{ textstring startchar lastwordbreak startchar sub
getinterval breakproc
/startchar lastwordbreak def
/curwidth wordwidth breakwidth add def }
{ /curwidth curwidth wordwidth add
breakwidth add def
} ifelse
/lastwordbreak lastwordbreak nextword length add 1 add def
}
{ pop exit } ifelse
} loop
/lastchar textstring length def
textstring startchar lastchar startchar sub
getinterval breakproc
} def
%
/liner % stack: x y
{ gsave translate
logo % Do the logo
newpath % Draw the outer box
0 0 moveto
tlen 0 lineto
tlen thi lineto
0 thi lineto
closepath
0 bhi moveto % Bottom fold mark
tlen 0 rlineto
0 ehi rmoveto % Top fold mark
tlen neg 0 rlineto
slen 0 rmoveto % Vertical side divider
0 fhi shi sub rlineto
slen 0 rmoveto % Horizontal side divider
tlen neg 0 rlineto
.5 setlinewidth stroke % The actual drawing
boldfont setfont % Set bold for "Side 1" and "Side 2"
0 thi shi sub moveto % Center "Side 1" in its box
(Side 1) shi slen cbox
slen thi shi sub moveto % Center "Side 2" in its box
(Side 2) shi slen cbox
%
% Do the liner notes:
%
% Each element of the array is considered a new line.
% Liner notes are based on a maximum of 4 lines.
% If an element of the liner notes is too long, it will be wrapped,
% taking up an extra line.
% Fewer lines do not change the size of the font.
% More than 4 lines will not print properly; Use less text.
%
% There are two small bugs in the algorithm:
% 1) End of string is not equivalent to a space,
% so overflow can occur. If it does, put a
% space an the end of the string. (This is a
% bug in the line-breaking algorithm.)
%
% 2) Wrapped lines are indented an extra 5 points,
% but the line breaking procedure does not get
% updated with the new line width. To get around
% this, the line width is set to be 5 points less
% than it should be. This can cause underflow on
% the first line. Bug #1 can be taken advantage of
% when the last word of a single line note gets wrapped
% when it could have fit on the first line.
%
% I haven't decided what the best method is for fixing
% this. The problem stems from the fact that the crude
% line-breaking algorithm came first, this application
% was then shoe-horned into it. A re-write of that algorithm
% specifically for this application would probably be the
% best solution.
%
/temp1 bhi 10 sub 4 div def
/temp2 { show 10 temp1 2 add newline } def
5 bhi temp1 1.5 add sub moveto
romanfont temp1 scalefont setfont
album dup 0 get
{ tlen 15 sub {temp2} breakline -5 0 rmoveto } forall
%
% Put the title(s) on the end with the logo
%
% Size of title lines is based on the number of lines specified.
% Maximum font size is 14 points.
% Using only 1 or 2 title lines works best.
% More than 3 title lines would probably be unreadable.
%
% It would be a good idea to add options to allow
% automatic centering or global squeezing of the titles.
% For now, this can be accomplished with a judicious use
% of spaces.
%
dup 1 get
dup length dup dup 1 add div /temp2 exch def
ehi exch div /temp1 exch def
romanfont temp1 2 sub 14 smaller scalefont setfont
temp1 (A) mypathbbox exch pop dup /temp1 exch def
sub temp2 mul temp1 add /temp2 exch def
llen 5 add bhi ehi add temp2 sub moveto
{ temp1 tlen llen 10 add sub lbox
0 temp2 neg rmoveto
} forall
%
% Finally put the songs on each side.
%
% Size of song names is based on the number of songs on the side
% Maximum font size is 11 points
% 14 lines isn't too bad. 18 is still readable (Up close)
%
% Work should be done to accomodate titles that have
% multiple sections. This isn't necessarily easy.
%
% Actually, there is now some _very_crude_ code to
% handle multiple sections. I'm not proud of it,
% but it works good enough for now. The main thing
% I don't like is that the whitespace above and below
% each line isn't equally divided. The calculations
% are made as if there were a dividing line between
% the titles, but there is not.
%
2 get 0 thi shi sub moveto
{ gsave
currentpoint translate
dup mylength fhi shi sub exch div /temp1 exch def
romanfont temp1 3 sub 11 smaller scalefont setfont
{ /depth 0 def
dup mylength 1 eq
{ 0 temp1 neg rmoveto
gsave
currentpoint translate newpath
0 0 moveto slen 0 lineto stroke
5 0 moveto
temp1 slen 10 sub lbox
grestore }
{ scalesongs
gsave slen 0 rlineto stroke grestore
} ifelse
} forall
grestore
slen 0 rmoveto
} forall
grestore } def
%-------------------------------------------------------------------------------
%
/bl 11 inch tlen 2 mul sub 3 div def % Figure out page placement values
/bh 8.5 inch thi 2 mul sub 3 div def % Page size is assumed to be 8.5 x 11
% On a landscape orienated page, four normal-sized
% liners can be printed. Their placement values are:
% (bl, bh)
% (bl, bh*2+thi)
% (bl*2+tlen, bh)
% (bl*2+tlen, bh*2+thi)
%
% The liner procedure is called with two arguments
% on the stack; The coordinates of where to place the
% liner. Also passed is the contents of the liner
% in the `album' array. The layout of this array
% is as follows:
%
% ------------------------
% | Array of liner notes |
% ------------------------
% | Array of title lines |
% ------------------------
% | Array of song titles |
% ------------------------
%
%
landscape
/album
[ [ (High Bias, 70�s EQ, Dolby NR)
(Missing ``Captain Jack'', ``The Night Is Still Young'' and\
``Scenes From An Italian Restaurant'') ]
[ ( Billy Joel)
(Greatest Hits Volume I & Volume II) ]
[ [ (Piano Man)
(The Entertainer)
(Say Goodbye To Hollywood)
(New York State Of Mind)
(The Stranger)
(Just The Way You Are)
(Movin' Out (Anthony's Song))
(Only The Good Die Young)
(She's Always A Woman)
(You're Only Human (Second Wind)) ]
[ (My Life)
(Big Shot)
(You May Be Right)
(It's Still Rock And Roll To Me)
(Don't Ask Me Why)
(She's Got A Way)
(Pressure)
(Allentown)
(Goodnight Saigon)
(Tell Her About It)
(Uptown Girl)
(The Longest Time) ] ]
] def
bl bh liner
%
/album
[ [ (High Bias, 70�s EQ, Dolby NR)
(Missing ``Remember When The Music (Reprise)'' and ``Oh Man''\
from Remember When The Music) ]
[ (Harry Chapin: Heads & Tales )
(Harry Chapin: Remember When The Music) ]
[ [ (Could You Put Your Light On, Please)
(Greyhound)
(Everybody's Lonely)
(Sometime, Somewhere Wife)
(Empty)
(Taxi)
(Any Old Kind Of Day)
(Dogtown)
(Same Sad Singer) ]
[ (Remember When The Music)
(I Miss America)
(Story Of A Life)
(Sequel)
(Up On The Shelf)
(Salt And Pepper)
(God Babe, You've Been Good For Me)
(Northwest 222)
(I Finally Found It Sandy)
(Hokey Pokey) ] ]
] def
bl bh 2 mul thi add liner
%
/album
[ [ (High Bias, 70�s EQ, Dolby NR)
(Missing ``Ebony And Ivory'', ``Say Say Say'' and ``C Moon'') ]
[ ( Paul McCartney: All The Best!) ]
[ [ (Band On The Run)
(Jet)
(Listen To What The Man Said)
(Let `Em In)
(Live And Let Die)
(Another Day)
(Uncle Albert / Admiral Halsey) ]
[ (No More Lonely Nights)
(Silly Love Songs)
(Junior's Farm)
(Coming Up)
(Goodnight Tonight)
(With A Little Luck)
(My Love) ] ]
] def
bl 2 mul tlen add bh liner
%
/album
[ [ (High Bias, 70�s EQ, Dolby NR) ]
[ (Emerson, Lake & Palmer)
(ELP: Brain Salad Surgery) ]
[ [ (The Barbarian)
(Take A Pebble)
(Knife-Edge)
[ (The Three Fates)
[ (Clotho)
(Lachesis)
(Atropos) ] ]
(Tank)
(Lucky Man) ]
[ (Jerusalem)
(Toccata)
(Still... You Turn Me On)
(Benny The Bouncer)
[ (Karn Evil 9)
[ (1st Impression, Part 1)
(1st Impression, Part 2)
(2nd Impression)
(3rd Impression) ] ] ] ]
] def
bl 2 mul tlen add bh 2 mul thi add liner
showpage
%
landscape
/album
[ [ (High Bias, 70�s EQ, Dolby NR)
(Missing ``Stranded In A Limousine'' and ``Something So Right'' from\
``Greatest Hits, Etc.'' ) ]
[ (Simon And Garfunkel's Greatest Hits)
(Paul Simon: Greatest Hits, Etc.) ]
[ [ (Mrs. Robinson)
(For Emily, Whenever I May Find Her)
(The Boxer)
(The 59th Street Bridge Song (Feelin' Groovy))
(The Sound Of Silence)
(I Am A Rock)
(Scarborough Fair / Canticle)
(Homeward Bound)
(Bridge Over Troubled Water)
(America)
(Kathy's Song)
(El Condor Pasa (If I Could))
(Bookends)
(Cecilia) ]
[ (Slip Slidin' Away)
(Still Crazy After All These Years)
(Have A Good Time)
(Duncan)
(Me And Julio Down By The Schoolyard)
(Kodachrome)
(I Do It For Your Love)
(50 Ways To Leave Your Lover)
(American Tune)
(Mother And Child Reunion)
(Loves Me Like A Rock)
(Take Me To The Mardi Gras) ] ]
] def
bl bh liner
%
/album
[ [ (High Bias, 70�s EQ, Dolby NR)
(Missing ``Don't Go Breaking My Heart'' from Volume II) ]
[ (Elton John: Greatest Hits )
(Elton John: Greatest Hits Volume II) ]
[ [ (Your Song)
(Daniel)
(Honky Cat)
(Goodbye Yellow Brick Road)
(Saturday Night's Alright For Fighting)
(Rocket Man)
(Bennie And The Jets)
(Don't Let The Sun Go Down On Me)
(Border Song)
(Crocodile Rock) ]
[ (The Bitch Is Back)
(Lucy In The Sky With Diamonds)
(Sorry Seems To Be The Hardest Word)
(Someone Saved My Life Tonight)
(Philadelphia Freedom)
(Island Girl)
(Grow Some Funk Of Your Own)
(Levon)
(Pinball Wizard) ] ]
] def
bl bh 2 mul thi add liner
%
/album
[ [ (High Bias, 70�s EQ, Dolby NR) ]
[ (Eagles: Their Greatest Hits 1971-1975)
(Eagles: Greatest Hits Volume 2 ) ]
[ [ (Take It Easy)
(Witchy Woman)
(Lyin' Eyes)
(Already Gone)
(Desperado)
(One Of These Nights)
(Take It To The Limit)
(Peaceful, Easy Feeling)
(Best Of My Love)
[ (From ``Greatest Hits Volume 2'')
(Victim Of Love) ] ]
[ (Hotel California)
(Heartache Tonight)
(Seven Bridges Road)
(The Sad Cafe)
(Life In The Fast Lane)
(I Can't Tell You Why)
(New Kid In Town)
(The Long Run)
(After The Thrill Is Gone)
[ (From ``Their Greatest Hits 1971-1975'')
(Tequila Sunrise) ] ] ]
] def
bl 2 mul tlen add bh liner
%
/album
[ [ (High Bias, 70�s EQ, Dolby NR) ]
[ (Huey Lewis And The News: Sports)
(Huey Lewis And The News: Fore! ) ]
[ [ (The Heart Of Rock & Roll)
(Heart And Soul)
(Bad Is Bad)
(I Want A New Drug)
(Walking On A Thin Line)
(Finally Found A Home)
(If This Is It)
(You Crack Me Up)
(Honky Tonk Blues) ]
[ (Jacob's Ladder)
(Stuck With You)
(Whole Lotta Lovin')
(Doing It All For My Baby)
(Hip To Be Square)
(I Know What I Like)
(I Never Walk Alone)
(Forest For The Trees)
(Naturally)
(Simple As That) ] ]
] def
bl 2 mul tlen add bh 2 mul thi add liner
showpage
%pstack
|