diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-05 00:36:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-05 00:36:08 +0000 |
commit | 69763be32bfe1e90e08819dfc251c1fbf1d0b8a7 (patch) | |
tree | bc0f5acb0eb3f69ae1521058cc6088980a895337 /Master/texmf-dist/tex/latex | |
parent | 779adbaa19cc8f97203ea9938e435799989240b4 (diff) |
new latex package substitutefont 0.1.1 (30apr12)
git-svn-id: svn://tug.org/texlive/trunk@26199 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/substitutefont/substitutefont.sty | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/substitutefont/substitutefont.sty b/Master/texmf-dist/tex/latex/substitutefont/substitutefont.sty new file mode 100644 index 00000000000..de22a81abd0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/substitutefont/substitutefont.sty @@ -0,0 +1,73 @@ +% Easy font substitution +% ********************** +% +% :Copyright: © 2010 Günter Milde +% +% :Contributor: Special thanks to Ulrike Fischer who provided +% the indirect definition with active ``\nfss@catcodes``. +% +% :Licence: 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 any later version. +% +% :Abstract: Provide the ``\substitutefont`` macro for defining +% substitute fonts for specified font encodings. +% +% :Identification: +% :: + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{substitutefont} +[2012/04/30 v0.1.1 combine font families] + +% Changelog: +% .. class:: borderless +% +% ============ ===== ================================================= +% 2010-11-04 0.1 initial version +% 2012-04-30 0.1.1 documentation update, upload to CTAN +% ============ ===== ================================================= +% +% +% Usage +% ===== +% +% The macro ``\substitutefont{<encoding>}{<family>}{<new-family>}`` +% selects the font <new-family> as replacement for <family> if the font +% encoding is <encoding> in the variants "normal", "italic", "slanted", +% and "small-caps" and the shapes "medium", "bold", and "bold-extended". +% +% Example: +% Use the `txtt` font family from txfonts_ instead of CM for +% monospaced text (enables monospaced-bold as well as +% monospaced-italic): +% +% ``\substitutefont{T1}{txtt}{cmtt}`` +% +% +% Implementation +% ============== +% :: + +\begingroup +\nfss@catcodes +\newcommand*{\substitutefont}[3]{% + \DeclareFontFamily{#1}{#2}{} + \DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{} + \DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{} + \DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{} + \DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{} + \DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/b/n}{} + \DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/b/it}{} + \DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/b/sl}{} + \DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/b/sc}{} + \DeclareFontShape{#1}{#2}{bx}{n}{<->ssub * #3/bx/n}{} + \DeclareFontShape{#1}{#2}{bx}{it}{<->ssub * #3/bx/it}{} + \DeclareFontShape{#1}{#2}{bx}{sl}{<->ssub * #3/bx/sl}{} + \DeclareFontShape{#1}{#2}{bx}{sc}{<->ssub * #3/bx/sc}{} +} +\global\let\substitutefont\substitutefont +\endgroup + +% .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt +% .. _txfonts: http://mirror.ctan.org/help/Catalogue/entries/txfonts.html |