summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/librebaskerville/librebaskerville.sty
blob: 47f8b7efd1801776bc0cb05c4351fc94f4bc2c80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
\ProvidesPackage{librebaskerville}[%
   2020/07/31 (Bob Tennent)  Supports LibreBaskerville fonts for all LaTeX engines. ] 

\RequirePackage{ifxetex,ifluatex,textcomp}

\newif\iflibrebaskerville@ttf
\ifxetex
  \librebaskerville@ttftrue
\else\ifluatex
  \librebaskerville@ttftrue
\else  % [pdf]LaTeX
  \librebaskerville@ttffalse
\fi\fi

\newcommand*{\LibreBskvl@scale}{1}  
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\LibreBskvl@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\LibreBskvl@scale}{#1}}

\DeclareOptionX{type1}{\librebaskerville@ttffalse}

\ProcessOptionsX\relax

\iflibrebaskerville@ttf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes}
\fi

\iflibrebaskerville@ttf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
     Ligatures = TeX ,
     Extension = .ttf ,
     Scale = \LibreBskvl@scale,
  }
  \setmainfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = LibreBskvl-BoldItalic,
        ]
      {LibreBaskerville}
  \newfontfamily\librebaskerville
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = LibreBskvl-BoldItalic,
        ]
      {LibreBaskerville}
  \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}


\else % type1

  \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
  \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
  \providecommand\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont}
  \def\librebaskervillefamily{LibreBskvl-LF}
  \renewcommand*\rmdefault{\librebaskervillefamily}
  \newcommand*\librebaskerville{\fontfamily{\librebaskervillefamily}\selectfont}

\fi
\DeclareTextFontCommand{\textsu}{\sufigures}

% turn off defaults in case other fonts are selected:
\iflibrebaskerville@ttf
  \defaultfontfeatures{}
\fi

\endinput