\enableregime[il9]
\useencoding[ffr]
\mainlanguage[fr]

%% Set output to pdf
\setupoutput[pdftex]
%% Activate txt in METAPOST
\useMPlibrary[txt]
%% Activate colors
\setupcolors[state=start]

% Paper size
\setuppapersize[A4][A4]

% Fonts settings for ConTeXt
\usetypescriptfile[type-buy]
\loadmapfile[ec-bh-lucida.map]
\usetypescript[lucida][ec]
\setupbodyfont[lucida,10pt]

\setuphead[chapter][header=high, command=\ChapterHeader, style=\tfd]
\def\ChapterHeader#1#2{%
  \framedtext
  [width= \overlaywidth,
  height=12\bodyfontsize,
  background=foreground,
  offset=0pt,
  strut=no,
  frame=off,
  align=left]{\blank[4\bodyfontsize,force]#1\blank[small]#2}} 

\setupbackgrounds[header][text][bottomframe=on]
\setupbackgrounds[footer][text][topframe=on]

% Indenting
\setupindenting[medium,yes]

% French
\setupheadtext[fr][pubs=Bibliographie]
\setuplabeltext[fr][chapter=Chapitre~]

\starttext

\chapter{Introduction}
\section{First dummy section}
\dorecurse{5}{\input knuth\par\ }
\section{Second dummy section}

\chapter{Dummy chapter}
\section{First dummy section}
\dorecurse{2}{\input knuth\par\ }
\section{Second dummy section}

\chapter{Another dummy chapter}
\section{First dummy section}
\dorecurse{5}{\input knuth\par\ }
\section{Second dummy section}

\stoptext
