summaryrefslogtreecommitdiff
path: root/texmf-dist/tex/latex/lucida-otf/lucida-otf.sty
blob: f515acce4cda8c69ec13a9fec8102370bc9c9527 (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
146
147
148
149
150
151
152
153
154
155
%% $Id: lucida-otf.sty 442 2017-04-19 10:26:52Z 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 2017 Herbert Voss hvoss@tug.org
%
%%
\ProvidesPackage{lucida-otf}[%
  2017/07/02 v. 0.04 (Herbert Voss) Supports Lucida OpenType for lualatex/xelatex.] 
\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}
\RequirePackage{unicode-math}  % support opentype math fonts
                               % loads itself fontspec
%
\newif\ifLucida@usefilenames \Lucida@usefilenamesfalse
\DeclareOptionX{usefilenames}[true]{\@nameuse{Lucida@filenames#1}}
%
\providecommand\lucidaRM@features{Scale=0.92}%  Roman
\providecommand\lucidaSS@features{Scale=0.92}%  SansSerif
\providecommand\lucidaTT@features{Scale=0.92}%  Typewriter
\providecommand\lucidaGrandeTT@features{Scale=0.92}%  Typewriter
\providecommand\lucidaConsoleTT@features{Scale=0.92}%  Typewriter
\providecommand\lucidaMM@features{}%            Math regular
\providecommand\lucidaMMbold@features{}%        Math bold
\providecommand\lucidaBL@features{}%            Blackletter
\providecommand\lucidaCAL@features{}%           Calligraphy
\providecommand\lucidaHW@features{}%            Handwriting
\providecommand\lucida@DefaultFeatures{}
\DeclareOptionX{RM}{\renewcommand*{\lucidaRM@features}{#1}}
\DeclareOptionX{SS}{\renewcommand*{\lucidaSS@features}{#1}}
\DeclareOptionX{TT}{\renewcommand*{\lucidaTT@features}{#1}}
\DeclareOptionX{GTT}{\renewcommand*{\lucidaGrandeTT@features}{#1}}
\DeclareOptionX{CTT}{\renewcommand*{\lucidaConsoleTT@features}{#1}}
\DeclareOptionX{MM}{\renewcommand*{\lucidaMM@features}{#1}}
\DeclareOptionX{MMbold}{\renewcommand*{\lucidaMMbold@features}{#1}}
\DeclareOptionX{BL}{\renewcommand*{\lucidaBL@features}{#1}}
\DeclareOptionX{CAL}{\renewcommand*{\lucidaCAL@features}{#1}}
\DeclareOptionX{HW}{\renewcommand*{\lucidaHW@features}{#1}}
\DeclareOptionX{DefaultFeatures}{\def\lucida@DefaultFeatures{#1}}

\ProcessOptionsX\relax

\defaultfontfeatures{Ligatures=TeX,\lucida@DefaultFeatures}% default in fontspec
%
\ifLucida@usefilenames
%-----------------------------------------  file names ----------------------------
\setmainfont{LucidaBrightOT}[% main rm
       Extension = .otf,
  \lucidaRM@features,
      ItalicFont = *-Italic,
        BoldFont = *-Demi,
  BoldItalicFont = *-DemiItalic
]
%
\setsansfont{LucidaSansOT}[% main sans
       Extension = .otf,
  \lucidaSS@features,
      ItalicFont = *-Italic,
        BoldFont = *-Demi,
  BoldItalicFont = *-DemiItalic
]
%
\setmonofont{LucidaSansTypewriterOT}[% main typewriter
       Extension = .otf,
  \lucidaTT@features,
      ItalicFont = *-Oblique,
        BoldFont = *-Bold,
  BoldItalicFont = *-BoldOblique
]
%
% Setting math
% First we have to expand the feature macros:
%\expandafter\setmathfont\expandafter[\lucidaMM@features]{LucidaBrightMathOT}
%\expandafter\setmathfont\expandafter[\lucidaMMbold@features,version=bold]{LucidaBrightMathOT-Demibold}

\edef\Set@Math{\noexpand\setmathfont{Lucida Bright Math OT}[\lucidaMM@features,version=normal]%
               \noexpand\setmathfont{Lucida Bright Math OT Demibold}[\lucidaMMbold@features,version=bold]}
\Set@Math
%
% The specialized one-off fonts:
\newfontface\LucidaBlackletter{LucidaBlackletterOT}[
  Extension = .otf,
  \lucidaBL@features]
\newfontface\LucidaCalligraphy{LucidaCalligraphyOT-Italic}[
  Extension = .otf,
  \lucidaCAL@features]
\newfontface\LucidaHandwriting{LucidaHandwritingOT-Italic}[
  Extension = .otf,
  \lucidaHW@features]
%
% GrandeMono and Console fonts for an example:

\newfontfamily\LucidaGrandeMonoDK{LucidaGrandeMonoDK}[
       Extension = .otf,
  \lucidaGrandeTT@features,
      ItalicFont = *-Italic,
        BoldFont = *-Bold,
  BoldItalicFont = *-BoldItalic
]
%
\newfontfamily\LucidaConsoleDK{LucidaConsoleDK}[%
       Extension = .otf,
  \lucidaConsoleTT@features,
      ItalicFont = *-Italic,
        BoldFont = *-Bold,
  BoldItalicFont = *-BoldItalic
]
\else
%-----------------------------------------  symbolic names ----------------------------
\setmainfont{Lucida Bright OT}[% main rm
  \lucidaRM@features,
        BoldFont = * Demibold,
  BoldItalicFont = * Demibold Italic
]
%
\setsansfont{Lucida Sans OT}[% main sans
  \lucidaSS@features,
        BoldFont = * Demibold,
  BoldItalicFont = * Demibold Italic
]
%
\setmonofont{Lucida Sans Typewriter OT}[% main typewriter
  \lucidaTT@features,
]
%
% Setting math
% First we have to expand the feature macros:
%\expandafter\setmathfont\expandafter[\lucidaMM@features]{LucidaBright Math OT}
%\expandafter\setmathfont\expandafter[\lucidaMMbold@features,version=bold]{LucidaBright Math OT-Demibold}

\edef\Set@Math{\noexpand\setmathfont{Lucida Bright Math OT}[\lucidaMM@features,version=normal]%
               \noexpand\setmathfont{Lucida Bright Math OT Demibold}[\lucidaMMbold@features,version=bold]}
\Set@Math
%
% The specialized one-off fonts:
\newfontface\LucidaBlackletter{Lucida Blackletter OT}%
  [
   \lucidaBL@features]
\newfontface\LucidaCalligraphy{Lucida Calligraphy OT Italic}[\lucidaCAL@features]
\newfontface\LucidaHandwriting{Lucida Handwriting OT Italic}[\lucidaHW@features]
%
% GrandeMono and Console fonts for an example:

\newfontfamily\LucidaGrandeMonoDK{Lucida Grande Mono DK}[
  \lucidaGrandeTT@features,
]
%
\newfontfamily\LucidaConsoleDK{Lucida Console DK}[%
  \lucidaConsoleTT@features,
]
\fi

\endinput