summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/caladea/caladea.sty
blob: 274e3a4fee7d368eafb4f59e62d67b7af3a1782b (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{caladea}
    [2014/08/17 (Bob Tennent)  Supports Caladea fonts for LaTeX, pdfLaTeX, luaLaTeX and xeLaTeX.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifcaladea@fontspec 
\ifxetex
  \caladea@fontspectrue
\else\ifluatex
  \caladea@fontspectrue
\else
  \caladea@fontspecfalse
\fi\fi

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

\ProcessOptionsX\relax

\ifcaladea@fontspec
  \RequirePackage{fontspec}
\fi

\ifcaladea@fontspec
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Caladea@scale ,
        Extension = .ttf }
  \setmainfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = *-BoldItalic ]
      {Caladea}
  % grab current family in case of subsequent change:
  \let\caladeafamily\rmdefault  
  \newfontfamily\caladea
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = *-BoldItalic 
      ]
      {Caladea}

\else 

  \def\caladeafamily{Caladea-TLF}
  \newcommand*\caladea{\fontfamily{\caladeafamily}\selectfont}
  \def\rmdefault{\caladeafamily}

\fi

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

\endinput