summaryrefslogtreecommitdiff
path: root/fonts/gelasio/latex/gelasio.sty
blob: 49b9e973628010be587fce64ae1dbe442261547b (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gelasio}
    [2024/04/23 (Bob Tennent and autoinst)  Style file for Gelasio fonts.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifgelasio@otf 
\ifxetex
  \gelasio@otftrue
\else\ifluatex
  \gelasio@otftrue
\else  % [pdf]LaTeX
  \gelasio@otffalse
\fi\fi

\newif\ifgelasio@lining \gelasio@liningfalse
\newif\ifgelasio@tabular \gelasio@tabularfalse
\newif\ifgelasio@medium \gelasio@mediumfalse
\newif\ifgelasio@semibold \gelasio@semiboldfalse

\newcommand*{\Gelasio@scale}{1}
\DeclareOptionX{scale}{\renewcommand*{\Gelasio@scale}{#1}}
\DeclareOptionX{type1}{\gelasio@otffalse}
\DeclareOptionX{lining}{\gelasio@liningtrue}
\DeclareOptionX{tabular}{\gelasio@tabulartrue}
\DeclareOptionX{proportional}{\gelasio@tabularfalse}
\DeclareOptionX{medium}{\gelasio@mediumtrue}
\DeclareOptionX{semibold}{\gelasio@semiboldtrue}

\ProcessOptionsX\relax

\ifgelasio@otf
  \ifgelasio@lining
    \def\gelasio@figurestyle{Lining}
  \else
    \def\gelasio@figurestyle{OldStyle} 
  \fi
  \ifgelasio@tabular
    \def\gelasio@figurealign{Monospaced} 
  \else
    \def\gelasio@figurealign{Proportional} 
  \fi
  \ifgelasio@medium
    \def\gelasio@regularstyle{Medium}
  \else
    \def\gelasio@regularstyle{Regular}
  \fi
  \ifgelasio@semibold
    \def\gelasio@boldstyle{SemiBold}
  \else
    \def\gelasio@boldstyle{Bold}
  \fi
    
\else % type1
  \ifgelasio@lining
    \def\gelasio@figurestyle{LF}
  \else
    \def\gelasio@figurestyle{OsF}
  \fi
  \ifgelasio@tabular
    \def\gelasio@figurealign{T}
  \else
    \def\gelasio@figurealign{}
  \fi
  \ifgelasio@medium
    \def\mdseries@rm{medium}
  \else
    \def\mdseries@rm{m}
  \fi
  \def\seriesdefault{\mdseries@rm}
  \ifgelasio@semibold
    \def\bfseries@rm{sb}
  \else
    \def\bfseries@rm{b}
  \fi

\fi

\ifgelasio@otf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes,mweights}
\fi

\ifgelasio@otf
  \def\gelasio@regular{Regular}

  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Gelasio@scale ,
        Extension = .otf }
  \setmainfont
      [ Numbers = {\gelasio@figurealign,\gelasio@figurestyle},
        UprightFont    = *-\gelasio@regularstyle ,
        ItalicFont     = *-\ifx\gelasio@regularstyle\gelasio@regular Italic\else\gelasio@regularstyle Italic\fi,
        BoldFont    = *-\gelasio@boldstyle ,
        BoldItalicFont     = *-\gelasio@boldstyle Italic ,
      ]
      {Gelasio}
  \newfontfamily\gelasio
      [ Numbers = {\gelasio@figurealign,\gelasio@figurestyle},
        UprightFont    = *-\gelasio@regularstyle ,
        ItalicFont     = *-\ifx\gelasio@regularstyle\gelasio@regular Italic\else\gelasio@regularstyle Italic\fi ,
        BoldFont    = *-\gelasio@boldstyle ,
        BoldItalicFont     = *-\gelasio@boldstyle Italic ,
      ]
      {Gelasio}
  \DeclareTextFontCommand{\liningnums}{\addfontfeatures{Numbers=Lining}}
  \DeclareTextFontCommand{\tabularnums}{\addfontfeatures{Numbers=Tabular}}
  \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}

\else % type1

  \def\gelasio@family{Gelasio-\gelasio@figurealign\gelasio@figurestyle}
  \renewcommand*\rmdefault{\gelasio@family}
  \newcommand*\gelasio{\fontfamily{\gelasio@family}\selectfont}

  \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
  \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
  \def\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont}
  \DeclareTextFontCommand{\tabularnums}{\fontfamily{Gelasio-T\gelasio@figurestyle}\selectfont}
  \DeclareTextFontCommand{\liningnums}{\fontfamily{Gelasio-\gelasio@figurealign LF}\selectfont}

\fi

\DeclareTextFontCommand{\textsu}{\sufigures}
\ifgelasio@otf
  \defaultfontfeatures{}
\fi

\endinput