% engine=luatex

% Poster cq. cover made for meeting in Epen.

\doifmodeelse {local} {
    \definepapersize
      [A3-undersized]
      [width=29.5cm,
       height=39.5cm]
    \setuppapersize
      [A3-undersized]
      [oversized]
} {
    \setuppapersize
      [A4]
      [A4]
}

\setuplayout
  [location=middle,
   marking=on]

\definelayer
  [page]
  [width=\paperwidth,
   height=\paperheight]

\definemeasure[width] [\paperwidth]
\definemeasure[height][\paperheight]

\setupcolors
  [state=start]

\definefontfeature
  [default]
  [kern=yes]

\starttext

\def\FlushMe#1{#1 }%

\def\FlushScripts
  {\processcommacommand
     [\ctxlua{tex.sprint(table.concat(table.sortedkeys(fonts.otf.tables.scripts),","))}]
     \FlushMe}

\def\FlushLanguages
  {\processcommacommand
     [\ctxlua{tex.sprint(table.concat(table.sortedkeys(fonts.otf.tables.languages),","))}]
     \FlushMe}

\doifmodeelse {local} {
    \definefont[One][palatinosansinflcom-regular     at 24pt]
    \definefont[Two][palatinosansinflcom-med*default at 48pt]
} {
    \definefont[One][palatinosansinflcom-regular     at 16pt]
    \definefont[Two][palatinosansinflcom-med*default at 40pt]
}

\startsetups left

    \start
        \One
        \setupinterlinespace
        \emergencystretch 10em
        \parfillskip 0pt

        \baselineskip1\baselineskip plus 10pt

        \FlushLanguages \unskip\endgraf

        \nointerlineskip \vskip12pt

        \start
            \raggedleft
            \advance\rightskip12pt
            \Two
            \setupinterlinespace
            \strut International\endgraf
            \strut ConTeXt\endgraf
            \strut Conference\endgraf
            \strut Epen 2007\endgraf
        \stop

        \vskip12pt

        \FlushScripts \unskip \endgraf

        \kern 0pt
    \stop

\stopsetups

\setupbackgrounds
  [page]
  [background=pagebackground]

\defineoverlay
  [pagebackground]
  [\useMPgraphic{pagebackground}]

\startuseMPgraphic{pagebackground}
    StartPage ;
        width := bbwidth(Page) ;
        height := bbheight(Page) ;
        bleed := 4pt ;
        for i=0 upto 10-1 :
            fill
                (Page xscaled 1/10)
                shifted (i*width/10,0)
                withcolor transparent(1,(i+1)/15,red) ;
        endfor ;
        for j=0 upto 10-1 :
            fill
                (Page yscaled 1/10)
                shifted (0,j*height/10)
                withcolor transparent(1,(j+1)/15,blue) ;
        endfor ;
        currentpicture := currentpicture
            xysized(width+2*bleed,height+2*bleed)
            shifted (-bleed,-bleed) ;
    StopPage
\stopuseMPgraphic

\setuplayout[page]

\startstandardmakeup

    \setlayerframed
      [page]
      [preset=lefttop]
      [offset=6pt,
       foregroundcolor=white,
       frame=off,
       align=normal,
       top=,bottom=,
       width=\measure{width},
       height=\measure{height}]
      {\setups{left}}

    \flushlayer
      [page]

\stopstandardmakeup

\stoptext
