diff options
author | Karl Berry <karl@freefriends.org> | 2013-11-03 23:50:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-11-03 23:50:26 +0000 |
commit | ae8d79bea3ee120c9735424380e2983af5f3bf4f (patch) | |
tree | a6a8dfba9255534962fca9c48317925c3316a424 /Master/texmf-dist/tex/latex/xcharter/XCharter.sty | |
parent | 47e8672bf0b15bc52f7579525cafbf76f3e05cbd (diff) |
xcharter
git-svn-id: svn://tug.org/texlive/trunk@32055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xcharter/XCharter.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/xcharter/XCharter.sty | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/xcharter/XCharter.sty b/Master/texmf-dist/tex/latex/xcharter/XCharter.sty new file mode 100644 index 00000000000..9ae032c2f90 --- /dev/null +++ b/Master/texmf-dist/tex/latex/xcharter/XCharter.sty @@ -0,0 +1,110 @@ +%% XCharter is an extension of the Bitstream Charter fonts, adding osf, +% small caps and superior figures. Generated 2013/10/27 by Michael Sharpe. +%% +\NeedsTeXFormat{LaTeX2e} + +\def\fileversion{1.00} +\def\filedate{2013/10/27} + +\ProvidesPackage{XCharter}[\filedate\space v\fileversion] + +\message{`XCharter' v\fileversion, \filedate\space Text macros for XCharter, an extension of Charter (msharpe)} + +\RequirePackage[LY1,T1]{fontenc} +\RequirePackage{textcomp} +\IfFileExists{mweights.sty}{\RequirePackage{mweights}}{} +\IfFileExists{fontaxes.sty}{ + \RequirePackage{fontaxes} + \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 +}{} +\DeclareRobustCommand{\lfstyle}{% + \not@math@alphabet\lfstyle\relax + \fontfamily{XCharter-TLF}\selectfont } +\DeclareRobustCommand{\osfstyle}{% + \not@math@alphabet\osfstyle\relax + \fontfamily{XCharter-OsF}\selectfont } +\def\textlf#1{{\lfstyle #1}} +%\def\textosf#1{{\osfstyle #1}} + +\newcommand*{\XCharter@scale}{1} +\IfFileExists{xkeyval.sty}{ + \RequirePackage{xkeyval} + \DeclareOptionX{scale}{\renewcommand*{\XCharter@scale}{##1}} + \DeclareOptionX{scaled}{\renewcommand*{\XCharter@scale}{##1}} +}{ + \let\DeclareOptionX\DeclareOption + \let\ExecuteOptionsX\ExecuteOptions + \let\ProcessOptionsX\ProcessOptions +} +\let\orig@footnote=\thefootnote +\let\orig@makefnmark=\@makefnmark + +\def\XCharter@altone{x}% default is to use 1, not I +\newif\if@XCh@sups +\DeclareOptionX{lf}{\edef\XCharter@figurestyle{TLF}} +\DeclareOptionX{lining}{\edef\XCharter@figurestyle{TLF}} +\DeclareOptionX{oldstyle}{\edef\XCharter@figurestyle{OsF}% +\edef\XCharter@altone{x}} +\DeclareOptionX{oldstyleI}{\edef\XCharter@figurestyle{OsF}% +\edef\XCharter@altone{}} +\DeclareOptionX{osf}{\edef\XCharter@figurestyle{OsF}\edef\XCharter@altone{x}} +\DeclareOptionX{osfI}{\edef\XCharter@figurestyle{OsF}\edef\XCharter@altone{}} +\DeclareOptionX{sups}{\@XCh@supstrue} + +\edef\bfseries@rm{b} +\edef\mdseries@rm{m} +\ExecuteOptionsX{lining} +\ProcessOptionsX\relax + +\def\useosf{\renewcommand*{\rmdefault}{XCharter-OsF}\def\XCharter@altone{x}} +\def\useosfI{\renewcommand*{\rmdefault}{XCharter-OsF}\def\XCharter@altone{}} +\@onlypreamble\useosf +\@onlypreamble\useosfI + +\newcommand{\textosfI}[1]{\oldstylenums{#1}}% to get XCharter osfI +\newcommand{\textosf}[1]{{\fontencoding{T1}\fontfamily{XCharterx}\selectfont #1}}% to get XCharter osf +\renewcommand*{\bfdefault}{b} +\renewcommand*{\scdefault}{sc}% for better compatibility with mathdesign + +% The following are provided so that we may access osf in any mode +% osfx corresponds to small 1 rather than small I +\DeclareFontFamily{T1}{XCharterx}{} + +\DeclareFontShape{T1}{XCharterx}{m}{n}{ + <-> s*[\XCharter@scale] XCharter-Roman-osfx-t1 +}{} +\DeclareFontShape{T1}{XCharterx}{m}{it}{ + <-> s*[\XCharter@scale] XCharter-Italic-osfx-t1 +}{} +\DeclareFontShape{T1}{XCharterx}{b}{n}{ + <-> s*[\XCharter@scale] XCharter-Bold-osfx-t1 +}{} +\DeclareFontShape{T1}{XCharterx}{b}{it}{ + <-> s*[\XCharter@scale] XCharter-BoldItalic-osfx-t1 +}{} + + +\renewcommand*{\rmdefault}{XCharter-\XCharter@figurestyle} +\renewcommand*{\familydefault}{\rmdefault} +\if@XCh@sups % + \ifdefined\sufigures + \def\f@@tn@te{footnote} + \def\@makefnmark{% + \ifx\@mpfn\f@@tn@te% + \ifx\thefootnote\orig@footnote% + \hbox{\sufigures\hspace*{.04em}\@thefnmark} + \else% + \orig@makefnmark + \fi + \else% + \orig@makefnmark + \fi}% + \fi +\fi + +\endinput |