-
Notifications
You must be signed in to change notification settings - Fork 13
/
raleway-font.sty
46 lines (36 loc) · 2.24 KB
/
raleway-font.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{raleway-font}[2021/05/30 Quick package to use Raleway fonts]
%------------------------------------------------------
% Package Imports
% Set up fonts
\RequirePackage{fontspec,xltxtra,xunicode,fontenc}
%------------------------------------------------------
% Set up font options
\newcommand{\@fontFolder}{fonts/Raleway/}
\newcommand{\@fontName}{Raleway}
%------------------------------------------------------
% Command to select text - organized by increasing thickness
\newfontfamily{\customRalewayThin}[Path = \@fontFolder]{\@fontName-Thin}
\newfontfamily{\customRalewayExtraLight}[Path = \@fontFolder]{\@fontName-ExtraLight}
\newfontfamily{\customRalewayLight}[Path = \@fontFolder]{\@fontName-Light}
\newfontfamily{\customRalewayRegular}[Path = \@fontFolder]{\@fontName-Regular}
\newfontfamily{\customRalewayMedium}[Path = \@fontFolder]{\@fontName-Medium}
\newfontfamily{\customRalewaySemiBold}[Path = \@fontFolder]{\@fontName-SemiBold}
\newfontfamily{\customRalewayBold}[Path = \@fontFolder]{\@fontName-Bold}
\newfontfamily{\customRalewayExtraBold}[Path = \@fontFolder]{\@fontName-ExtraBold}
\newfontfamily{\customRalewayHeavy}[Path = \@fontFolder]{\@fontName-Heavy}
%------------------------------------------------------
\newcommand{\ralewayThin}[1]{\customRalewayThin\selectfont#1\normalfont}
\newcommand{\ralewayExtraLight}[1]{\customRalewayExtraLight\selectfont#1\normalfont}
\newcommand{\ralewayLight}[1]{\customRalewayLight\selectfont#1\normalfont}
\newcommand{\ralewayRegular}[1]{\customRalewayRegular\selectfont#1\normalfont}
\newcommand{\ralewayMedium}[1]{\customRalewayMedium\selectfont#1\normalfont}
\newcommand{\SemiBold}[1]{\customRaleway\selectfont#1\normalfont}
\newcommand{\ralewayBold}[1]{\customRalewayBold\selectfont#1\normalfont}
\newcommand{\ralewayExtraBold}[1]{\customRalewayExtraBold\selectfont#1\normalfont}
\newcommand{\ralewayHeavy}[1]{\customRalewayHeavy\selectfont#1\normalfont}
%------------------------------------------------------
% Set main fonts
\defaultfontfeatures{Mapping=tex-text}
\setsansfont[Scale=MatchLowercase, Path = \@fontFolder, BoldFont = \@fontName-SemiBold]{\@fontName-ExtraLight}
% \setmainfont[Color=primary, Path = \@fontFolder, BoldFont = \@fontName-Regular]{\@fontName-Light}