summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nexus-otf/latex/nexus-otf.sty
blob: 5cbb7ccede33e5eb59adc72fd396eea191755eea (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
%% $Id: nexus-otf.sty 776 2018-07-05 10:35:40Z herbert $
%%
%% This file is distributed under the terms of the LaTeX Project Public
%% License from CTAN archives in directory  macros/latex/base/lppl.txt.
%% Either version 1.3 or, at your option, any later version.
%%
% Copyright 2018 Herbert Voss hvoss@tug.org
%%
\ProvidesPackage{nexus-otf}[%
   2018/07/05 v. 0.02 (Herbert Voss)  Supports Nexus serif and Nexus Sans ] 

\RequirePackage{ifxetex,ifluatex,textcomp}

\newif\ifNexus@ttf
\ifxetex\Nexus@ttftrue\else\ifluatex\Nexus@ttftrue\else  % [pdf]LaTeX
  \Nexus@ttffalse
\fi\fi

\newif\ifNexus@lining \Nexus@liningtrue
\newif\ifNexus@tabular \Nexus@tabularfalse
\newif\ifNexus@black \Nexus@blackfalse
\newif\ifNexus@pro \Nexus@profalse
\newif\ifNexus@math \Nexus@mathfalse

\RequirePackage{xkeyval}

\DeclareOptionX{pro}[true]{\@nameuse{Nexus@pro#1}}
\DeclareOptionX{math}[true]{\@nameuse{Nexus@math#1}}

\DeclareOptionX{lining}[true]{\@nameuse{Nexus@lining#1}}
\DeclareOptionX{lf}[true]{\@nameuse{if#1}\Nexus@liningtrue\else\Nexus@liningfalse\fi}
\DeclareOptionX{oldstyle}[true]{\@nameuse{if#1}\Nexus@liningfalse\else\Nexus@liningtrue\fi}
\DeclareOptionX{osf}[true]{\@nameuse{if#1}\Nexus@liningfalse\else\Nexus@liningtrue\fi}
\DeclareOptionX{tabular}[true]{\@nameuse{Nexus@tabular#1}}
\DeclareOptionX{tf}[true]{\@nameuse{if#1}\Nexus@tabulartrue\else\Nexus@tabularfalse\fi}
\DeclareOptionX{proportional}[true]{\@nameuse{if#1}\Nexus@tabulartrue\else\Nexus@tabularfalse\fi}
\DeclareOptionX{pf}[true]{\@nameuse{if#1}\Nexus@tabulartrue\else\Nexus@tabularfalse\fi}

\newcommand*\nexusRM@scale{1}  
\newcommand*\nexusSF@scale{1}
\DeclareOptionX{ScaleRM}{\renewcommand*{\nexusRM@scale}{#1}}
\DeclareOptionX{ScaleSF}{\renewcommand*{\nexusSF@scale}{#1}}
\DeclareOptionX{scaled}{\renewcommand*{\nexusRM@scale}{#1}\renewcommand*{\nexusSF@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\nexusRM@scale}{#1}\renewcommand*{\nexusSF@scale}{#1}}

\ProcessOptionsX\relax

\ifNexus@lining\def\Nexus@figurestyle{Lining}\else\def\Nexus@figurestyle{OldStyle}\fi
\ifNexus@tabular\def\Nexus@figurealign{Monospaced}\else\def\Nexus@figurealign{Proportional}\fi

\RequirePackage{unicode-math}

\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures{
     Ligatures = TeX ,
%     Extension = .ttf,
%     Scale     = \Nexus@scale ,
%     RawFeature=+
}
\setmainfont{NexusSerif}%
      [ Numbers = {\Nexus@figurealign,\Nexus@figurestyle},
        UprightFont    = *-Regular,
        ItalicFont     = *-Italic,
        BoldFont       = *-Bold, 
        BoldItalicFont = *-BoldItalic,
        UprightFeatures = { SmallCapsFont = *-RegularSC },
        BoldFeatures = { SmallCapsFont= *-BoldSC },
        ItalicFeatures = { SmallCapsFont= *-ItalicSC },
        BoldItalicFeatures = {  SmallCapsFont= *-BoldItalicSC },
	Scale          = \nexusRM@scale,
      ]

\ifNexus@pro
  \setsansfont{NexusSansPro}%
      [ Numbers = {\Nexus@figurealign,\Nexus@figurestyle},
        UprightFont    = *,
        ItalicFont     = *-Italic,
        BoldFont       = *-Bold, 
        BoldItalicFont = *-BoldItalic,
        UprightFeatures = { SmallCapsFont = NexusSans-RegularSC },
        BoldFeatures = { SmallCapsFont= NexusSans-BoldSC },
        ItalicFeatures = { SmallCapsFont= NexusSans-ItalicSC },
        BoldItalicFeatures = { SmallCapsFont= NexusSans-BoldItalicSC },
	Scale          = \nexusSF@scale,
      ]
\else
  \setsansfont{NexusSans}%
      [ Numbers = {\Nexus@figurealign,\Nexus@figurestyle},
        UprightFont    = *-Regular,
        ItalicFont     = *-Italic,
        BoldFont       = *-Bold, 
        BoldItalicFont = *-BoldItalic,
        UprightFeatures = { SmallCapsFont = NexusSans-RegularSC },
        BoldFeatures = { SmallCapsFont= NexusSans-BoldSC },
        ItalicFeatures = { SmallCapsFont= NexusSans-ItalicSC },
        BoldItalicFeatures = { SmallCapsFont= NexusSans-BoldItalicSC },
	Scale          = \nexusSF@scale,
      ]
\fi

\ifNexus@math\setmathfont{texgyrepagella-math.otf}\fi

\endinput




\providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}  
\providecommand\infigures{\addfontfeatures{VerticalPosition=ScientificInferior}}

\DeclareTextFontCommand{\textsu}{\sufigures}
\DeclareTextFontCommand{\textin}{\infigures}

\defaultfontfeatures{}

\endinput



<none>	NexusSansTF-Italic	4.460 2004
<none>	NexusSans-BoldItalicSC	4.460 2004
<none>	NexusSerif-RegularSC	4.460 2004
<none>	NexusSans-RegularSC	4.460 2004
<none>	NexusSerif-BoldItalicSC	4.460 2004
<none>	NexusSans-Bold	4.460 2004
<none>	NexusSerifTF-BoldItalic	4.460 2004
<none>	NexusSerif-BoldItalic	4.460 2004
<none>	NexusSansTF-Regular	4.460 2004
<none>	NexusSerif-Bold	4.460 2004
<none>	NexusSans-BoldSC	4.460 2004
<none>	NexusSerif-ItalicSwashTwo	4.460 2004
<none>	NexusSerif-Regular	4.460 2004
<none>	NexusSerif-ItalicSC	4.460 2004
<none>	NexusSerifTF-Regular	4.460 2004
<none>	NexusSansTF-BoldItalic	4.460 2004
<none>	NexusSerifTF-Bold	4.460 2004
<none>	NexusSerifTF-Italic	4.460 2004
<none>	NexusSerif-BoldSC	4.460 2004
<none>	NexusSerif-Italic	4.460 2004
<none>	NexusSerif-ItalicSwashOne	4.460 2004
<none>	NexusSans-Italic	4.460 2004
<none>	NexusSans-ItalicSC	4.460 2004
<none>	NexusSans-BoldItalic	4.460 2004
<none>	NexusSansTF-Bold	4.460 2004
<none>	NexusSans-Regular	4.460 2004