summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/universalis/universalis.sty
blob: bbcec86f3c394524dd321e783420eb04d4c8e9ce (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{universalis}
    [2014/05/02 (Bob Tennent)  Supports Universalis fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifunivrs@otf 
\ifxetex
  \univrs@otftrue
\else\ifluatex
  \univrs@otftrue
\else  % [pdf]LaTeX
  \univrs@otffalse
\fi\fi

\newif\ifunivrs@default \univrs@defaultfalse
\newif\ifunivrs@condensed \univrs@condensedfalse

\newcommand*{\UniversalisADFStd@scale}{1}
\DeclareOptionX{scaled}{\renewcommand*{\UniversalisADFStd@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\UniversalisADFStd@scale}{#1}}

\DeclareOptionX{sfdefault}{\univrs@defaulttrue}
\DeclareOptionX{type1}{\univrs@otffalse}
\DeclareOptionX{condensed}{\univrs@condensedtrue}

\ProcessOptionsX\relax

\ifunivrs@otf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes,mweights}
\fi


\ifunivrs@otf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \UniversalisADFStd@scale ,
        Extension = .otf }
  \ifunivrs@condensed
    \setsansfont
        [ UprightFont    = *-Cond ,
          ItalicFont     = *-CondItalic ,
          BoldFont       = *-BoldCond , 
          BoldItalicFont = *-BoldCondIt ]
        {UniversalisADFStd}
  \else
    \setsansfont
        [ UprightFont    = *-Regular ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {UniversalisADFStd}
  \fi
  % grab current family in case of subsequent change:
  \let\univrsfamily\sfdefault  
  \ifunivrs@default\renewcommand*\familydefault{\univrsfamily}\fi
  \newfontfamily\univrs
        [ UprightFont    = *-Regular ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
      {UniversalisADFStd}
  \newfontfamily\univrscondensed
        [ UprightFont    = *-Cond ,
          ItalicFont     = *-CondItalic ,
          BoldFont       = *-BoldCond , 
          BoldItalicFont = *-BoldCondIt ]
      {UniversalisADFStd}
\else % type1
  \ifunivrs@condensed
    \def\mdseries@sf{c}
    \def\bfseries@sf{bc}
  \else
    \def\mdseries@sf{m}
    \def\bfseries@sf{b}
  \fi
  \def\univrsfamily{UniversalisADFStd-LF}
  \newcommand*\univrs{%
     \fontfamily{\univrsfamily}\fontseries{m}\selectfont
     \def\mdseries@sf{m}\def\bfseries@sf{b}
  }
  \newcommand*\univrscondensed{%
     \fontfamily{\univrsfamily}\fontseries{c}\selectfont
     \def\mdseries@sf{c}\def\bfseries@sf{bc}
  }
  \def\sfdefault{\univrsfamily}
  \ifunivrs@default\edef\familydefault{\sfdefault}\fi
\fi

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

\endinput