summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gofonts/GoSans.sty
blob: b312799fc18ebfaaadaa580ffb5eac3a2cca7ca7 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{GoSans}
    [2017/04/02 (Bob Tennent and autoinst)  Style file for Go Sans fonts.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifgo@ttf 
\ifxetex
  \go@ttftrue
\else\ifluatex
  \go@ttftrue
\else  % [pdf]LaTeX
  \go@ttffalse
\fi\fi

\newif\ifgo@medium  \go@mediumfalse
\newif\ifgo@default \go@defaultfalse

\newcommand*{\Go@scale}{1}
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\Go@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Go@scale}{#1}}
\DeclareOptionX{type1}{\go@ttffalse}

\DeclareOptionX{medium}{\go@mediumtrue}
\DeclareOptionX{default}{\go@defaulttrue}
\DeclareOptionX{sfdefault}{\go@defaulttrue}


\ProcessOptionsX

\ifgo@ttf

  \def\go@boldstyle{Bold}
  \def\go@regstyle{Regular}
  \ifgo@medium\def\go@boldstyle{Medium}\fi

\else % type1

  \def\bfseries@sf{b}
  \def\mdseries@sf{m}
  \ifgo@medium\def\bfseries@sf{mb}\fi
  
\fi


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

\ifgo@ttf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Go@scale ,
        Extension = .ttf }
  \setsansfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Regular-Italic ,
        BoldFont    = *-\go@boldstyle ,
        BoldItalicFont     = *-\go@boldstyle-Italic ,
        SmallCapsFont = {GoSmallcaps},
        ItalicFeatures = {SmallCapsFont=GoSmallcaps-Italic},
        FontFace = {mb}{n}{Font=*-Medium},
        FontFace = {mb}{it}{Font=*-Medium-Italic},
        FontFace = {b}{n}{Font=*-Bold},
        FontFace = {b}{it}{Font=*-Bold-Italic},
      ]
      {Go}
  % grab current family in case of subsequent change:
  \let\gofamily\sfdefault  
  \ifgo@default\renewcommand*\familydefault{\gofamily}\fi

\else % type1

  \def\gofamily{Go-TLF}
  \renewcommand*\sfdefault{\gofamily}
  \ifgo@default\edef\familydefault{\sfdefault}\edef\seriesdefault{\mdseries@sf}\fi


\fi

\def\gomedium{\fontfamily{\gofamily}\fontseries{mb}\selectfont}
\def\gobold{\fontfamily{\gofamily}\fontseries{b}\selectfont}

\ifgo@ttf
  \defaultfontfeatures{}
\fi

\endinput