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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
%% opensans.sty
%% Copyright 2019 Mohamed El Morabity
%
% 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 Mohamed El Morabity
%
% This work consists of all files listed in manifest.txt.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{opensans}[2019/06/20 Style file for Open Sans.]
\RequirePackage{fontaxes}
\RequirePackage{ifluatex}
\RequirePackage{ifxetex}
\RequirePackage{xkeyval}
\newif\ifopensans@otf
\ifxetex
\opensans@otftrue
\else
\ifluatex
\opensans@otftrue
\else
\opensans@otffalse
\fi
\fi
\newif\ifopensans@lining
\newif\ifopensans@tabular
\newif\ifopensans@default
\opensans@defaultfalse
\newif\ifopensans@defaultsans
\opensans@defaultsansfalse
\newcommand*{\opensans@scale}{1}
\DeclareOptionX{scale}{\renewcommand*{\opensans@scale}{#1}}
\DeclareOptionX{scaled}{\renewcommand*{\opensans@scale}{#1}}
\DeclareOptionX{default}{\opensans@defaulttrue}
\DeclareOptionX{defaultsans}{\opensans@defaultsanstrue}
\DeclareOptionX{lining}{\opensans@liningtrue}
\DeclareOptionX{oldstyle}{\opensans@liningfalse}
\DeclareOptionX{tabular}{\opensans@tabulartrue}
\DeclareOptionX{proportional}{\opensans@tabularfalse}
\DeclareOptionX{type1}{\opensans@otffalse}
\ExecuteOptionsX{tabular,lining}
\ProcessOptionsX
\relax
\ifopensans@tabular
\newcommand*{\opensans@figurewidth@otf}{Monospaced}
\newcommand*{\opensans@figurewidth@pfb}{T}
\else
\newcommand*{\opensans@figurewidth@otf}{Proportional}
\newcommand*{\opensans@figurewidth@pfb}{}
\fi
\ifopensans@lining
\newcommand*{\opensans@figurestyle@otf}{Lining}
\newcommand*{\opensans@figurestyle@pfb}{LF}
\else
\newcommand*{\opensans@figurestyle@otf}{OldStyle}
\newcommand*{\opensans@figurestyle@pfb}{OsF}
\fi
\newcommand*{\opensans@familyprefix}{opensans}
\newcommand*{\opensans@family}[1]{\opensans@familyprefix-#1}
\newcommand*{\opensansfamily}{\opensans@family{\opensans@figurewidth@pfb\opensans@figurestyle@pfb}}
\ifopensans@otf
\RequirePackage{fontspec}
\ifxetex
\XeTeXtracingfonts=1
\fi
\newcommand*{\opensans@otf@features}{%
Extension=.ttf,%
Ligatures={TeX,Common},%
Scale=\opensans@scale,%
FontFace={l}{n}{*-Light},%
FontFace={l}{it}{*-LightItalic},%
FontFace={lc}{n}{*Condensed-Light},%
FontFace={lc}{it}{*Condensed-LightItalic},%
UprightFont={*-Regular},%
ItalicFont={*-Italic},%
FontFace={sb}{n}{*-SemiBold},%
FontFace={sb}{it}{*-SemiBoldItalic},%
FontFace={b}{n}{*-Bold},%
FontFace={b}{it}{*-BoldItalic},%
BoldFont={*-Bold},%
BoldItalicFont={*-BoldItalic},%
FontFace={bc}{n}{*Condensed-Bold},%
FontFace={eb}{n}{*-ExtraBold},%
FontFace={eb}{it}{*-ExtraBoldItalic}%
}
% Define family for each figure style/width, with corresponding
% NFSS family, for fontaxes support
\newfontfamily{\opensans@otf@TLF}[%
\opensans@otf@features,%
Numbers={Monospaced,Lining},%
NFSSFamily=\opensans@family{TLF}%
]{OpenSans}
\newfontfamily{\opensans@otf@LF}[%
\opensans@otf@features,%
Numbers={Proportional,Lining},%
NFSSFamily=\opensans@family{LF}%
]{OpenSans}
\newfontfamily{\opensans@otf@TOsF}[%
\opensans@otf@features,%
Numbers={Monospaced,OldStyle},%
NFSSFamily=\opensans@family{TOsF}%
]{OpenSans}
\newfontfamily{\opensans@otf@OsF}[%
\opensans@otf@features,%
Numbers={Proportional,OldStyle},%
NFSSFamily=\opensans@family{OsF}%
]{OpenSans}
\expandafter\let\expandafter\opensans\csname opensans@otf@\opensans@figurewidth@pfb\opensans@figurestyle@pfb\endcsname
% Legacy compatibility
\newfontfamily{\fosfamily}[%
\opensans@otf@features,%
Numbers={Monospaced,Lining},%
NFSSFamily=fos%
]{OpenSans}
\ifopensans@defaultsans
\setsansfont[%
\opensans@otf@features,%
Numbers={\opensans@figurewidth@otf,\opensans@figurestyle@otf},%
]{OpenSans}
\fi
\ifopensans@default
\setmainfont[%
\opensans@otf@features,%
Numbers={\opensans@figurewidth@otf,\opensans@figurestyle@otf},%
]{OpenSans}
\fi
\else
\newcommand*{\opensans}{\fontfamily{\opensansfamily}\selectfont}
% Legacy compatibility
\newcommand*{\fosfamily}{\fontfamily{opensans-TLF}\selectfont}
\ifopensans@defaultsans
\renewcommand*{\sfdefault}{\opensansfamily}
\fi
\ifopensans@default
\renewcommand*{\familydefault}{\opensansfamily}
\fi
\fi
\endinput
|