summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/quattrocento/quattrocento.sty
blob: 6825ca10b4f72b6a25dc5ce6a0adac6a8895f794 (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
\ProvidesPackage{quattrocento}[%
   2012/11/07 (Bob Tennent)  Supports Quattrocento fonts for all LaTeX engines. ] 

\RequirePackage{ifxetex,ifluatex,textcomp}
\newif\ifquattrocento@otf
\ifxetex
  \RequirePackage{fontspec}
  \quattrocento@otftrue
\else\ifluatex
  \RequirePackage{fontspec}
  \quattrocento@otftrue
\else  % [pdf]LaTeX
  \RequirePackage{fontenc}
  \quattrocento@otffalse
\fi\fi

\newcommand*{\Quattrocento@scale}{1}  % not adjustable
\newcommand*{\QuattrocentoSans@scale}{1}
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\QuattrocentoSans@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\QuattrocentoSans@scale}{#1}}

\newif\ifquattrocento@sf \quattrocento@sffalse
\newif\ifquattrocento@rm \quattrocento@rmfalse
\newif\ifquattrocento@sfdefault \quattrocento@sfdefaultfalse
\DeclareOptionX{sf}{\quattrocento@sftrue}
\DeclareOptionX{rm}{\quattrocento@rmtrue}
\DeclareOptionX{sfdefault}{\quattrocento@sftrue\quattrocento@sfdefaulttrue}

\ProcessOptionsX\relax
\ifquattrocento@rm\ifquattrocento@sfdefault
  \PackageWarningNoLine{quattrocento}{%
   ********************************************\MessageBreak
    Options rm and sfdefault are incompatible. \MessageBreak
                                               \MessageBreak
   ********************************************}
\fi\fi


\ifquattrocento@rm\else\ifquattrocento@sf\else
  \quattrocento@rmtrue\quattrocento@sftrue  % both false -> both true
\fi\fi

% Set main and/or sans fonts:
\ifquattrocento@otf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
     Ligatures = TeX ,
     Extension = .otf ,
  }
  \ifquattrocento@rm\setmainfont
        [ UprightFont    = * ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]
        {Quattrocento}
  \fi
  \ifquattrocento@sf\setsansfont
        [ Scale     = \QuattrocentoSans@scale ,
          UprightFont    = * ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]  
        {QuattrocentoSans}
  \fi
  \ifquattrocento@sfdefault\setmainfont
        [ Scale     = \QuattrocentoSans@scale ,
          UprightFont    = * ,
          ItalicFont     = *-Italic ,
          BoldFont       = *-Bold , 
          BoldItalicFont = *-BoldItalic ]  
        {QuattrocentoSans}
  \fi
\else % type1
  \ifquattrocento@rm
    \renewcommand*\rmdefault{Quattrocento-TLF}
  \fi
  \ifquattrocento@sf
    \renewcommand*\sfdefault{QuattrocentoSans-TLF}
  \fi
  \ifquattrocento@sfdefault
    \renewcommand*\rmdefault{QuattrocentoSans-TLF}
  \fi
\fi

\endinput