summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/overlock/overlock.sty
blob: ca74de2005b7a34cf510abc931fbce96e02e8587 (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{overlock}
    [2014/05/25 (Bob Tennent)  Supports Overlock fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifoverlock@ttf 
\ifxetex
  \overlock@ttftrue
\else\ifluatex
  \overlock@ttftrue
\else  % [pdf]LaTeX
  \overlock@ttffalse
\fi\fi

\newif\ifoverlock@default \overlock@defaultfalse
\newif\ifoverlock@black \overlock@blackfalse

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

\DeclareOptionX{default}{\overlock@defaulttrue}
\DeclareOptionX{sfdefault}{\overlock@defaulttrue}
\DeclareOptionX{type1}{\overlock@ttffalse}
\DeclareOptionX{black}{\overlock@blacktrue}

\ProcessOptionsX\relax

\ifoverlock@ttf
  \def\overlock@boldstyle{Bold}
  \ifoverlock@black\def\overlock@boldstyle{Black}\fi

\else % type1

  \def\bfseries@sf{b}
  \ifoverlock@black\def\bfseries@sf{k}\fi
\fi

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

\ifoverlock@ttf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Overlock@scale ,
        Extension = .ttf }
  \setsansfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-\overlock@boldstyle , 
        BoldItalicFont = *-\overlock@boldstyle Italic ]
      {Overlock}
  % grab current family in case of subsequent change:
  \let\overlockfamily\sfdefault  
  \newfontfamily\overlock
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-\overlock@boldstyle , 
        BoldItalicFont = *-\overlock@boldstyle Italic ]
      {Overlock}
  \newfontfamily\overlockBlack
      [ UprightFont    = *-Black ,
        ItalicFont     = *-BlackItalic ,
        BoldFont       = *-Black , 
        BoldItalicFont = *-BlackItalic ]
      {Overlock}
  \newfontface\overlocksc{OverlockSC-Regular}
  \def\sffamily{\overlock\def\scshape{\overlocksc}}
  \ifoverlock@default
    \edef\familydefault{\overlockfamily}
    \def\scshape{\overlocksc}
  \fi
\else % type1
  \def\overlockfamily{Overlock-LF}
  \def\overlockscfamily{OverlockSC-LF}
  \def\sfdefault{\overlockfamily}
  \def\sffamily{\fontfamily{\overlockfamily}\selectfont\def\scshape{\fontfamily{\overlockscfamily}\selectfont}}
  \def\overlock{\fontfamily{\overlockfamily}\selectfont\def\scshape{\fontfamily{\overlockscfamily}\selectfont}}
  \def\overlockBlack{\fontfamily{\overlockfamily}\fontseries{k}\selectfont\def\scshape{\fontfamily{\overlockscfamily}\selectfont}}
  \ifoverlock@default
    \def\familydefault{\sfdefault}
    \renewcommand\scshape{\fontfamily{\overlockscfamily}\selectfont}
  \fi
  
\fi


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

\endinput