From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- .../contrib/substitutefont/substitutefont.sty.html | 115 +++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 macros/latex/contrib/substitutefont/substitutefont.sty.html (limited to 'macros/latex/contrib/substitutefont/substitutefont.sty.html') diff --git a/macros/latex/contrib/substitutefont/substitutefont.sty.html b/macros/latex/contrib/substitutefont/substitutefont.sty.html new file mode 100644 index 0000000000..9d91bd89a9 --- /dev/null +++ b/macros/latex/contrib/substitutefont/substitutefont.sty.html @@ -0,0 +1,115 @@ + + + + + + +Easy font substitution + + + + + +
+

Easy font substitution

+ +
+ + +
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.

+
+
Identification
+
\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{substitutefont}
+[2012/07/07 v0.1.3 combine font families]
+
+
+
+
+

Abstract

+

Provide the \substitutefont macro for defining +substitute fonts for specified font encodings.

+
+
+
Changelog:
+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

2010-11-04

0.1

initial version

2012-04-30

0.1.1

documentation update, upload to CTAN

2012-07-05

0.1.2

documentation/example update

2012-07-07

0.1.3

bugfix (comment usage example)

2013-11-04

0.1.4

documentation update

+
+
+
+

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:
+

Palatino with the standard package mathpazo for Latin and +GFS Didot for Greek:

+
\usepackage[sc,slantedGreek]{mathpazo}
+\usepackage{substitutefont}
+\substitutefont{LGR}{\rmdefault}{udidot}
+
+
+
+
+
+

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
+
+
+
+ + -- cgit v1.2.3