%%
%% This is file `fontbook.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fontbook.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2011 by Raphaël Pinson <raphink@gmail.com>
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{fontbook}
    [2011/08/17 0.2 Generate a font book]
\ProvidesPackage{fontbook}
\RequirePackage{fontspec}
\RequirePackage{xunicode}
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{
   family=fontbook,
   prefix=fontbook@,
}
%% Options
\def\fontbook@allsizes{%
 huge, LARGE, Large, large, normalsize,
 small, footnotesize, scriptsize, tiny}
\expandafter\DeclareStringOption\expandafter[\fontbook@allsizes]{sizes}
\def\fontbook@allfeatures{%
 scshape, itshape, bfseries}
\expandafter\DeclareStringOption\expandafter[\fontbook@allfeatures]{features}
\def\fontbook@defaultfeaturesize{large}
\expandafter\DeclareStringOption\expandafter[\fontbook@defaultfeaturesize]{featuresize}
\ProcessKeyvalOptions*
\def\fontbook@sampletext{%
 Dans l'affliction éphémère qui m'accable, je teste
 la police d'affichage qui est utilisée sur cette page 1 2 3 4 5.
}
\newcommand{\sampletext}[2][]{%
 {\par\csname#2\endcsname \csname#1\endcsname
 #2 #1\\ \fontbook@sampletext}}
\newcommand{\setsampletext}[1]{%
 \def\fontbook@sampletext{#1}}
\newcommand{\samplefeature}[1]{%
 \sampletext[#1]{\fontbook@featuresize}}
%% TODO: call font once
%%%% print all variants
\newcommand{\printfont}[3][\empty]{%
   \fontspec[#1]{#2}
   \section*{#2 #1 --- Licence: #3}
   \ifx#1\empty
     \addcontentsline{toc}{section}{#2}
   \else
     \addcontentsline{toc}{subsection}{#1}
   \fi
   \expandafter\forcsvlist\expandafter\sampletext\expandafter{\fontbook@sizes}
   \expandafter\forcsvlist\expandafter\samplefeature\expandafter{\fontbook@features}
   \pagebreak
}
\endinput
%%
%% End of file `fontbook.sty'.
