diff options
author | Karl Berry <karl@freefriends.org> | 2019-06-20 21:31:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-06-20 21:31:24 +0000 |
commit | 957f2809550fd56d0d3225166b0a095c92c158f2 (patch) | |
tree | fdb3d32f40601f63920af17039fbd8387ab00266 /Master/texmf-dist/tex/latex/cantarell/cantarell.sty | |
parent | aa5ca4cd1f918038582549fcb75c6c5ccc55c852 (diff) |
cantarell (20jun19)
git-svn-id: svn://tug.org/texlive/trunk@51412 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cantarell/cantarell.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/cantarell/cantarell.sty | 183 |
1 files changed, 152 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/cantarell/cantarell.sty b/Master/texmf-dist/tex/latex/cantarell/cantarell.sty index eaec95d6634..22913552918 100644 --- a/Master/texmf-dist/tex/latex/cantarell/cantarell.sty +++ b/Master/texmf-dist/tex/latex/cantarell/cantarell.sty @@ -1,5 +1,5 @@ %% cantarell.sty -%% Copyright 2011, 2012 Mohamed El Morabity +%% Copyright 2019 Mohamed El Morabity % % This work may be distributed and/or modified under the conditions of the LaTeX % Project Public License, either version 1.3 of this license or (at your option) @@ -8,40 +8,161 @@ % distributions of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. -% +% % The Current Maintainer of this work is Mohamed El Morabity % % This work consists of all files listed in manifest.txt. + \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{cantarell}[2012/01/03 Cantarell] - -\RequirePackage{keyval} -\RequirePackage{slantsc} - -% Taken from inconsolata.sty -\define@key{cantarell}{scale}[1.0]{\def\cantarell@scale{s*[#1]}} -\DeclareOption*{% - \begingroup% - \edef\x{\endgroup% - \noexpand\setkeys{cantarell}{\CurrentOption}}% - \x% -} - -\DeclareOption{defaultsans}{% - \renewcommand*{\sfdefault}{fca}% -} - -\DeclareOption{default}{% - \renewcommand*{\familydefault}{fca}% - \renewcommand*{\sfdefault}{fca}% -} - -\ProcessOptions* - -\newcommand{\fcafamily}{% - \fontfamily{fca}% - \selectfont% -} +\ProvidesPackage{cantarell}[2019/06/15 Style file for Cantarell.] + +\RequirePackage{fontaxes} +\RequirePackage{ifluatex} +\RequirePackage{ifxetex} +\RequirePackage{xkeyval} + +\newif\ifcantarell@otf +\ifxetex +\cantarell@otftrue +\else +\ifluatex +\cantarell@otftrue +\else +\cantarell@otffalse +\fi +\fi + +\newif\ifcantarell@lining +\newif\ifcantarell@oldstyle + +\newif\ifcantarell@tabular +\newif\ifcantarell@proportional + +\newif\ifcantarell@default +\cantarell@defaultfalse + +\newif\ifcantarell@defaultsans +\cantarell@defaultsansfalse + +\newcommand*{\cantarell@scale}{1} +\DeclareOptionX{scale}{\renewcommand*{\cantarell@scale}{#1}} +\DeclareOptionX{scaled}{\renewcommand*{\cantarell@scale}{#1}} + +\DeclareOptionX{default}{\cantarell@defaulttrue} +\DeclareOptionX{defaultsans}{\cantarell@defaultsanstrue} +\DeclareOptionX{lining}{\cantarell@liningtrue} +\DeclareOptionX{oldstyle}{\cantarell@liningfalse} +\DeclareOptionX{tabular}{\cantarell@tabulartrue} +\DeclareOptionX{proportional}{\cantarell@tabularfalse} +\DeclareOptionX{type1}{\cantarell@otffalse} + +\ExecuteOptionsX{tabular,lining} +\ProcessOptionsX +\relax + +\ifcantarell@tabular + \newcommand*{\cantarell@figurewidth@otf}{Monospaced} + \newcommand*{\cantarell@figurewidth@pfb}{T} +\else + \newcommand*{\cantarell@figurewidth@otf}{Proportional} + \newcommand*{\cantarell@figurewidth@pfb}{} +\fi +\ifcantarell@lining + \newcommand*{\cantarell@figurestyle@otf}{Lining} + \newcommand*{\cantarell@figurestyle@pfb}{LF} +\else + \newcommand*{\cantarell@figurestyle@otf}{OldStyle} + \newcommand*{\cantarell@figurestyle@pfb}{OsF} +\fi + +\newcommand*{\cantarell@familyprefix}{cantarell} +\newcommand*{\cantarell@family}[1]{\cantarell@familyprefix-#1} +\newcommand*{\cantarellfamily}{\cantarell@family{\cantarell@figurewidth@pfb\cantarell@figurestyle@pfb}} + +\ifcantarell@otf + \RequirePackage{fontspec} + + \ifxetex + \XeTeXtracingfonts=1 + \fi + + \newcommand*{\cantarell@otf@slant}{0.141} + \newcommand*{\cantarell@otf@features}{% + Extension=.otf,% + Ligatures=Common,% + Scale=\cantarell@scale,% + FontFace={el}{n}{*-Thin},% + FontFace={el}{it}{Font=*-Thin,FakeSlant=\cantarell@otf@slant},% + FontFace={l}{n}{*-Light},% + FontFace={l}{it}{Font=*-Light,FakeSlant=\cantarell@otf@slant},% + UprightFont={*-Regular},% + ItalicFont={*-Regular},% + ItalicFeatures={FakeSlant=\cantarell@otf@slant}, + FontFace={b}{n}{*-Bold},% + FontFace={b}{it}{Font=*-Bold,FakeSlant=\cantarell@otf@slant},% + BoldFont={*-Bold},% + BoldItalicFont={*-Bold},% + BoldItalicFeatures={FakeSlant=\cantarell@otf@slant},% + FontFace={eb}{n}{*-ExtraBold},% + FontFace={eb}{it}{Font=*-ExtraBold,FakeSlant=\cantarell@otf@slant}% + } + + % Define family for each figure style/width, with corresponding + % NFSS family, for fontaxes support + \newfontfamily{\cantarell@otf@TLF}[% + \cantarell@otf@features,% + Numbers={Monospaced,Lining},% + NFSSFamily=\cantarell@family{TLF}% + ]{Cantarell} + \newfontfamily{\cantarell@otf@LF}[% + \cantarell@otf@features,% + Numbers={Proportional,Lining},% + NFSSFamily=\cantarell@family{LF}% + ]{Cantarell} + \newfontfamily{\cantarell@otf@TOsF}[% + \cantarell@otf@features,% + Numbers={Monospaced,OldStyle},% + NFSSFamily=\cantarell@family{TOsF}% + ]{Cantarell} + \newfontfamily{\cantarell@otf@OsF}[% + \cantarell@otf@features,% + Numbers={Proportional,OldStyle},% + NFSSFamily=\cantarell@family{OsF}% + ]{Cantarell} + + \expandafter\let\expandafter\cantarell\csname cantarell@otf@\cantarell@figurewidth@pfb\cantarell@figurestyle@pfb\endcsname + + % Legacy compatibility + \newfontfamily{\fcafamily}[% + \cantarell@otf@features,% + Numbers={Monospaced,Lining},% + NFSSFamily=fca% + ]{Cantarell} + + \ifcantarell@defaultsans + \setsansfont[% + \cantarell@otf@features,% + Numbers={\cantarell@figurewidth@otf,\cantarell@figurestyle@otf},% + ]{Cantarell} + \fi + \ifcantarell@default + \setmainfont[% + \cantarell@otf@features,% + Numbers={\cantarell@figurewidth@otf,\cantarell@figurestyle@otf},% + ]{Cantarell} + \fi +\else + \newcommand*{\cantarell}{\fontfamily{\cantarellfamily}\selectfont} + % Legacy compatibility + \newcommand*{\fcafamily}{\fontfamily{cantarell-TLF}\selectfont} + + \ifcantarell@defaultsans + \renewcommand*{\sfdefault}{\cantarellfamily} + \fi + \ifcantarell@default + \renewcommand*{\familydefault}{\cantarellfamily} + \fi +\fi \endinput |