From 2af867c2acf30d24b46d3adbc6913d39c53e2eb0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 2 Sep 2016 00:05:07 +0000 Subject: addfont (1sep16) git-svn-id: svn://tug.org/texlive/trunk@41972 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/addfont/addfont.sty | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/addfont/addfont.sty (limited to 'Master/texmf-dist/tex/latex/addfont') diff --git a/Master/texmf-dist/tex/latex/addfont/addfont.sty b/Master/texmf-dist/tex/latex/addfont/addfont.sty new file mode 100644 index 00000000000..7b25c71c694 --- /dev/null +++ b/Master/texmf-dist/tex/latex/addfont/addfont.sty @@ -0,0 +1,59 @@ +% Copyright 2016 (c) Palle Joergensen +% +% This file is part of addfont. +% +% addfont is free software: you can redistribute it and/or modify it +% under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% addfont is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with addfont. If not, see . +\ProvidesPackage{addfont}% + [2016/09/01 v1.0 Easier usage of fonts without LaTeX support.] +\newif\ifaddfont@fixed +\addfont@fixedtrue +\RequirePackage{twoopt} +\RequirePackage{ifthen} +\newcommandtwoopt*\addfont@all[5][][]{% scale, sel-cmd, enc, font, cmd + \addfont@fixedfalse + \def\addfont@latestencoding{#3}% + \def\addfont@latestfamily{#4}% + \ifthenelse{\equal{#1}{\@empty}}{\let\addfont@latestscale\@empty}{\def\addfont@latestscale{s*[#1]}} + \DeclareFontFamily{#3}{#4}{#2}% + \DeclareFontShape{#3}{#4}{m}{n}{<->#3}{}% + \def#5{\fontencoding{#3}\fontfamily{#4}\mdseries\upshape}} + +\newcommandtwoopt*\addfont@fixed[5][][]{% scale, sel-cmd, enc, font, cmd + \addfont@fixedtrue + \def\addfont@latestencoding{#3}% + \def\addfont@latestfamily{#4}% + \ifthenelse{\equal{#1}{\@empty}}{\let\addfont@latestscale\@empty}{\def\addfont@latestscale{s*[#1]}} + \DeclareFontFamily{#3}{#4}{#2}% + \DeclareFontShape{#3}{#4}{m}{n}{% + <5><6><7><8><9><10><10.95><12>% + <14.4><17.28><20.74><24.88>\addfont@latestscale #4}{}% + \def#5{\fontencoding{#3}\fontfamily{#4}\mdseries\upshape}} + +\newcommand*\addfont@addshape@fixed[4]{% series, shape, font, sel-cmd + \DeclareFontShape{\addfont@latestencoding}{\addfont@latestfamily}{#1}{#2}{% + <5><6><7><8><9><10><10.95><12>% + <14.4><17.28><20.74><24.88>\addfont@latestscale #3}{#4}} + +\newcommand*\addfont@addshape@all[4]{% series, shape, font, sel-cmd + \DeclareFontShape{\addfont@latestencoding}{\addfont@latestfamily}{#1}{#2}{% + <->\addfont@latestscale #3}{#4}} + +\def\addfont{\@ifstar{\addfont@all}{\addfont@fixed}} +\newcommand*\addshape[4][]{% + \ifaddfont@fixed% + \addfont@addshape@fixed{#2}{#3}{#4}{#1}% + \else% + \addfont@addshape@all{#2}{#3}{#4}{#1}% + \fi} +\endinput \ No newline at end of file -- cgit v1.2.3