summaryrefslogtreecommitdiff
path: root/texmf-dist/tex/latex/spark-otf/spark-otf.sty
blob: 21f720b59cbf74bbc9c4fd7209620ef8f32d43bb (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
%% $Id: spark-otf.sty 556 2017-09-18 06:22:29Z 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{spark-otf}[%
  2017/09/19 v. 0.01 (Herbert Voss) Supports spark OpenType for lualatex/xelatex.] 
%
\RequirePackage{ifxetex,ifluatex,xkeyval,fontspec,xparse}
%
\newif\ifspark@usefilenames \spark@usefilenamesfalse
\DeclareOptionX{usefilenames}[true]{\@nameuse{spark@usefilenames#1}}
%
\providecommand\spark@DefaultFeatures{}
\DeclareOptionX{DefaultFeatures}{\def\spark@DefaultFeatures{#1}}

\ProcessOptionsX\relax

\ifspark@usefilenames
\typeout {Using file names for the spark font}%
%-----------------------------------------  file names ----------------------------

\else
  \typeout {Using symbolic names for the spark font}%
%-----------------------------------------  symbolic names ----------------------------
  \newfontfamily\sparkBarMedium{SparkBar-Medium}[RawFeature=+calt,\spark@DefaultFeatures]
  \newfontfamily\sparkBarNarrow{SparkBar-Narrow}[RawFeature=+calt,\spark@DefaultFeatures]
  \newfontfamily\sparkBarThin{SparkBar-Thin}[RawFeature=+calt,\spark@DefaultFeatures]
%
  \newfontfamily\sparkDotLine{Spark-Dot-lineMedium}[RawFeature=+calt,\spark@DefaultFeatures]
%
  \newfontfamily\sparkDotMedium{Spark-DotMedium}[RawFeature=+calt,\spark@DefaultFeatures]
  \newfontfamily\sparkDotSmall{Spark-DotSmall}[RawFeature=+calt,\spark@DefaultFeatures]
\fi
%
\NewDocumentCommand\sparkBar{oO{}mO{}}{{%
  \IfValueTF{#1}{\@nameuse{sparkBar#1}}{\sparkBarMedium}#2\string{#3\string}#4%
}}
\NewDocumentCommand\sparkDot{oO{}mO{}}{{%
  \IfValueTF{#1}{\@nameuse{sparkDot#1}}{\sparkDotMedium}#2\string{#3\string}#4%
}}

\endinput