summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chivo/Chivo.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-07-14 20:46:37 +0000
committerKarl Berry <karl@freefriends.org>2019-07-14 20:46:37 +0000
commit5d5aeb009b9fb83051f6382f33a491f792ade98c (patch)
treee165cabecb8d3458d7e6a51e9a76263bd18a39b4 /Master/texmf-dist/tex/latex/chivo/Chivo.sty
parent416a3148be21c91890d5bdc78427d36bcee064ae (diff)
chivo (14jul19)
git-svn-id: svn://tug.org/texlive/trunk@51638 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chivo/Chivo.sty')
-rw-r--r--Master/texmf-dist/tex/latex/chivo/Chivo.sty239
1 files changed, 183 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/latex/chivo/Chivo.sty b/Master/texmf-dist/tex/latex/chivo/Chivo.sty
index bfc7b0fdbd5..4249e42570b 100644
--- a/Master/texmf-dist/tex/latex/chivo/Chivo.sty
+++ b/Master/texmf-dist/tex/latex/chivo/Chivo.sty
@@ -6,7 +6,7 @@
%%
%% Chivo.dtx (with options: `package')
%%
-%% Copyright (C) 2016 Arash Esbati <esbati'at'gmx.de>
+%% Copyright (C) 2016-2019 Arash Esbati <arash'at'gnu.org>
%%
%% This work may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License (LPPL), either version 1.3c of
@@ -17,106 +17,233 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{Chivo}
- [2016/05/05 v1.0 Support for Chivo fonts (AE)]
+ [2019/07/07 v2.0 Support for Chivo fonts (AE)]
+\RequirePackage{ifxetex}
+\RequirePackage{ifluatex}
\newif\ifChivo@otf
-\ifdefined\XeTeXinterchartoks % we are in XeTeX
+\ifxetex % we are in XeTeX
\Chivo@otftrue
\else
- \ifdefined\directlua % we are in LuaTeX
+ \ifluatex % we are in LuaTeX
\Chivo@otftrue
+ \else
+ \Chivo@otffalse
\fi
\fi
\ifChivo@otf
\RequirePackage{fontspec}
\else
\RequirePackage{mweights}
+ \RequirePackage{fontaxes}
\fi
\RequirePackage{kvoptions}
\SetupKeyvalOptions{%
family = Chivo ,
prefix = Chivo@
}
+\DeclareBoolOption{thin}
+\DeclareBoolOption{light}
\DeclareBoolOption{regular}
-\DeclareComplementaryOption{light}{regular}
+\DeclareBoolOption{medium}
\DeclareBoolOption{bold}
-\DeclareComplementaryOption{black}{bold}
+\DeclareBoolOption{extrabold}
+\DeclareBoolOption{black}
+\DeclareBoolOption{lining}
+\DeclareComplementaryOption{oldstyle}{lining}
+\DeclareBoolOption{tabular}
+\DeclareComplementaryOption{proportional}{tabular}
+\DeclareBoolOption{lf}
+\DeclareComplementaryOption{osf}{lf}
+\DeclareBoolOption{tab}
+\DeclareComplementaryOption{prop}{tab}
\ifChivo@otf
- \DeclareVoidOption{scale}{\relax}
+ \newcommand*\Chivo@otf@scale{}
+ \define@key{Chivo}{scale}[1.0]{%
+ \def\Chivo@otf@scale{#1}%
+ }
+ \define@key{Chivo}{scaled}[1.0]{%
+ \def\Chivo@otf@scale{#1}%
+ }
\else
\DeclareStringOption[1.0]{scale}
+ \define@key{Chivo}{scaled}[1.0]{%
+ \renewcommand*\Chivo@scale{#1}%
+ }
\fi
\DeclareBoolOption{familydefault}
\DeclareVoidOption{opentype}{\Chivo@otftrue}
\DeclareVoidOption{type1}{\Chivo@otffalse}
-\setkeys{Chivo}{regular,bold}
+\setkeys{Chivo}{regular,bold,lining,proportional}
\ProcessKeyvalOptions{Chivo}
-\ifChivo@otf \else
- \ifChivo@regular
+\ifChivo@lf
+ \kvsetkeys{Chivo}{lining=true}
+\else
+ \kvsetkeys{Chivo}{lining=false}
+\fi
+\ifChivo@tab
+ \kvsetkeys{Chivo}{tabular=true}
+\else
+ \kvsetkeys{Chivo}{tabular=false}
+\fi
+\newcommand*\Chivo@figurestyle{}
+\newcommand*\Chivo@figurealign{}
+\newcommand*\Chivo@otf@regular{}
+\newcommand*\Chivo@otf@italic{}
+\newcommand*\Chivo@otf@bold{}
+\newcommand*\Chivo@otf@bolditalic{}
+\ifChivo@regular
+ \ifChivo@otf
+ \def\Chivo@otf@regular{Regular}
+ \def\Chivo@otf@italic{Italic}
+ \else
\def\mdseries@sf{m}
+ \fi
+\fi
+\ifChivo@medium
+ \ifChivo@otf
+ \def\Chivo@otf@regular{Medium}
+ \def\Chivo@otf@italic{MediumItalic}
+ \else
+ \def\mdseries@sf{sb}
+ \fi
+\fi
+\ifChivo@light
+ \ifChivo@otf
+ \def\Chivo@otf@regular{Light}
+ \def\Chivo@otf@italic{LightItalic}
\else
\def\mdseries@sf{l}
\fi
\fi
-\ifChivo@otf \else
- \ifChivo@bold
+\ifChivo@thin
+ \ifChivo@otf
+ \def\Chivo@otf@regular{Thin}
+ \def\Chivo@otf@italic{ThinItalic}
+ \else
+ \def\mdseries@sf{el}
+ \fi
+\fi
+\ifChivo@bold
+ \ifChivo@otf
+ \def\Chivo@otf@bold{Bold}
+ \def\Chivo@otf@bolditalic{BoldItalic}
+ \else
\def\bfseries@sf{b}
+ \fi
+\fi
+\ifChivo@extrabold
+ \ifChivo@otf
+ \def\Chivo@otf@bold{ExtraBold}
+ \def\Chivo@otf@bolditalic{ExtraBoldItalic}
\else
- \def\bfseries@sf{k}
+ \def\bfseries@sf{eb}
\fi
\fi
-\ifChivo@otf
- \ifChivo@regular
- \ifChivo@bold
- \defaultfontfeatures[Chivo]
- {
- Extension = .otf ,
- BoldFont = Chivo-Bold ,
- ItalicFont = Chivo-Italic ,
- BoldItalicFont = Chivo-BoldItalic ,
- UprightFont = Chivo-Regular
- }
- \else
- \defaultfontfeatures[Chivo]
- {
- Extension = .otf ,
- BoldFont = Chivo-Black ,
- ItalicFont = Chivo-Italic ,
- BoldItalicFont = Chivo-BlackItalic ,
- UprightFont = Chivo-Regular
- }
- \fi
+\ifChivo@black
+ \ifChivo@otf
+ \def\Chivo@otf@bold{Black}
+ \def\Chivo@otf@bolditalic{BlackItalic}
\else
- \ifChivo@bold
- \defaultfontfeatures[Chivo]
- {
- Extension = .otf ,
- BoldFont = Chivo-Bold ,
- ItalicFont = Chivo-LightItalic ,
- BoldItalicFont = Chivo-BoldItalic ,
- UprightFont = Chivo-Light
- }
- \else
- \defaultfontfeatures[Chivo]
- {
- Extension = .otf ,
- BoldFont = Chivo-Black ,
- ItalicFont = Chivo-LightItalic ,
- BoldItalicFont = Chivo-BlackItalic ,
- UprightFont = Chivo-Light
- }
- \fi
+ \def\bfseries@sf{ub}
+ \fi
+\fi
+\ifChivo@lining
+ \ifChivo@otf
+ \def\Chivo@figurestyle{Lining}
+ \else
+ \def\Chivo@figurestyle{LF}
+ \fi
+\else
+ \ifChivo@otf
+ \def\Chivo@figurestyle{OldStyle}
+ \else
+ \def\Chivo@figurestyle{OsF}
+ \fi
+\fi
+\ifChivo@tabular
+ \ifChivo@otf
+ \def\Chivo@figurealign{Monospaced}
+ \else
+ \def\Chivo@figurealign{T}
+ \fi
+\else
+ \ifChivo@otf
+ \def\Chivo@figurealign{Proportional}
+ \else
+ \def\Chivo@figurealign{}
\fi
\fi
+\ifChivo@otf \else
+ \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
+ \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
+ \def\sufigures{\@nomath\sufigures
+ \fontfigurestyle{superior}\selectfont}
+ \DeclareTextFontCommand{\textsu}{\sufigures}
+ \let\textsuperior\textsu
+
+ \fa@naming@exception{figures}{{inferior}{proportional}}{Inf}
+ \fa@naming@exception{figures}{{inferior}{tabular}}{Inf}
+ \def\infigures{\@nomath\infigures
+ \fontfigurestyle{inferior}\selectfont}
+ \DeclareTextFontCommand{\textin}{\infigures}
+ \let\textinferior\textin
+
+ \fa@naming@exception{figures}{{numerators}{proportional}}{Numr}
+ \fa@naming@exception{figures}{{numerators}{tabular}}{Numr}
+ \def\nufigures{\@nomath\nufigures
+ \fontfigurestyle{numerators}\selectfont}
+ \DeclareTextFontCommand{\textnu}{\nufigures}
+ \let\textnumerator\textnu
+
+ \fa@naming@exception{figures}{{denominators}{proportional}}{Dnom}
+ \fa@naming@exception{figures}{{denominators}{tabular}}{Dnom}
+ \def\defigures{\@nomath\defigures
+ \fontfigurestyle{denominators}\selectfont}
+ \DeclareTextFontCommand{\textde}{\defigures}
+ \let\textdenominator\textde
+\fi
+\ifChivo@otf
+ \defaultfontfeatures[Chivo]{%
+ Extension = .otf ,
+ Ligatures = {TeX,Common} ,
+ Scale = \Chivo@otf@scale ,
+ UprightFont = *-\Chivo@otf@regular ,
+ ItalicFont = *-\Chivo@otf@italic ,
+ BoldFont = *-\Chivo@otf@bold ,
+ BoldItalicFont = *-\Chivo@otf@bolditalic ,
+ FontFace = {el}{n}{*-Thin} ,
+ FontFace = {el}{it}{*-ThinItalic} ,
+ FontFace = {l}{n}{*-Light} ,
+ FontFace = {l}{it}{*-LightItalic} ,
+ FontFace = {m}{n}{*-Regular} ,
+ FontFace = {m}{it}{*-Italic} ,
+ FontFace = {sb}{n}{*-Medium} ,
+ FontFace = {sb}{it}{*-MediumItalic} ,
+ FontFace = {b}{n}{*-Bold} ,
+ FontFace = {b}{it}{*-BoldItalic} ,
+ FontFace = {eb}{n}{*-ExtraBold} ,
+ FontFace = {eb}{it}{*-ExtraBoldItalic} ,
+ FontFace = {ub}{n}{*-Black} ,
+ FontFace = {ub}{it}{*-BlackItalic} ,
+ Numbers = {\Chivo@figurestyle,\Chivo@figurealign}
+ }
+\fi
\ifChivo@otf
\AtBeginDocument{%
\setsansfont{Chivo}%
}
\else
- \renewcommand*{\sfdefault}{Chivo-TLF}
+ \renewcommand*\sfdefault{%
+ Chivo-\Chivo@figurealign\Chivo@figurestyle
+ }
\fi
\ifChivo@familydefault
- \renewcommand*{\familydefault}{\sfdefault}
- \ifChivo@otf\else
+ \ifChivo@otf
+ \AtBeginDocument{%
+ \setmainfont{Chivo}%
+ }
+ \else
+ \renewcommand*\familydefault{\sfdefault}
\ifChivo@regular \else
\edef\seriesdefault{\mdseries@sf}
\fi