| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: Rosario.dtx |
| 4 |
% Copyright (C) 2016-2019 Arash Esbati <arash'@'gnu.org> |
| 5 |
% |
| 6 |
% This work may be distributed and/or modified under the conditions |
| 7 |
% of the LaTeX Project Public License (LPPL), either version 1.3c of |
| 8 |
% this license or (at your option) any later version. The latest |
| 9 |
% version of this license is in the file: |
| 10 |
% |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% |
| 13 |
% \fi |
| 14 |
% |
| 15 |
% \iffalse |
| 16 |
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 17 |
%<package>\ProvidesPackage{Rosario} |
| 18 |
%<package> [2019/07/19 v2.1 Support for Rosario fonts (AE)] |
| 19 |
% |
| 20 |
%<*driver> |
| 21 |
\documentclass[a4paper]{ltxdoc} |
| 22 |
\usepackage[osf]{mathpazo} |
| 23 |
\usepackage[osf,scale=0.97]{Rosario} |
| 24 |
\usepackage[utf8]{inputenc} |
| 25 |
\usepackage[OT1,LY1,T1]{fontenc} |
| 26 |
\usepackage{textcomp} |
| 27 |
\usepackage{fonttable,lipsum,array,booktabs} |
| 28 |
\usepackage{caption} |
| 29 |
\captionsetup[table]{% |
| 30 |
format = plain , |
| 31 |
labelsep = period , |
| 32 |
justification = centerlast , |
| 33 |
width = 0.8\linewidth , |
| 34 |
position = top , |
| 35 |
skip = 5pt , |
| 36 |
font = small , |
| 37 |
labelfont = bf |
| 38 |
} |
| 39 |
\usepackage[activate]{microtype} |
| 40 |
\linespread{1.02} |
| 41 |
\usepackage{hypdoc} |
| 42 |
\newcommand*\pkg[1]{\textsf{#1}} |
| 43 |
\DisableCrossrefs |
| 44 |
\RecordChanges |
| 45 |
\setlength\hfuzz{15pt} |
| 46 |
\hbadness=7000 |
| 47 |
\frenchspacing |
| 48 |
\raggedbottom |
| 49 |
\makeatletter |
| 50 |
\renewcommand\section{\@startsection{section}{1}{\z@}% |
| 51 |
{-3.5ex \@plus -1ex \@minus -.2ex}% |
| 52 |
{2.3ex \@plus.2ex}% |
| 53 |
{\normalfont\sffamily\Large\bfseries}} |
| 54 |
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% |
| 55 |
{-3.25ex\@plus -1ex \@minus -.2ex}% |
| 56 |
{1.5ex \@plus .2ex}% |
| 57 |
{\normalfont\sffamily\large\bfseries}} |
| 58 |
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% |
| 59 |
{-3.25ex\@plus -1ex \@minus -.2ex}% |
| 60 |
{1.5ex \@plus .2ex}% |
| 61 |
{\normalfont\sffamily\normalsize\bfseries}} |
| 62 |
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% |
| 63 |
{3.25ex \@plus1ex \@minus.2ex}% |
| 64 |
{-1em}% |
| 65 |
{\normalfont\sffamily\normalsize\bfseries}} |
| 66 |
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% |
| 67 |
{3.25ex \@plus1ex \@minus .2ex}% |
| 68 |
{-1em}% |
| 69 |
{\normalfont\sffamily\normalsize\bfseries}} |
| 70 |
\renewcommand\@makefntext[1]{% |
| 71 |
\@setpar{% |
| 72 |
\@@par \@tempdima=\hsize |
| 73 |
\advance\@tempdima by -1.5em\relax |
| 74 |
\parshape \@ne 1.5em \@tempdima |
| 75 |
}% |
| 76 |
\par \parindent=\z@ \noindent % |
| 77 |
\hb@xt@ \z@{\hss \hb@xt@ 1.5em{\@thefnmark.\hss}}% |
| 78 |
#1% |
| 79 |
} |
| 80 |
\makeatother |
| 81 |
\begin{document} |
| 82 |
\DocInput{\jobname.dtx} |
| 83 |
\end{document} |
| 84 |
%</driver> |
| 85 |
% \fi |
| 86 |
% |
| 87 |
% \CheckSum{247} |
| 88 |
% |
| 89 |
% \CharacterTable |
| 90 |
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 91 |
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 92 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 93 |
% Exclamation \! Double quote \" Hash (number) \# |
| 94 |
% Dollar \$ Percent \% Ampersand \& |
| 95 |
% Acute accent \' Left paren \( Right paren \) |
| 96 |
% Asterisk \* Plus \+ Comma \, |
| 97 |
% Minus \- Point \. Solidus \/ |
| 98 |
% Colon \: Semicolon \; Less than \< |
| 99 |
% Equals \= Greater than \> Question mark \? |
| 100 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 101 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 102 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 103 |
% Right brace \} Tilde \~} |
| 104 |
% |
| 105 |
% |
| 106 |
% \GetFileInfo{\jobname.sty} |
| 107 |
% |
| 108 |
% \MakeShortVerb{\"} |
| 109 |
% |
| 110 |
% \changes{v2.1}{2019/07/20}{Fix a bug in handling of alias keys} |
| 111 |
% \changes{v2.0}{2019/07/07}{Remove `Rosario.fontspec' from the bundle |
| 112 |
% since the functionality is now provided by the package itself} |
| 113 |
% \changes{v2.0}{2019/07/07}{Add the `scaled' key as requested by FMi} |
| 114 |
% \changes{v2.0}{2019/07/07}{Use NFSS scheme for fonts mapping} |
| 115 |
% \changes{v2.0}{2019/07/07}{Rewrite major part of the code supporting |
| 116 |
% 8 fonts. Harmonize the usage of package options over different TeX |
| 117 |
% engines} |
| 118 |
% \changes{v2.0}{2019/07/07}{Update OTF fonts to version 1.004 now |
| 119 |
% consisting of 8 fonts, 844 glyphs each} |
| 120 |
% \changes{v1.0}{2016/05/01}{Initial version} |
| 121 |
% |
| 122 |
% \title{Using \textsf{Rosario} fonts with LaTeX\thanks{This file has |
| 123 |
% version number \fileversion, last revised \filedate.}} |
| 124 |
% \author{Arash Esbati} |
| 125 |
% \date{\filedate} |
| 126 |
% \maketitle |
| 127 |
% |
| 128 |
% \begin{abstract} |
| 129 |
% \noindent |
| 130 |
% This package provides the necessary files to use the |
| 131 |
% \textsf{Rosario} fonts with LaTeX. \textsf{Rosario} is a set of |
| 132 |
% eight fonts provided by Héctor Gatti, Adobe Fonts~\& |
| 133 |
% Omnibus-Type Team under the Open Font License (OFL). |
| 134 |
% \end{abstract} |
| 135 |
% |
| 136 |
% \tableofcontents \clearpage |
| 137 |
% |
| 138 |
% \section{Introduction} |
| 139 |
% \label{sec:introduction} |
| 140 |
% |
| 141 |
% \textsf{Rosario}\footnote{Copyright \textcopyright\ 2012--2019, |
| 142 |
% Omnibus-Type (\url{https://www.omnibus-type.com})} is a set of eight |
| 143 |
% fonts created by Héctor Gatti, Adobe Typekit \& Omnibus-Type Team |
| 144 |
% and provided by Omnibus-Type\footnote{Many thanks to Omnibus-Type |
| 145 |
% team for their explicit permission to upload the files to CTAN.} |
| 146 |
% under the SIL Open Font License, Version 1.1. From the web page: |
| 147 |
% \begin{quote}\sffamily |
| 148 |
% ``\textsf{Rosario} is a singular typeface with 4 weight variants, |
| 149 |
% plus matching italics. Its grace lies in the classic proportions. |
| 150 |
% Its weak endings make it subtle, yet dynamic. Named after a |
| 151 |
% crowded city, it is suitable for diverse publishing contexts, such |
| 152 |
% as popular magazines, poetry books, illustrated editions and |
| 153 |
% academic journals. It was designed by Héctor Gatti initially for |
| 154 |
% private use, later on developed by the Omnibus-Type Team, and |
| 155 |
% optimized by Adobe Fonts.'' |
| 156 |
% \end{quote} |
| 157 |
% |
| 158 |
% The fonts were obtained from Omni-Type web |
| 159 |
% page\footnote{\url{https://www.omnibus-type.com/fonts/rosario/}}. |
| 160 |
% (v1.004, 8~fonts, 844~glyphs each variant). |
| 161 |
% |
| 162 |
% \section{Installation} |
| 163 |
% \label{sec:installation} |
| 164 |
% |
| 165 |
% I suggest you use MikTeX or TeXlive and wait until the fonts are |
| 166 |
% distributed for your TeX installation via their package manager. |
| 167 |
% |
| 168 |
% \section{Usage} |
| 169 |
% \label{sec:usage} |
| 170 |
% |
| 171 |
% The fonts can be used with traditional (pdf)TeX engine and newer |
| 172 |
% XeTeX and LuaTeX engines which can access \textsc{otf} fonts |
| 173 |
% directly. They are described below. In general, this bundle tries |
| 174 |
% not to be smart and loads only \pkg{kvoptions}, \pkg{ifxetex}, |
| 175 |
% \pkg{ifluatex}, and depending on engine \pkg{fontaxes} and |
| 176 |
% \pkg{mweights} or \pkg{fontspec}. As the result, some work must be |
| 177 |
% done by the user. |
| 178 |
% |
| 179 |
% \subsection{Engine independent options} |
| 180 |
% \label{sec:engine-indep-opti} |
| 181 |
% |
| 182 |
% A package \pkg{Rosario.sty} is provided which can be loaded in the |
| 183 |
% preamble as usual: |
| 184 |
% \begin{quote} |
| 185 |
% "\usepackage{Rosario}" |
| 186 |
% \end{quote} |
| 187 |
% Loading the package changes the document's sans-serif font to |
| 188 |
% \textsf{Rosario}. The package offers some options. |
| 189 |
% |
| 190 |
% \DescribeMacro{light\,\textbar\,regular} |
| 191 |
% The default sans-serif font series is set with one of "light" or |
| 192 |
% "regular" -- "regular" is the default. It can be changed like this: |
| 193 |
% \begin{quote} |
| 194 |
% "\usepackage[light]{Rosario}" |
| 195 |
% \end{quote} |
| 196 |
% |
| 197 |
% \DescribeMacro{bold\,\textbar\,semibold} |
| 198 |
% The default bold series is set with one of "bold" or "semibold"~-- |
| 199 |
% "bold" is the default. |
| 200 |
% |
| 201 |
% \DescribeMacro{lining\,\textbar\,oldstyle} |
| 202 |
% \DescribeMacro{proportional\,\textbar\,tabular} |
| 203 |
% The alignment and style for the figures of the document are set by |
| 204 |
% the options "lining" or "oldstyle" and "proportional" or "tabular". |
| 205 |
% "lining" and "proportional" are the defaults. Short aliases "lf", |
| 206 |
% "osf", "prop" and "tab" are also available. Being boolean options, |
| 207 |
% following example results in proportional oldstyle figures: |
| 208 |
% \begin{quote} |
| 209 |
% "\usepackage[lining=false,tabular=false]{Rosario}" |
| 210 |
% \end{quote} |
| 211 |
% |
| 212 |
% \DescribeMacro{familydefault} |
| 213 |
% The main font of a document can be switched to \textsf{Rosario} with |
| 214 |
% package option "familydefault" or "familydefault=true", e.g.: |
| 215 |
% \begin{quote} |
| 216 |
% "\usepackage[familydefault]{Rosario}" |
| 217 |
% \end{quote} |
| 218 |
% |
| 219 |
% \DescribeMacro{opentype\,\textbar\,type1} |
| 220 |
% If the automatic engine detection fails, it can be specified by the |
| 221 |
% user with one of "opentype" or "type1". Note that these option do |
| 222 |
% not take a boolean value "true" or "false". |
| 223 |
% |
| 224 |
% \DescribeMacro{scale\,\textbar\,scaled} |
| 225 |
% The size of the \textsf{Rosario} fonts can be adjusted with the |
| 226 |
% "scale" or "scaled" option, e.g.: |
| 227 |
% \begin{quote} |
| 228 |
% "\usepackage[scale=0.97]{Rosario}" |
| 229 |
% \end{quote} |
| 230 |
% |
| 231 |
% \subsection{(pdf)LaTeX specific notes} |
| 232 |
% \label{sec:under-pdflatex} |
| 233 |
% |
| 234 |
% \textsc{ot1}, \textsc{ly1}, \textsc{t1} and \textsc{ts1} encodings |
| 235 |
% are supported. \pkg{Rosario.sty} does not load the respective |
| 236 |
% packages, it is up to user to load them, e.g.: |
| 237 |
% \begin{quote} |
| 238 |
% "\usepackage[T1]{fontenc}" \\ |
| 239 |
% "\usepackage{Rosario}" \\ |
| 240 |
% "\usepackage{textcomp}" |
| 241 |
% \end{quote} |
| 242 |
% |
| 243 |
% \textsf{Rosario} fonts provide a rich set of figures (see |
| 244 |
% table~\ref{tab:figures}). With traditional engines, |
| 245 |
% \pkg{fontaxes.sty} is loaded and the command \cmd{\fontversion} is |
| 246 |
% available to switch between "lining", "oldstyle", "tabular" and |
| 247 |
% "proportional" styles and alignments. For other versions the |
| 248 |
% following macros are provided: |
| 249 |
% \begin{itemize} |
| 250 |
% \item "\textsu" renders its argument in superior figures. |
| 251 |
% "\textsu{123}" produces {\sffamily\textsu{123}}. The |
| 252 |
% corresponding declaration is "\sufigures". |
| 253 |
% \item "\textin" renders its argument in inferior figures. |
| 254 |
% "\textin{123}" produces {\sffamily\textin{123}}. The |
| 255 |
% corresponding declaration is "\infigures". |
| 256 |
% \item "\textnu" renders its argument in numerator figures. |
| 257 |
% "\textnu{123}" produces {\sffamily\textnu{123}}. The |
| 258 |
% corresponding declaration is "\nufigures". |
| 259 |
% \item "\textde" renders its argument in denominator figures. |
| 260 |
% "\textde{123}" produces {\sffamily\textde{123}}. The |
| 261 |
% corresponding declaration is "\defigures". |
| 262 |
% \end{itemize} |
| 263 |
% |
| 264 |
% \subsection{XeLaTeX/LuaLaTeX specific notes} |
| 265 |
% \label{sec:under-xelat-lual} |
| 266 |
% |
| 267 |
% These engines can access \textsc{OTF} fonts directly. The standard |
| 268 |
% interface for this purpose is |
| 269 |
% \pkg{fontspec.sty}\footnote{\url{https://ctan.org/pkg/fontspec}}. |
| 270 |
% \pkg{Rosario.sty} detects if XeLaTeX or LuaLaTeX are used and passes |
| 271 |
% options given to the package to "\setsansfont" via |
| 272 |
% \cmd{\defaultfeature}. Other \pkg{fontspec.sty} options can be set |
| 273 |
% with \cmd{\defaultfeature+}: |
| 274 |
% \begin{quote} |
| 275 |
% "\usepackage{fontspec}" \\ |
| 276 |
% "\usepackage{Rosario}" \\ |
| 277 |
% "\defaultfontfeatures+[Rosario]{" \\ |
| 278 |
% " Scale = MatchLowercase ," \\ |
| 279 |
% " Color = blue" \\ |
| 280 |
% "}" |
| 281 |
% \end{quote} |
| 282 |
% ^^A |
| 283 |
% Table \ref{tab:font-features} contains a list of available font |
| 284 |
% features. |
| 285 |
% \begin{table}[tbp] |
| 286 |
% \centering |
| 287 |
% \caption{Rosario font features} |
| 288 |
% \label{tab:font-features} |
| 289 |
% \begin{tabular}{@{}>{\ttfamily}ll@{}} |
| 290 |
% \toprule |
| 291 |
% aalt & Access All Alternates \\ |
| 292 |
% case & Case-Sensitive Forms \\ |
| 293 |
% ccmp & Glyph Composition/Decomposition \\ |
| 294 |
% cpsp & Capital Spacing \\ |
| 295 |
% dnom & Denominators \\ |
| 296 |
% frac & Fractions \\ |
| 297 |
% kern & Kerning \\ |
| 298 |
% liga & Standard Ligatures \\ |
| 299 |
% lnum & Lining Figures \\ |
| 300 |
% mark & Mark Positioning \\ |
| 301 |
% mkmk & Mark to Mark Positioning \\ |
| 302 |
% numr & Numerators \\ |
| 303 |
% onum & Oldstyle Figures \\ |
| 304 |
% ordn & Ordinals \\ |
| 305 |
% pnum & Proportional Figures \\ |
| 306 |
% sinf & Scientific Inferiors \\ |
| 307 |
% subs & Subscript \\ |
| 308 |
% sups & Superscript \\ |
| 309 |
% tnum & Tabular Figures \\ |
| 310 |
% zero & Slashed Zero \\ |
| 311 |
% \bottomrule |
| 312 |
% \end{tabular} |
| 313 |
% \end{table} |
| 314 |
% |
| 315 |
% LaTeX font selection macros like \cmd{\fontseries} work with these |
| 316 |
% engines as well. |
| 317 |
% |
| 318 |
% Earlier versions of this package provided a file |
| 319 |
% \pkg{Rosario.fontspec}. The functionality in now incorporated in |
| 320 |
% the package. Hence, \pkg{Rosario.fontspec} is removed. |
| 321 |
% |
| 322 |
% \clearpage |
| 323 |
% |
| 324 |
% \section{OT1 encoding font table} |
| 325 |
% \label{sec:ot1-font-table} |
| 326 |
% |
| 327 |
% \xfonttable{OT1}{Rosario-LF}{m}{n} |
| 328 |
% |
| 329 |
% \clearpage |
| 330 |
% |
| 331 |
% \section{LY1 encoding font table} |
| 332 |
% \label{sec:ly1-font-table} |
| 333 |
% |
| 334 |
% \xfonttable{LY1}{Rosario-LF}{m}{n} |
| 335 |
% |
| 336 |
% \section{T1 encoding font table} |
| 337 |
% \label{sec:t1-font-table} |
| 338 |
% |
| 339 |
% \xfonttable{T1}{Rosario-LF}{m}{n} |
| 340 |
% |
| 341 |
% \section{TS1 encoding font table} |
| 342 |
% \label{sec:ts1-font-table} |
| 343 |
% |
| 344 |
% \xfonttable{TS1}{Rosario-LF}{m}{n} |
| 345 |
% |
| 346 |
% \clearpage |
| 347 |
% |
| 348 |
% \section{Text samples} |
| 349 |
% \label{sec:text-samples} |
| 350 |
% |
| 351 |
% \subsection*{Regular} |
| 352 |
% {\sffamily\lipsum[1]\lipsum*[2] \quad 1234567890} |
| 353 |
% |
| 354 |
% \subsection*{Italic} |
| 355 |
% {\sffamily\itshape\lipsum[1]\lipsum*[2] \quad 1234567890} |
| 356 |
% |
| 357 |
% \subsection*{Bold} |
| 358 |
% {\sffamily\bfseries\lipsum[1]\lipsum*[2] \quad 1234567890} |
| 359 |
% |
| 360 |
% \subsection*{Bold italic} |
| 361 |
% {\sffamily\bfseries\itshape\lipsum[1]\lipsum*[2] \quad 1234567890} |
| 362 |
% |
| 363 |
% \subsection*{Semi Bold} |
| 364 |
% {\sffamily\fontseries{sb}\selectfont\lipsum[1]\lipsum*[2] \quad |
| 365 |
% 1234567890} |
| 366 |
% |
| 367 |
% \subsection*{Semi Bold italic} |
| 368 |
% {\sffamily\fontseries{sb}\selectfont\itshape\lipsum[1]\lipsum*[2] |
| 369 |
% \quad 1234567890} |
| 370 |
% |
| 371 |
% \subsection*{Light} |
| 372 |
% {\sffamily\fontseries{l}\selectfont\lipsum[1]\lipsum*[2] \quad |
| 373 |
% 1234567890} |
| 374 |
% |
| 375 |
% \subsection*{Light italic} |
| 376 |
% {\sffamily\fontseries{l}\selectfont\itshape\lipsum[1]\lipsum*[2] |
| 377 |
% \quad 1234567890} |
| 378 |
% |
| 379 |
% \subsection*{Figures} |
| 380 |
% |
| 381 |
% \begin{table}[!h] |
| 382 |
% \centering |
| 383 |
% \caption{Figure styles and alignments} |
| 384 |
% \label{tab:figures} |
| 385 |
% \begin{tabular}{@{}l>{\sffamily}l@{}} |
| 386 |
% \toprule |
| 387 |
% Proportional lining & \_\figureversion{prop,lf}0123456789\_ \\ |
| 388 |
% Tabular lining & \_\figureversion{tab,lf}0123456789\_ \\ |
| 389 |
% Proportional oldstyle & \_\figureversion{prop,osf}0123456789\_ \\ |
| 390 |
% Tabular oldstyle & \_\figureversion{tab,osf}0123456789\_ \\ |
| 391 |
% Superiors & \_\sufigures 0123456789\_ \\ |
| 392 |
% Inferiors & \_\infigures 0123456789\_ \\ |
| 393 |
% Numerators & \_\nufigures 0123456789\_ \\ |
| 394 |
% Denominators & \_\defigures 0123456789\_ \\ |
| 395 |
% \bottomrule |
| 396 |
% \end{tabular} |
| 397 |
% \end{table} |
| 398 |
% |
| 399 |
% \StopEventually{^^A |
| 400 |
% \PrintChanges |
| 401 |
% } |
| 402 |
% \clearpage |
| 403 |
% |
| 404 |
% \section{Implementation} |
| 405 |
% \label{sec:implementation} |
| 406 |
% |
| 407 |
% Font support files are generated by "autoinst". As a random note, |
| 408 |
% "autoinst" is invoked with: |
| 409 |
% \begin{verbatim} |
| 410 |
% autoinst \ |
| 411 |
% --encoding=OT1,T1,LY1 \ |
| 412 |
% --ts1 \ |
| 413 |
% --sanserif \ |
| 414 |
% --nosmallcaps \ |
| 415 |
% --noswash \ |
| 416 |
% --notitling \ |
| 417 |
% --inferiors=subs \ |
| 418 |
% --fractions \ |
| 419 |
% --noornaments \ |
| 420 |
% --ligatures \ |
| 421 |
% --verbose \ |
| 422 |
% Rosario-*.otf |
| 423 |
% \end{verbatim} |
| 424 |
% \vspace{-\baselineskip} |
| 425 |
% |
| 426 |
% We don't use the \pkg{Rosario.sty} generated by "autoinst" and use |
| 427 |
% our version instead. |
| 428 |
% |
| 429 |
% \subsection{Rosario.sty} |
| 430 |
% \label{sec:rosario.sty} |
| 431 |
% |
| 432 |
% \begin{macrocode} |
| 433 |
%<*package> |
| 434 |
% \end{macrocode} |
| 435 |
% |
| 436 |
% Require the packages \pkg{ifxetex.sty} and \pkg{ifluatex.sty}: |
| 437 |
% \begin{macrocode} |
| 438 |
\RequirePackage{ifxetex} |
| 439 |
\RequirePackage{ifluatex} |
| 440 |
% \end{macrocode} |
| 441 |
% |
| 442 |
% First, we need a switch to know which engine is used: |
| 443 |
% \begin{macrocode} |
| 444 |
\newif\ifRosario@otf |
| 445 |
\ifxetex % we are in XeTeX |
| 446 |
\Rosario@otftrue |
| 447 |
\else |
| 448 |
\ifluatex % we are in LuaTeX |
| 449 |
\Rosario@otftrue |
| 450 |
\else |
| 451 |
\Rosario@otffalse |
| 452 |
\fi |
| 453 |
\fi |
| 454 |
% \end{macrocode} |
| 455 |
% |
| 456 |
% Load the packages we rely on: |
| 457 |
% \pkg{fontspec.sty}\footnote{\url{https://www.ctan.org/pkg/fontspec}} |
| 458 |
% for LuaTeX and XeTeX, or |
| 459 |
% \pkg{mweights.sty}\footnote{\url{https://www.ctan.org/pkg/mweights}} |
| 460 |
% and |
| 461 |
% \pkg{fontaxes.sty}\footnote{\url{https://www.ctan.org/pkg/fontaxes}} |
| 462 |
% for (pdf)LaTeX: |
| 463 |
% \begin{macrocode} |
| 464 |
\ifRosario@otf |
| 465 |
\RequirePackage{fontspec} |
| 466 |
\else |
| 467 |
\RequirePackage{mweights} |
| 468 |
\RequirePackage{fontaxes} |
| 469 |
\fi |
| 470 |
% \end{macrocode} |
| 471 |
% |
| 472 |
% We use |
| 473 |
% \pkg{kvoptions}\footnote{\url{https://www.ctan.org/pkg/kvoptions}} |
| 474 |
% for key handling: |
| 475 |
% \begin{macrocode} |
| 476 |
\RequirePackage{kvoptions} |
| 477 |
% \end{macrocode} |
| 478 |
% Setup the keyval options: |
| 479 |
% \begin{macrocode} |
| 480 |
\SetupKeyvalOptions{% |
| 481 |
family = Rosario , |
| 482 |
prefix = Rosario@ |
| 483 |
} |
| 484 |
% \end{macrocode} |
| 485 |
% |
| 486 |
% The basic strategy for font and figure related keys is to declare |
| 487 |
% them as complementary ones, i.e. "regular" vs. "light", "bold" |
| 488 |
% vs. "semibold", "lining" vs. "oldstyle" and "proportional" |
| 489 |
% vs. "tabular": |
| 490 |
% \begin{macrocode} |
| 491 |
\DeclareBoolOption{regular} |
| 492 |
\DeclareComplementaryOption{light}{regular} |
| 493 |
\DeclareBoolOption{bold} |
| 494 |
\DeclareComplementaryOption{semibold}{bold} |
| 495 |
\DeclareBoolOption{lining} |
| 496 |
\DeclareComplementaryOption{oldstyle}{lining} |
| 497 |
\DeclareBoolOption{tabular} |
| 498 |
\DeclareComplementaryOption{proportional}{tabular} |
| 499 |
% \end{macrocode} |
| 500 |
% |
| 501 |
% Alias keys are defined with \cmd{\define@key}. Given values to |
| 502 |
% these keys are passed to the original keys and they are set via |
| 503 |
% \cmd{\kvsetkeys}. |
| 504 |
% \begin{macrocode} |
| 505 |
\define@key{Rosario}{lf}[true]{% |
| 506 |
\kvsetkeys{Rosario}{lining=#1}% |
| 507 |
} |
| 508 |
\define@key{Rosario}{osf}[true]{% |
| 509 |
\kvsetkeys{Rosario}{oldstyle=#1}% |
| 510 |
} |
| 511 |
\define@key{Rosario}{tab}[true]{% |
| 512 |
\kvsetkeys{Rosario}{tabular=#1}% |
| 513 |
} |
| 514 |
\define@key{Rosario}{prop}[true]{% |
| 515 |
\kvsetkeys{Rosario}{proportional=#1}% |
| 516 |
} |
| 517 |
% \end{macrocode} |
| 518 |
% |
| 519 |
% "scale" and "scaled" keys are special: With (pdf)LaTeX, "scale" is a |
| 520 |
% string option, "scaled" is an alias and sets \cmd{\Rosario@scale} |
| 521 |
% which is defined by the "scale" key. With XeLaTeX and LuaLaTeX, |
| 522 |
% they set the macro \cmd{\Rosario@otf@scale} which is later used in |
| 523 |
% \cmd{\defaultfontfeatures}. |
| 524 |
% \begin{macrocode} |
| 525 |
\ifRosario@otf |
| 526 |
\newcommand*\Rosario@otf@scale{} |
| 527 |
\define@key{Rosario}{scale}[1.0]{% |
| 528 |
\renewcommand*\Rosario@otf@scale{#1}% |
| 529 |
} |
| 530 |
\define@key{Rosario}{scaled}[1.0]{% |
| 531 |
\renewcommand*\Rosario@otf@scale{#1}% |
| 532 |
} |
| 533 |
\else |
| 534 |
\DeclareStringOption[1.0]{scale} |
| 535 |
\define@key{Rosario}{scaled}[1.0]{% |
| 536 |
\renewcommand*\Rosario@scale{#1}% |
| 537 |
} |
| 538 |
\fi |
| 539 |
% \end{macrocode} |
| 540 |
% |
| 541 |
% "familydefault" switches the default font to \textsf{Rosario}: |
| 542 |
% \begin{macrocode} |
| 543 |
\DeclareBoolOption{familydefault} |
| 544 |
% \end{macrocode} |
| 545 |
% |
| 546 |
% The next 2 are for users where the automatic engine detection might |
| 547 |
% fail: |
| 548 |
% \begin{macrocode} |
| 549 |
\DeclareVoidOption{opentype}{\Rosario@otftrue} |
| 550 |
\DeclareVoidOption{type1}{\Rosario@otffalse} |
| 551 |
% \end{macrocode} |
| 552 |
% |
| 553 |
% Execute the default options and process the rest. |
| 554 |
% \begin{macrocode} |
| 555 |
\setkeys{Rosario}{regular,bold,lining,proportional} |
| 556 |
\ProcessKeyvalOptions{Rosario} |
| 557 |
% \end{macrocode} |
| 558 |
% |
| 559 |
% We need some macros to store the figure alignment and style and font |
| 560 |
% defintions: |
| 561 |
% \begin{macrocode} |
| 562 |
\newcommand*\Rosario@figurestyle{} |
| 563 |
\newcommand*\Rosario@figurealign{} |
| 564 |
\newcommand*\Rosario@otf@regular{} |
| 565 |
\newcommand*\Rosario@otf@italic{} |
| 566 |
\newcommand*\Rosario@otf@bold{} |
| 567 |
\newcommand*\Rosario@otf@bolditalic{} |
| 568 |
% \end{macrocode} |
| 569 |
% |
| 570 |
% Definition for "light" and "regular" keys for all engines: |
| 571 |
% \begin{macrocode} |
| 572 |
\ifRosario@regular |
| 573 |
\ifRosario@otf |
| 574 |
\def\Rosario@otf@regular{Regular} |
| 575 |
\def\Rosario@otf@italic{Italic} |
| 576 |
\else |
| 577 |
\def\mdseries@sf{m} |
| 578 |
\fi |
| 579 |
\else |
| 580 |
\ifRosario@otf |
| 581 |
\def\Rosario@otf@regular{Light} |
| 582 |
\def\Rosario@otf@italic{LightItalic} |
| 583 |
\else |
| 584 |
\def\mdseries@sf{l} |
| 585 |
\fi |
| 586 |
\fi |
| 587 |
% \end{macrocode} |
| 588 |
% |
| 589 |
% Definition for "semibold" and "bold" keys for all engines: |
| 590 |
% \begin{macrocode} |
| 591 |
\ifRosario@bold |
| 592 |
\ifRosario@otf |
| 593 |
\def\Rosario@otf@bold{Bold} |
| 594 |
\def\Rosario@otf@bolditalic{BoldItalic} |
| 595 |
\else |
| 596 |
\def\bfseries@sf{b} |
| 597 |
\fi |
| 598 |
\else |
| 599 |
\ifRosario@otf |
| 600 |
\def\Rosario@otf@bold{SemiBold} |
| 601 |
\def\Rosario@otf@bolditalic{SemiBoldItalic} |
| 602 |
\else |
| 603 |
\def\bfseries@sf{sb} |
| 604 |
\fi |
| 605 |
\fi |
| 606 |
% \end{macrocode} |
| 607 |
% |
| 608 |
% Definition for figure styles for all engines: |
| 609 |
% \begin{macrocode} |
| 610 |
\ifRosario@lining |
| 611 |
\ifRosario@otf |
| 612 |
\def\Rosario@figurestyle{Lining} |
| 613 |
\else |
| 614 |
\def\Rosario@figurestyle{LF} |
| 615 |
\fi |
| 616 |
\else |
| 617 |
\ifRosario@otf |
| 618 |
\def\Rosario@figurestyle{OldStyle} |
| 619 |
\else |
| 620 |
\def\Rosario@figurestyle{OsF} |
| 621 |
\fi |
| 622 |
\fi |
| 623 |
% \end{macrocode} |
| 624 |
% |
| 625 |
% Definition for figure alignments for all engines: |
| 626 |
% \begin{macrocode} |
| 627 |
\ifRosario@tabular |
| 628 |
\ifRosario@otf |
| 629 |
\def\Rosario@figurealign{Monospaced} |
| 630 |
\else |
| 631 |
\def\Rosario@figurealign{T} |
| 632 |
\fi |
| 633 |
\else |
| 634 |
\ifRosario@otf |
| 635 |
\def\Rosario@figurealign{Proportional} |
| 636 |
\else |
| 637 |
\def\Rosario@figurealign{} |
| 638 |
\fi |
| 639 |
\fi |
| 640 |
% \end{macrocode} |
| 641 |
% |
| 642 |
% Standard setup for \pkg{fontaxes.sty}. This is only relevant for |
| 643 |
% (pdf)LaTeX: |
| 644 |
% \begin{macrocode} |
| 645 |
\ifRosario@otf \else |
| 646 |
\fa@naming@exception{figures}{{superior}{proportional}}{Sup} |
| 647 |
\fa@naming@exception{figures}{{superior}{tabular}}{Sup} |
| 648 |
\def\sufigures{\@nomath\sufigures |
| 649 |
\fontfigurestyle{superior}\selectfont} |
| 650 |
\DeclareTextFontCommand{\textsu}{\sufigures} |
| 651 |
\let\textsuperior\textsu |
| 652 |
|
| 653 |
\fa@naming@exception{figures}{{inferior}{proportional}}{Inf} |
| 654 |
\fa@naming@exception{figures}{{inferior}{tabular}}{Inf} |
| 655 |
\def\infigures{\@nomath\infigures |
| 656 |
\fontfigurestyle{inferior}\selectfont} |
| 657 |
\DeclareTextFontCommand{\textin}{\infigures} |
| 658 |
\let\textinferior\textin |
| 659 |
|
| 660 |
\fa@naming@exception{figures}{{numerators}{proportional}}{Numr} |
| 661 |
\fa@naming@exception{figures}{{numerators}{tabular}}{Numr} |
| 662 |
\def\nufigures{\@nomath\nufigures |
| 663 |
\fontfigurestyle{numerators}\selectfont} |
| 664 |
\DeclareTextFontCommand{\textnu}{\nufigures} |
| 665 |
\let\textnumerator\textnu |
| 666 |
|
| 667 |
\fa@naming@exception{figures}{{denominators}{proportional}}{Dnom} |
| 668 |
\fa@naming@exception{figures}{{denominators}{tabular}}{Dnom} |
| 669 |
\def\defigures{\@nomath\defigures |
| 670 |
\fontfigurestyle{denominators}\selectfont} |
| 671 |
\DeclareTextFontCommand{\textde}{\defigures} |
| 672 |
\let\textdenominator\textde |
| 673 |
\fi |
| 674 |
% \end{macrocode} |
| 675 |
% |
| 676 |
% For XeLaTeX/LuaLaTeX, we define the font features depending on the |
| 677 |
% given package options: |
| 678 |
% \begin{macrocode} |
| 679 |
\ifRosario@otf |
| 680 |
\defaultfontfeatures[Rosario]{% |
| 681 |
Extension = .otf , |
| 682 |
Ligatures = {TeX,Common} , |
| 683 |
Scale = \Rosario@otf@scale , |
| 684 |
UprightFont = *-\Rosario@otf@regular , |
| 685 |
ItalicFont = *-\Rosario@otf@italic , |
| 686 |
BoldFont = *-\Rosario@otf@bold , |
| 687 |
BoldItalicFont = *-\Rosario@otf@bolditalic , |
| 688 |
FontFace = {l}{n}{*-Light} , |
| 689 |
FontFace = {l}{it}{*-LightItalic} , |
| 690 |
FontFace = {m}{n}{*-Regular} , |
| 691 |
FontFace = {m}{it}{*-Italic} , |
| 692 |
FontFace = {b}{n}{*-Bold} , |
| 693 |
FontFace = {b}{it}{*-BoldItalic} , |
| 694 |
FontFace = {sb}{n}{*-SemiBold} , |
| 695 |
FontFace = {sb}{it}{*-SemiBoldItalic} , |
| 696 |
Numbers = {\Rosario@figurestyle,\Rosario@figurealign} |
| 697 |
} |
| 698 |
\fi |
| 699 |
% \end{macrocode} |
| 700 |
% |
| 701 |
% Switch the sans serif font to \textsf{Rosario}. With |
| 702 |
% \pkg{fontspec}, we delay the \cmd{\setsansfont} until |
| 703 |
% "AtBeginDocument" so that user can provide additional features with |
| 704 |
% \cmd{\defaultfontfeatures+}. |
| 705 |
% \begin{macrocode} |
| 706 |
\ifRosario@otf |
| 707 |
\AtBeginDocument{% |
| 708 |
\setsansfont{Rosario}% |
| 709 |
} |
| 710 |
\else |
| 711 |
\renewcommand*\sfdefault{% |
| 712 |
Rosario-\Rosario@figurealign\Rosario@figurestyle |
| 713 |
} |
| 714 |
\fi |
| 715 |
% \end{macrocode} |
| 716 |
% |
| 717 |
% Switch the default font if the respective key is given: |
| 718 |
% \begin{macrocode} |
| 719 |
\ifRosario@familydefault |
| 720 |
\ifRosario@otf |
| 721 |
\AtBeginDocument{% |
| 722 |
\setmainfont{Rosario}% |
| 723 |
} |
| 724 |
\else |
| 725 |
\renewcommand*\familydefault{\sfdefault} |
| 726 |
\ifRosario@regular \else |
| 727 |
\edef\seriesdefault{\mdseries@sf} |
| 728 |
\fi |
| 729 |
\ifRosario@bold \else |
| 730 |
\edef\bfdefault{\bfseries@sf} |
| 731 |
\fi |
| 732 |
\fi |
| 733 |
\fi |
| 734 |
% \end{macrocode} |
| 735 |
% |
| 736 |
% \begin{macrocode} |
| 737 |
%</package> |
| 738 |
% \end{macrocode} |
| 739 |
% |
| 740 |
% \Finale |
| 741 |
% |
| 742 |
\endinput |
| 743 |
% |
| 744 |
% Local Variables: |
| 745 |
% mode: doctex |
| 746 |
% TeX-master: t |
| 747 |
% End: |