summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-22 00:11:18 +0000
committerKarl Berry <karl@freefriends.org>2013-11-22 00:11:18 +0000
commite3569f8b4ee7684194b890d75239c2e52357b092 (patch)
tree719d2387b982d6d8c4ad818534018a5afaf46a31 /Master/texmf-dist/tex/latex/berenisadf/berenis.sty
parent4efb0e288e61307337a1593f83dead03178acc61 (diff)
berenisadf (22nov13)
git-svn-id: svn://tug.org/texlive/trunk@32205 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.sty145
1 files changed, 86 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/latex/berenisadf/berenis.sty b/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
index ef26da1e8fa..7d855d25614 100644
--- a/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
+++ b/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
@@ -1,4 +1,4 @@
-%% Copyright 2010 Clea F. Rees
+%% Copyright 2013 Clea F. Rees
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -14,16 +14,19 @@
%
% This work consists of all files listed in manifest.txt.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{berenis}[2010/08/26 v1.0 berenis]
+\ProvidesPackage{berenis}[2013/11/20 v2.0 berenis]
\RequirePackage{xkeyval}
-\RequirePackage[LY1]{fontenc}
\RequirePackage{nfssext-cfr}
+\newif\ifberenis@ly
%:boolkeys for ligature/swash encoding as default
\define@boolkey{berenis.sty}[berenis@]{lig}[true]{%
\ifberenis@lig
\def\berenis@lig{w}%
+ \def\berenis@enc{LY1}%
+ \berenis@lytrue
\else
\def\berenis@lig{}%
+ \berenis@lyfalse
\fi}
%:boolkeys for roman osf/lf
\define@boolkey{berenis.sty}[berenis@]{osf}[true]{%
@@ -58,14 +61,27 @@
\PackageWarning{berenis.sty}{%
Default sf and tt families will not\MessageBreak
be changed to Latin Modern.\MessageBreak
- You should change the defaults\MessageBreak
+ If you use the LY1 font encoding, \MessageBreak
+ you should change the defaults\MessageBreak
yourself since Computer Modern\MessageBreak
does not support LY1.\MessageBreak}%
\fi}
+\define@choicekey*+{berenis.sty}{enc}[\benc\bencno]{ly1,t1}{%
+ \ifcase\bencno\relax
+ \def\berenis@enc{LY1}%
+ \berenis@lytrue
+ \or
+ \def\berenis@enc{T1}%
+ \def\berenis@lig{}%
+ \berenis@lyfalse
+ \fi}{%
+ \PackageWarning{berenis.sty}{#1 is not a supported font encoding. Please see the package documentation for details.}%
+ }%
%:defaults to ensure everything is defined to something
-\ExecuteOptionsX{lig=false,osf=true,prop=true,lm=true}
+\ExecuteOptionsX{lig=false,osf=true,prop=true,lm=true,enc=ly1}
%:options override defaults
\ProcessOptionsX
+\RequirePackage[\berenis@enc]{fontenc}
%: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
@@ -75,60 +91,71 @@
\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}%
+ \ifberenis@ly
+ \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
\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
- }
+ \char48\berenis@rhybudd{slashed zero}{zero}%
+ \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}
+% Get proper tai bach for W, w, Y, y (Ideally would set further stuff but these are the most problematic.
+% In version 1.0, this only worked in the swash variants. In version 2.0, it works for any LY1 encoding.
+% The cost is some of the non-fancy non-standard ligatures and the boundary character in the non-swash variants.
+\ifberenis@ly
+ \DeclareTextCompositeCommand{\^}{LY1}{W}{%
+% \berenis@teulu
+% \edef\tempx{\berenis@ligswash}%
+% \edef\tempy{\berenis@olaf}%
+% \ifx\tempx\tempy \char9 \else\accent94\char87\fi
+ \char9}
+ \DeclareTextCompositeCommand{\^}{LY1}{w}{%
+% \berenis@teulu
+% \edef\tempx{\berenis@ligswash}%
+% \edef\tempy{\berenis@olaf}%
+% \ifx\tempx\tempy \char3 \else\accent94\char119\fi
+ \char3}
+ \DeclareTextCompositeCommand{\^}{LY1}{Y}{%
+% \berenis@teulu
+% \edef\tempx{\berenis@ligswash}%
+% \edef\tempy{\berenis@olaf}%
+% \ifx\tempx\tempy \char10 \else\accent94\char89\fi
+ \char10}
+ \DeclareTextCompositeCommand{\^}{LY1}{y}{%
+% \berenis@teulu
+% \edef\tempx{\berenis@ligswash}%
+% \edef\tempy{\berenis@olaf}%
+% \ifx\tempx\tempy \char13 \else\accent94\char121\fi
+ \char13}
+\else
+ \RequirePackage{textcomp}
+\fi
\endinput
%% end berenis.sty