summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-19 22:56:45 +0000
committerKarl Berry <karl@freefriends.org>2010-09-19 22:56:45 +0000
commiteb63d8487d763c750aa471fb4c63f5921b286db3 (patch)
treef7d1ea62c35b75a47f8b7272a482d9b955041629 /Master/texmf-dist/tex/latex/berenisadf/berenis.sty
parent0f3246084432cce62eeafbf11e702cb4720db9ec (diff)
berenisadf 1.004 (19sep10)
git-svn-id: svn://tug.org/texlive/trunk@19812 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/berenisadf/berenis.sty')
-rw-r--r--Master/texmf-dist/tex/latex/berenisadf/berenis.sty134
1 files changed, 134 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/berenisadf/berenis.sty b/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
new file mode 100644
index 00000000000..ef26da1e8fa
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
@@ -0,0 +1,134 @@
+%% Copyright 2010 Clea F. Rees
+%
+% 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.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clea F. Rees.
+%
+% This work consists of all files listed in manifest.txt.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{berenis}[2010/08/26 v1.0 berenis]
+\RequirePackage{xkeyval}
+\RequirePackage[LY1]{fontenc}
+\RequirePackage{nfssext-cfr}
+%:boolkeys for ligature/swash encoding as default
+\define@boolkey{berenis.sty}[berenis@]{lig}[true]{%
+ \ifberenis@lig
+ \def\berenis@lig{w}%
+ \else
+ \def\berenis@lig{}%
+ \fi}
+%:boolkeys for roman osf/lf
+\define@boolkey{berenis.sty}[berenis@]{osf}[true]{%
+ \ifberenis@osf
+ \def\berenis@lfosf{j}%
+ \else
+ \def\berenis@lfosf{}%
+ \fi}
+\define@boolkey{berenis.sty}[berenis@]{lf}[true]{%
+ \ifberenis@lf
+ \def\berenis@lfosf{}%
+ \else
+ \def\berenis@lfosf{j}%
+ \fi}
+%:boolkeys for roman prop/tab
+\define@boolkey{berenis.sty}[berenis@]{prop}[true]{%
+ \ifberenis@prop
+ \def\berenis@tabprop{2}%
+ \else
+ \def\berenis@tabprop{}%
+ \fi}
+\define@boolkey{berenis.sty}[berenis@]{tab}[true]{%
+ \ifberenis@tab
+ \def\berenis@tabprop{}%
+ \else
+ \def\berenis@tabprop{2}%
+ \fi}
+\define@boolkey{berenis.sty}[berenis@]{lm}[true]{%
+ \ifberenis@lm
+ \relax
+ \else
+ \PackageWarning{berenis.sty}{%
+ Default sf and tt families will not\MessageBreak
+ be changed to Latin Modern.\MessageBreak
+ You should change the defaults\MessageBreak
+ yourself since Computer Modern\MessageBreak
+ does not support LY1.\MessageBreak}%
+ \fi}
+%:defaults to ensure everything is defined to something
+\ExecuteOptionsX{lig=false,osf=true,prop=true,lm=true}
+%:options override defaults
+\ProcessOptionsX
+%:make BerenisADFPro default roman font, implementing options for ligature/swash encoding and lf/osf as applicable
+\renewcommand{\rmdefault}{ybd\berenis@tabprop\berenis@lfosf\berenis@lig}
+\ifberenis@lm
+ \renewcommand{\sfdefault}{lmss}
+ \renewcommand{\ttdefault}{lmtt}
+\fi
+\newcommand*{\berenis@rhybudd}[2]{\PackageWarning{berenis.sty}{#1 unavailable.\MessageBreak #2 used instead.\MessageBreak}}%
+%:based on definition of \ss from afm2pl manual page
+\def\zeroslash{%
+ \setbox0\hbox{\char184}%
+ \setbox1\hbox{\char24}%
+ \ifnum\wd0=\wd1 \char48\berenis@rhybudd{slashed zero}{zero}\else\ifnum\wd0=0 \char48\berenis@rhybudd{slashed zero}{zero}\else\char184\fi\fi}
+%:experiment: even if this works, it is a horrible kludge
+\gdef\berenis@ligswash{w}%
+\def\berenis@Q{ Q}%
+\def\berenis@get@vff#1#2#3#4\@nil{#1#2#3}%
+\def\berenis@get@variants ybd#1\@nil{#1}%
+\def\berenis@cyntaf@variant#1#2\@nil{#1}%
+\def\berenis@ail@variant#1#2\@nil{#2}%
+\newcommand*{\berenis@variants}[1]{%
+ \edef\tempz{#1}%
+ \def\tempe{}%
+ \ifx\tempz\tempe
+ \gdef\berenis@olaf{}%
+ \else
+ \edef\tempb{\expandafter\berenis@cyntaf@variant#1 Q\@nil}%
+ \edef\tempc{\expandafter\berenis@ail@variant#1 Q\@nil}%
+ \edef\tempd{\expandafter\berenis@ail@variant#1\@nil}%
+ \ifx\tempc\berenis@Q \gdef\berenis@olaf{\tempb}\else\berenis@variants{\tempd}\fi
+ \fi
+ }%
+\newcommand*{\berenis@teulu}{%
+ \edef\tempf{\expandafter\berenis@get@vff\f@family\@nil}%
+ \def\tempybd{ybd}%
+ \ifx\tempf\tempybd
+ \edef\tempa{\expandafter\berenis@get@variants\f@family\@nil}%
+ \berenis@variants{\tempa}%
+ \else
+ \gdef\berenis@olaf{}%
+ \fi}%
+\DeclareTextCompositeCommand{\^}{LY1}{W}{%
+ \berenis@teulu
+ \edef\tempx{\berenis@ligswash}%
+ \edef\tempy{\berenis@olaf}%
+ \ifx\tempx\tempy \char29 \else\accent94\char87\fi
+ }
+\DeclareTextCompositeCommand{\^}{LY1}{w}{%
+ \berenis@teulu
+ \edef\tempx{\berenis@ligswash}%
+ \edef\tempy{\berenis@olaf}%
+ \ifx\tempx\tempy \char31 \else\accent94\char119\fi
+ }
+\DeclareTextCompositeCommand{\^}{LY1}{Y}{%
+ \berenis@teulu
+ \edef\tempx{\berenis@ligswash}%
+ \edef\tempy{\berenis@olaf}%
+ \ifx\tempx\tempy \char223 \else\accent94\char89\fi
+ }
+\DeclareTextCompositeCommand{\^}{LY1}{y}{%
+ \berenis@teulu
+ \edef\tempx{\berenis@ligswash}%
+ \edef\tempy{\berenis@olaf}%
+ \ifx\tempx\tempy \char26 \else\accent94\char121\fi
+ }
+\endinput
+%% end berenis.sty