summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/fontbook
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-02 00:04:52 +0000
committerKarl Berry <karl@freefriends.org>2011-08-02 00:04:52 +0000
commit8cb09a6490220c7e2df1022ea66743b9afa234be (patch)
treeb6583fdf3492acc4ab75611fc2bdeea2f675ec1a /Master/texmf-dist/tex/xelatex/fontbook
parent9bed658d6e82bcd183d49e4da7e72fd414eea759 (diff)
new xelatex package fontbook (7jul11)
git-svn-id: svn://tug.org/texlive/trunk@23307 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/fontbook')
-rw-r--r--Master/texmf-dist/tex/xelatex/fontbook/fontbook.sty71
1 files changed, 71 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/xelatex/fontbook/fontbook.sty b/Master/texmf-dist/tex/xelatex/fontbook/fontbook.sty
new file mode 100644
index 00000000000..13c05000dc4
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/fontbook/fontbook.sty
@@ -0,0 +1,71 @@
+%%
+%% 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/07/05 0.1 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'.