summaryrefslogtreecommitdiff
path: root/fonts/overlock/latex/overlock.sty
blob: 5a335c792d5b28a45537db661054ce68edc126d9 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{overlock}
    [2020/07/10 (Bob Tennent)  Supports Overlock fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifoverlock@otf 
\ifxetex
  \overlock@otftrue
\else\ifluatex
  \overlock@otftrue
\else  % [pdf]LaTeX
  \overlock@otffalse
\fi\fi

\newif\ifoverlock@default \overlock@defaultfalse
\newif\ifoverlock@black \overlock@blackfalse
\newif\ifoverlock@lining \overlock@liningtrue
\newcommand*{\Overlock@scale}{1}
\DeclareOptionX{scaled}{\renewcommand*{\Overlock@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Overlock@scale}{#1}}

\DeclareOptionX{lining}{\overlock@liningtrue}
\DeclareOptionX{oldstyle}{\overlock@liningfalse}
\DeclareOptionX{default}{\overlock@defaulttrue}
\DeclareOptionX{sfdefault}{\overlock@defaulttrue}
\DeclareOptionX{type1}{\overlock@otffalse}
\DeclareOptionX{black}{\overlock@blacktrue}

\ProcessOptionsX\relax

\ifoverlock@otf
  \def\overlock@boldstyle{Bold}
  \ifoverlock@black\def\overlock@boldstyle{Black}\fi
  \ifoverlock@lining
    \def\overlock@figurestyle{}
  \else
    \def\overlock@figurestyle{OldStyle}
  \fi

\else % type1

  \def\bfseries@sf{b}
  \ifoverlock@black\def\bfseries@sf{k}\fi
  \ifoverlock@lining
    \def\overlock@figurestyle{LF}
  \else
    \def\overlock@figurestyle{OsF}
  \fi

\fi

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

\ifoverlock@otf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Overlock@scale ,
        Extension = .otf }
  \setsansfont
      [ Numbers = {\overlock@figurestyle}, 
        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
      [ Numbers = {\overlock@figurestyle}, 
        UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-\overlock@boldstyle , 
        BoldItalicFont = *-\overlock@boldstyle Italic ]
      {Overlock}
  \newfontfamily\overlockBlack
      [ Numbers = {\overlock@figurestyle},
        UprightFont    = *-Black ,
        ItalicFont     = *-BlackItalic ,
        BoldFont       = *-Black , 
        BoldItalicFont = *-BlackItalic ]
      {Overlock}
  \DeclareTextFontCommand{\oldstylenums}{\addfontfeatures{Numbers={OldStyle}}}
  \DeclareTextFontCommand{\liningnums}{\addfontfeatures{Numbers={Lining}}}
  \def\sffamily{\overlock}
  \ifoverlock@default
    \edef\familydefault{\overlockfamily}
  \fi
\else % type1
  \def\overlockfamily{Overlock-\overlock@figurestyle}
  \def\sfdefault{\overlockfamily}
  \def\sffamily{\fontfamily{\overlockfamily}\selectfont}
  \def\overlock{\fontfamily{\overlockfamily}\selectfont}
  \def\overlockBlack{\fontfamily{\overlockfamily}\fontseries{black}\selectfont}
  \ifoverlock@default\def\familydefault{\sfdefault}
  \fi
  \DeclareTextFontCommand{\oldstylenums}{\fontfamily{Overlock-OsF}\selectfont}
  \DeclareTextFontCommand{\liningnums}{\fontfamily{Overlock-LF}\selectfont}

  
\fi


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

\endinput