summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/berenisadf/berenis.sty')
-rw-r--r--Master/texmf-dist/tex/latex/berenisadf/berenis.sty350
1 files changed, 191 insertions, 159 deletions
diff --git a/Master/texmf-dist/tex/latex/berenisadf/berenis.sty b/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
index 7d855d25614..ff3c9d9471c 100644
--- a/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
+++ b/Master/texmf-dist/tex/latex/berenisadf/berenis.sty
@@ -1,161 +1,193 @@
-%% 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
-% 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.
+%%
+%% This is file `berenis.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% berenisadf.dtx (with options: `sty')
+%%
+%% -------------------------------------------------
+%% Copyright (C) 2010-2024 Clea F. Rees.
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008-05-04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Clea F. Rees.
+%%
+%% This file may only be distributed together with a copy of the package
+%% berenisadf. You may however distribute the package berenisadf without
+%% such generated files.
+%%
+%% This work consists of all files listed in manifest.txt.
+%% -------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{berenis}[2013/11/20 v2.0 berenis]
-\RequirePackage{xkeyval}
-\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]{%
- \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
- 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,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
- \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{%
- \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
- \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
+\RequirePackage{svn-prov}
+\ProvidesPackageSVN[berenis.sty]{$Id: berenisadf.dtx 10366 2024-09-18 14:25:21Z cfrees $}[v2.1 \revinfo]
+\DefineFileInfoSVN[berenis]
+\RequirePackage{nfssext-cfr}[2024/01/01]
+\ExplSyntaxOn
+\msg_new:nnn { berenis } { unknown-choice }
+{ % name of choice; valid choices; invalid choice given
+ berenis ~::~#1:~\msg_line_context:~#3~is~not~a~supported~font~encoding.~
+ Valid~choices~are~#2.~
+ Please~see~documentation~for~details.
+}
+\msg_new:nnn { berenis } { unavailable }% what; substitute
+{
+ berenis ~::~#1:~\msg_line_context:~#1~unavailable. ~
+ #2~used~instead.
+}
+\keys_define:nn { berenis }
+{
+ enc .choice:,
+ enc .choices:nn = { ly1, LY1, t1, T1 }
+ {
+ \int_case:nn { \l_keys_choice_int }
+ {
+ { 1 } { \tl_gset:Nn \g__berenis_enc_tl { LY1 } }
+ { 2 } { \tl_gset:Nn \g__berenis_enc_tl { LY1 } }
+ { 3 } { \tl_gset:Nn \g__berenis_enc_tl { T1 } }
+ { 4 } { \tl_gset:Nn \g__berenis_enc_tl { T1 } }
+ }
+ },
+ enc / unknown .code:n = {
+ \msg_error:nneee { berenis } { unknown-choice }
+ { enc }
+ { ly1 , LY1 , t1, T1 }
+ { \exp_not:n {#1} }
+ },
+ enc .initial:n = ly1,
+ lig .bool_gset:N = \g__berenis_lig_bool,
+ lig .default:n = true,
+ lig .initial:n = false,
+ lf .bool_gset_inverse:N = \g__berenis_osf_bool,
+ lf .default:n = true,
+ lining .bool_gset_inverse:N = \g__berenis_osf_bool,
+ lining .default:n = true,
+ lm .bool_gset:N = \g__berenis_lm_bool,
+ lm .default:n = true,
+ lm .initial:n = true,
+ osf .bool_gset:N = \g__berenis_osf_bool,
+ osf .default:n = true,
+ osf .initial:n = true,
+ prop .bool_gset:N = \g__berenis_prop_bool,
+ prop .default:n = true,
+ prop .initial:n = true,
+ scale .tl_gset:N = \ybd@scale,
+ scale .initial:V = \@empty,
+ tab .bool_gset_inverse:N = \g__berenis_prop_bool,
+ tab .default:n = true,
+}
+\ProcessKeyOptions[berenis]
+\bool_if:NT \g__berenis_lig_bool
+{
+ \tl_if_eq:NnF \g__berenis_enc_tl { LY1 }
+ {
+ \PackageWarning { berenis } {
+ Setting ~ font ~ encoding ~ to ~ LY1 ~ to ~ accommodate ~ ligatures
+ }
+ \tl_gset:Nn \g__berenis_enc_tl { LY1 }
+ }
+}
+\tl_if_eq:NnT \g__berenis_enc_tl { LY1 }
+{
+ \bool_if:NF \g__berenis_lm_bool
+ {
+ \PackageWarning{berenis.sty}
+ {
+ Default ~ sf ~ and ~ tt ~ families ~ will ~ not\MessageBreak
+ be ~ changed ~ to ~ Latin ~ Modern.\MessageBreak
+ Since ~ Computer ~ Modern ~ does ~ not ~ support ~ LY1,\MessageBreak
+ either ~ use ~ enc=t1 ~ to ~ use ~ T1 ~ or ~ set ~\MessageBreak
+ suitable ~ defaults ~ for ~ sans ~ (`sf') ~ and ~\MessageBreak
+ typewriter ~ (`tt') ~ yourself.\MessageBreak
+ }
+ }
+}
+\tl_new:N \g__berenis_rm_tl
+\tl_new:N \g__berenis_rm_subst_tl
+\tl_gset:Nn \g__berenis_rm_tl {ybd}
+\bool_if:NT \g__berenis_prop_bool
+{
+ \tl_gput_right:Nn \g__berenis_rm_tl {2}
+}
+\bool_if:NT \g__berenis_osf_bool
+{
+ \tl_gput_right:Nn \g__berenis_rm_tl {j}
+}
+\tl_gset_eq:NN \g__berenis_rm_subst_tl \g__berenis_rm_tl
+\bool_if:NT \g__berenis_lig_bool
+{
+ \tl_gput_right:Nn \g__berenis_rm_tl {w}
+}
+\renewcommand{\rmdefault}{\g__berenis_rm_tl}
+\RequirePackage[\g__berenis_enc_tl]{fontenc}
+\tl_if_eq:NnT \g__berenis_enc_tl { LY1 }
+{
+ \DeclareTextCompositeCommand{\^}{LY1}{W}{
+ \char9
+ }
+ \DeclareTextCompositeCommand{\^}{LY1}{w}{
+ \char3
+ }
+ \DeclareTextCompositeCommand{\^}{LY1}{Y}{
+ \char10
+ }
+ \DeclareTextCompositeCommand{\^}{LY1}{y}{
+ \char13
+ }
+}
+\IfFormatAtLeastTF {2020-02-02}{%
+ \DeclareEncodingSubset{TS1}{ybd}{1}%
+ \DeclareEncodingSubset{TS1}{ybd2}{1}%
+ \DeclareEncodingSubset{TS1}{ybd2j}{1}%
+ \DeclareEncodingSubset{TS1}{ybdj}{1}%
+ \DeclareEncodingSubset{TS1}{ybd0}{1}%
+ \DeclareEncodingSubset{TS1}{ybd1}{1}%
+ \DeclareEncodingSubset{TS1}{ybdw}{1}%
+ \DeclareEncodingSubset{TS1}{ybd2w}{1}%
+ \DeclareEncodingSubset{TS1}{ybd2jw}{1}%
+ \DeclareEncodingSubset{TS1}{ybdjw}{1}%
+}{
+ \RequirePackage{textcomp}
+}
+\UndeclareTextCommand{\textperthousand}{T1}
+\bool_if:NT \g__berenis_lm_bool
+{
+ \renewcommand{\sfdefault}{lmss}
+ \renewcommand{\ttdefault}{lmtt}
+}
+\cs_new_nopar:Npn \zeroslash
+{
+ \tl_if_eq:NnTF \g__berenis_enc_tl { LY1 }
+ {
+ \setbox0\hbox{\char184}%
+ \setbox1\hbox{\char24}%
+ \ifnum\wd0=\wd1 \char48
+ \msg_warning:nnnn { berenis } { unavailable }
+ { slashed ~ zero } { zero }
+ \else
+ \ifnum\wd0=0 \char48
+ \msg_warning:nnnn { berenis } { unavailable }
+ { slashed ~ zero } { zero }
+ \else\char184
+ \fi
+ \fi
+ } {
+ \char48
+ \msg_warning:nnnn { berenis } { unavailable }
+ { slashed ~ zero } { zero }
+ }
+}
+\ExplSyntaxOff
%% end berenis.sty
+\endinput
+%%
+%% End of file `berenis.sty'.