summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/noto/noto.sty
blob: ab71d2057b8d62873faf72d51321a1a00c216b3e (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
115
116
117
118
119
120
121
122
123
124
125
126
127
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{noto}
    [2017/01/05 (Bob Tennent)  Supports Noto fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifnoto@otf 
\ifxetex
  \noto@otftrue
\else\ifluatex
  \noto@otftrue
\else  % [pdf]LaTeX
  \noto@otffalse
\fi\fi

\newif\ifnoto@sfdefault \noto@sfdefaultfalse
\newif\ifnoto@sf \noto@sftrue
\newif\ifnoto@rm \noto@rmtrue
\newif\ifnoto@tt \noto@tttrue


\newcommand*{\NotoSans@scale}{1}
\newcommand*{\NotoMono@scale}{1}
\DeclareOptionX{scaled}{\renewcommand*{\NotoSans@scale}{#1}\renewcommand*{\NotoMono@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\NotoSans@scale}{#1}\renewcommand*{\NotoMono@scale}{#1}}


\DeclareOptionX{sf}{\noto@sftrue\noto@rmfalse}
\DeclareOptionX{rm}{\noto@rmtrue\noto@sffalse}
\DeclareOptionX{nott}{\noto@ttfalse}

\DeclareOptionX{sfdefault}{\noto@sfdefaulttrue}
\DeclareOptionX{type1}{\noto@otffalse}

\ProcessOptionsX\relax

\ifnoto@otf
\else % type1
  \def\bfseries@sf{b}
  \def\bfseries@tt{b}
  \def\mdseries@sf{m}
  \def\mdseries@tt{m}
\fi

\ifnoto@otf\else % type1
    \def\noto@figurestyle{LF}
    \def\noto@figurealign{T}
\fi


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

\ifnoto@otf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \NotoSans@scale ,
        Extension = .ttf }
  \ifnoto@sf
    \setsansfont
        [ UprightFont    = *-Regular ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {NotoSans}
    \let\notosansfamily\sfdefault  
  \fi
  \ifnoto@rm
     \setmainfont 
        [ UprightFont    = *-Regular ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {NotoSerif}
  \fi
  \ifnoto@tt
    \setmonofont 
        [ UprightFont    = * ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {NotoMono}
    \let\notomonofamily\ttdefault  
  \fi
  \ifnoto@sfdefault\renewcommand*\familydefault{\notosansfamily}\fi
  \newfontfamily\notosans
        [ UprightFont    = *-Regular ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {NotoSans}
  \newfontfamily\notoserif
        [ UprightFont    = *-Regular ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {NotoSerif}
  \newfontfamily\notomono 
        [ UprightFont    = * ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {NotoMono}
\else % type1
  \def\notosansfamily{NotoSans-\noto@figurealign\noto@figurestyle}
  \def\notoseriffamily{NotoSerif-\noto@figurealign\noto@figurestyle}
  \def\notomonofamily{NotoMono-\noto@figurealign\noto@figurestyle}
  \newcommand*\notoserif{\fontfamily{\notoseriffamily}\selectfont}
  \newcommand*\notosans{\fontfamily{\notosansfamily}\selectfont}
  \newcommand*\notomono{\fontfamily{\notomonofamily}\selectfont}
  \ifnoto@rm \def\rmdefault{\notoseriffamily} \fi
  \ifnoto@sf \def\sfdefault{\notosansfamily} \fi 
  \ifnoto@tt \def\ttdefault{\notomonofamily} \fi 
  \ifnoto@sfdefault\edef\familydefault{\sfdefault}\fi
\fi


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

\endinput