-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoldmansans.sty
122 lines (104 loc) · 3.83 KB
/
goldmansans.sty
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
%% goldmansans.sty
%% Copyright 2020 Martin Sievers
%
% 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 Martin Sievers
%
% This work consists of the files
% goldmansans.sty
% goldmansans-example.tex
%
%%
\ProvidesPackage{goldmansans}[%
2020/08/25 v0.1 Support for Goldman Sans font for lualatex and xelatex]
\RequirePackage{ifxetex,xkeyval,textcomp}
\newif\ifgoldman@tabular
\goldman@tabularfalse
\newif\ifgoldman@semibold
\goldman@semiboldfalse
\newif\ifgoldman@condensed
\goldman@condensedfalse
\newif\ifgoldman@usefilenames
\goldman@usefilenamestrue
\newif\ifgoldman@realscripts
\goldman@realscriptstrue
\DeclareOptionX{usefilenames}[true]{\@nameuse{goldman@usefilenames#1}}
\DeclareOptionX{tabular}[true]{\@nameuse{goldman@tabular#1}}
\DeclareOptionX{t}[true]{\@nameuse{goldman@tabular#1}}
\DeclareOptionX{proportional}[true]{\@nameuse{if#1}\goldman@tabularfalse\else\goldman@tabulartrue\fi}
\DeclareOptionX{p}[true]{\@nameuse{if#1}\goldman@tabularfalse\else\goldman@tabulartrue\fi}
\DeclareOptionX{semibold}[true]{\@nameuse{goldman@semibold#1}}
\DeclareOptionX{sb}[true]{\@nameuse{goldman@semibold#1}}
\DeclareOptionX{bold}[true]{\@nameuse{if#1}\goldman@semiboldfalse\else\goldman@semiboldtrue\fi}
\DeclareOptionX{condensed}[true]{\@nameuse{goldman@condensed#1}}
\DeclareOptionX{c}[true]{\@nameuse{goldman@condensed#1}}
\DeclareOptionX{realscripts}[true]{\@nameuse{goldman@realscripts#1}}
\newcommand*\goldman@scale{1}
\DeclareOptionX{Scale}{\renewcommand*{\goldman@scale}{#1}}
\def\goldman@defaultfeatures{}
\DeclareOptionX{defaultfeatures}{\def\goldman@defaultfeatures{#1}}
\ProcessOptionsX\relax
\RequirePackage{fontspec}
\ifgoldman@tabular
\def\goldman@figurealign{+tnum}
\else
\def\goldman@figurealign{+pnum}
\fi
\ifgoldman@semibold
\def\goldman@boldstyle{Md}
\else
\def\goldman@boldstyle{Bd}
\fi
\ifgoldman@condensed
\def\goldman@width{Cd}
\def\goldman@boldstyle{Bd}
\else
\def\goldman@width{}
\fi
\ifgoldman@realscripts
\RequirePackage{realscripts}
\fi
\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures{
Ligatures = {TeX,Common},
\goldman@defaultfeatures
}
\ifgoldman@usefilenames
%------------------------ filenames start -------------------------
\setsansfont{GoldmanSans}[
RawFeature = {\goldman@figurealign},
Scale = \goldman@scale,
UprightFont = *\goldman@width_Rg,
ItalicFont = *_It,
SlantedFont = *\goldman@width_Rg,
SlantedFeatures= {FakeSlant=0.2},
BoldFont = *\goldman@width_\goldman@boldstyle,
BoldItalicFont = *_\goldman@boldstyle It,
BoldSlantedFont= *\goldman@width_\goldman@boldstyle,
BoldSlantedFeatures= {FakeSlant=0.2},
FontFace = {c}{n}{*Cd_Rg},
FontFace = {bc}{n}{*Cd_Bd},
FontFace = {ul}{n}{*_Th},
FontFace = {l}{n}{*_Lt},
FontFace = {sb}{n}{*_Md},
FontFace = {k}{n}{*_Blk},
Extension = .ttf
]
\strongfontdeclare{\bfseries,\fontseries{k}\selectfont}
\newcommand{\goldmansansTf}{\normalfont\addfontfeatures{RawFeature={-pnum;+tnum}}}
\newcommand{\goldmansansTh}{\normalfont\fontseries{ul}\selectfont}
\newcommand{\goldmansansLt}{\normalfont\fontseries{l}\selectfont}
\newcommand{\goldmansansSb}{\normalfont\fontseries{sb}\selectfont}
\newcommand{\goldmansansBlk}{\normalfont\fontseries{k}\selectfont}
\newcommand{\goldmansansCd}{\normalfont\fontseries{c}\selectfont}
\newcommand{\goldmansansfrac}{\normalfont\addfontfeatures{Fractions=On}}
\renewcommand{\familydefault}{\sfdefault}