| 1 |
%% |
| 2 |
%% This is file `fontbook.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% fontbook.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Copyright (C) 2011 by Raphaël Pinson <[email protected]> |
| 12 |
%% -------------------------------------------------------------------------- |
| 13 |
%% This work may be distributed and/or modified under the |
| 14 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 15 |
%% of this license or (at your option) any later version. |
| 16 |
%% The latest version of this license is in |
| 17 |
%% http://www.latex-project.org/lppl.txt |
| 18 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 19 |
%% version 2005/12/01 or later. |
| 20 |
%% |
| 21 |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 22 |
\ProvidesPackage{fontbook} |
| 23 |
[2011/08/17 0.2 Generate a font book] |
| 24 |
\ProvidesPackage{fontbook} |
| 25 |
\RequirePackage{fontspec} |
| 26 |
\RequirePackage{xunicode} |
| 27 |
\RequirePackage{kvoptions} |
| 28 |
\RequirePackage{etoolbox} |
| 29 |
\SetupKeyvalOptions{ |
| 30 |
family=fontbook, |
| 31 |
prefix=fontbook@, |
| 32 |
} |
| 33 |
%% Options |
| 34 |
\def\fontbook@allsizes{% |
| 35 |
huge, LARGE, Large, large, normalsize, |
| 36 |
small, footnotesize, scriptsize, tiny} |
| 37 |
\expandafter\DeclareStringOption\expandafter[\fontbook@allsizes]{sizes} |
| 38 |
\def\fontbook@allfeatures{% |
| 39 |
scshape, itshape, bfseries} |
| 40 |
\expandafter\DeclareStringOption\expandafter[\fontbook@allfeatures]{features} |
| 41 |
\def\fontbook@defaultfeaturesize{large} |
| 42 |
\expandafter\DeclareStringOption\expandafter[\fontbook@defaultfeaturesize]{featuresize} |
| 43 |
\ProcessKeyvalOptions* |
| 44 |
\def\fontbook@sampletext{% |
| 45 |
Dans l'affliction éphémère qui m'accable, je teste |
| 46 |
la police d'affichage qui est utilisée sur cette page 1 2 3 4 5. |
| 47 |
} |
| 48 |
\newcommand{\sampletext}[2][]{% |
| 49 |
{\par\csname#2\endcsname \csname#1\endcsname |
| 50 |
#2 #1\\ \fontbook@sampletext}} |
| 51 |
\newcommand{\setsampletext}[1]{% |
| 52 |
\def\fontbook@sampletext{#1}} |
| 53 |
\newcommand{\samplefeature}[1]{% |
| 54 |
\sampletext[#1]{\fontbook@featuresize}} |
| 55 |
%% TODO: call font once |
| 56 |
%%%% print all variants |
| 57 |
\newcommand{\printfont}[3][\empty]{% |
| 58 |
\fontspec[#1]{#2} |
| 59 |
\section*{#2 #1 --- Licence: #3} |
| 60 |
\ifx#1\empty |
| 61 |
\addcontentsline{toc}{section}{#2} |
| 62 |
\else |
| 63 |
\addcontentsline{toc}{subsection}{#1} |
| 64 |
\fi |
| 65 |
\expandafter\forcsvlist\expandafter\sampletext\expandafter{\fontbook@sizes} |
| 66 |
\expandafter\forcsvlist\expandafter\samplefeature\expandafter{\fontbook@features} |
| 67 |
\pagebreak |
| 68 |
} |
| 69 |
\endinput |
| 70 |
%% |
| 71 |
%% End of file `fontbook.sty'. |