summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-02 21:57:03 +0000
committerKarl Berry <karl@freefriends.org>2016-04-02 21:57:03 +0000
commite7c53ffe91c790d8bba061aae7fe59e7475fa4f6 (patch)
treef3a6d4524f2ddac87ce3ad5950dd0a8a27928f50 /Master
parentdddb3ce03f2d2bde094879b3ed56d17d0c7b871d (diff)
bxnewfont (2apr16)
git-svn-id: svn://tug.org/texlive/trunk@40214 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/bxnewfont/LICENSE27
-rw-r--r--Master/texmf-dist/doc/latex/bxnewfont/README.md78
-rw-r--r--Master/texmf-dist/tex/latex/bxnewfont/bxnewfont.sty373
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/tlpsrc/bxnewfont.tlpsrc0
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
6 files changed, 480 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/bxnewfont/LICENSE b/Master/texmf-dist/doc/latex/bxnewfont/LICENSE
new file mode 100644
index 00000000000..49f803e083e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/bxnewfont/LICENSE
@@ -0,0 +1,27 @@
+$BK\%=%U%H%&%'%"$O(B MIT $B%i%$%;%s%9$N2<$GG[I[$5$l$^$9!#(B
+$BCx:n8"$O:n<T$G$"$k!VH,EP(B $B?rG7!JJLL>(B ZR$B!K!W$KB0$7$^$9!#(B
+$B$^$?K\%=%U%H%&%'%"$OL5J]>Z$G$9!#(B
+
+This software is distributed under the MIT License.
+
+The MIT License
+
+Copyright (c) 2016 Takayuki YATO (aka. "ZR")
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Master/texmf-dist/doc/latex/bxnewfont/README.md b/Master/texmf-dist/doc/latex/bxnewfont/README.md
new file mode 100644
index 00000000000..6ac295babd5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/bxnewfont/README.md
@@ -0,0 +1,78 @@
+BXnewfont Package
+=================
+
+LaTeX: Enhanced `\newfont` command
+
+This package provides a new command `\newfontx`. It is similar to
+the old (and deprecated) command `\newfont` in function, but is more
+compatible with NFSS. In particular, one can safely change font size
+after invoking a font command defined by `\newfontx`. The new command
+will be useful to users who know much of the old '\newfont` command
+but are unfamiliar with the detail of NFSS.
+
+### System requirement
+
+ * TeX format: LaTeX.
+ * TeX engine: Anything.
+ * Dependent packages: None.
+
+### Installation
+
+ - `*.sty` → $TEXMF/tex/latex/BXnewfont
+
+### License
+
+This package is distributed under the MIT License.
+
+The bxnewfont Package
+---------------------
+
+### Package Loading
+
+ \usepackage[<option>]{bxdvidriver}
+
+Available options:
+
+ * `newfont`: Makes `\newfont` an alias of `newfontx`.
+
+### Usage
+
+ * `\newfontx\CMD[<encoding>]{<tfm-name><at-clause>}`: Defines `\CMD`
+ to be a “font command” (pseudo-fontdef token). Here the format
+ of the mandatory argument is exactly same as that of `\newfont`
+ (`<at-clause>` can be empty). The optional argument specifies the
+ NFSS encoding name (such as `T1`) of the TFM to be used, and
+ defaults to the current font encoding. (If you don’t know what
+ it means, then you probably need not care about this argument.)
+
+ When the defined `\CMD` command is invoked, the current font will
+ changes to what is specified by the argument, just as the original
+ `\newfont`. But unlike `\newfont`, it does not break consistency
+ of LaTeX NFSS. Specifically, NFSS is set at the following state:
+
+ - The family is what was auto-generated for `\CMD`.
+ - The series is `m` and the shape is `n`.
+ - The encoding and size are what was specified by the arguments
+ of `\newfontx`.
+
+ It means that further use of “LaTeX’s font commands” will
+ probably result in what you will expect. In particular, font size
+ can be safely changed. The use of `\itshape` has no effect ---
+ of course, because LaTeX does not know the TFM name of the italic
+ counterpart --- and no unfavorable effect either.
+
+ * `\newfontx*\CMD[<encoding>]{<tfm-name>}`: Same as the `\newfontx`,
+ except that “font commands” defined by `\newfontx*` does not
+ fix font size (note the absence of `<at-clause>`). Namely, invoking
+ `\CMD` does not change the current font size. This variant surely
+ diverges from the original `\newfont`, but will be more useful.
+
+Revision History
+----------------
+
+ * Version 0.2 ‹2016/03/27›
+ - The first public version.
+
+--------------------
+Takayuki YATO (aka. "ZR")
+http://zrbabbler.sp.land.to/
diff --git a/Master/texmf-dist/tex/latex/bxnewfont/bxnewfont.sty b/Master/texmf-dist/tex/latex/bxnewfont/bxnewfont.sty
new file mode 100644
index 00000000000..e3127c9f5a1
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/bxnewfont/bxnewfont.sty
@@ -0,0 +1,373 @@
+% bxnewfont.sty
+
+%% package declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bxnewfont}[2016/03/27 v0.2]
+
+%% preparation
+\def\bxnf@pkgname{bxnewfont}
+\def\bxnf@error{\PackageError\bxnf@pkgname}
+\providecommand\bxDebug[1]{}
+
+%--------------------------------------- options
+
+%% variables
+\newif\ifbxnf@newfont
+
+%% options
+\DeclareOption{newfont}{%
+ \bxnf@newfonttrue
+}
+\ProcessOptions\relax
+
+%--------------------------------------- general
+
+%% load packages
+\RequirePackage{etoolbox}
+\ifx\newrobustcmd\@undefined % non-e-TeX
+\expandafter\endinput\fi\relax
+
+%% unique tokens
+\def\bxnf@mk{\bxnf@mk@}
+\def\bxnf@end{\bxnf@end@}
+
+%% variables
+\newbool{bxnf@ok}
+
+%% \bxnf@cond\if...\fi{<true>}{<false>}
+\@gobbletwo\if\if \def\bxnf@cond#1\fi{%
+ #1\expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo \fi
+}
+
+%% \ifbxnf@ptex : engine is pTeX?
+\newbool{bxnf@ptex}
+\begingroup
+ \edef\bxnf@tmpa{\string\tfont}\edef\bxnf@tmpb{\meaning\tfont}
+ \ifx\bxnf@tmpa\bxnf@tmpb \global\bxnf@ptextrue \fi
+\endgroup
+
+%--------------------------------------- main
+
+%% variables
+\newbool{bxnf@fixed} % fixed size?
+\let\bxnf@font\relax % font-spec string
+\let\bxnf@tfm\relax % tfm name
+\let\bxnf@atcl\relax % at-clause
+\let\bxnf@enc\relax % encoding
+\let\bxnf@fam\relax % family
+\let\bxnf@type\relax % 1=normal,2=pTeX-yoko,3=pTeX-tate
+\let\bxnf@size\relax
+
+%%<*> \newfontx*[<encoding>]{<tfm-spec>}
+\newcommand\newfontx{%
+ \@ifstar{%
+ \bxnf@fixedfalse
+ \bxnf@newfontx@a
+ }{%else
+ \bxnf@fixedtrue
+ \bxnf@newfontx@a
+ }%
+}
+\def\bxnf@newfontx@a#1{%
+ \@ifnextchar[{%
+ \bxnf@newfontx@b{#1}%
+ }{%else
+ \bxnf@newfontx@b{#1}[]%
+ }%]
+}
+\def\bxnf@newfontx@b#1[#2]#3{%
+ \edef\bxnf@enc{#2}%
+ \edef\bxnf@font{#3}%
+ \bxnf@split@name
+ \bxnf@check@param
+ \ifbxnf@ok \bxnf@declare \fi
+ \ifbxnf@ok \bxnf@make@cmd#1\fi
+}
+
+%% \bxnf@split@name
+% Parses \bxnf@font and sets \bxnf@tfm and \bxnf@atcl.
+\def\bxnf@next#1{%
+ \def\bxnf@split@name{%
+ \expandafter\bxnf@split@name@a\bxnf@font\bxnf@mk#1\bxnf@end
+ }%
+ \def\bxnf@split@name@a##1#1##2\bxnf@end{%
+ \ifstrempty{##2}{%
+ \let\bxnf@tfm\bxnf@font \let\bxnf@atcl\relax
+ }{%else
+ \def\bxnf@tfm{##1}%
+ \bxnf@split@name@b##2\bxnf@end
+ }%
+ }%
+ \def\bxnf@split@name@b##1\bxnf@mk##2\bxnf@end{%
+ \def\bxnf@atcl{##1}%
+ }%
+}
+\bxnf@next{ }
+
+%% \bxnf@check@param
+% Sets bxnf@ok.
+\def\bxnf@check@param{%
+ \bxnf@oktrue
+ \bxnf@get@tfm@info
+ \unless\ifdim\bxnf@size>\z@
+ \chardef\bxnf@type\z@
+ \fi
+ \ifnum\bxnf@type=\z@
+ \bxnf@error{Failed in getting TFM info}\@eha
+ \bxnf@okfalse
+ \else
+ \ifx\bxnf@enc\@empty
+ % resolve encoding when unspecified
+ \ifcase\bxnf@type\or
+ \let\bxnf@enc\cf@encoding
+ \or % pTeX-yoko
+ \let\bxnf@enc\cy@encoding
+ \or % pTeX-tate
+ \let\bxnf@enc\ct@encoding
+ \fi
+ \fi
+ \fi
+ \ifcsundef{T@\bxnf@enc}{%
+ \bxnf@error{Unknown encoding '\bxnf@enc'}\@ehc
+ \bxnf@okfalse
+ }{}%
+ \ifbxnf@ok
+ \bxDebug{type=\number\bxnf@type; enc=\bxnf@enc}%
+ \fi
+ \unless\ifbxnf@fixed \unless\ifx\bxnf@atcl\relax
+ \bxnf@error{You cannot use size spec here}{%
+ The invalid size spec (\bxnf@atcl) is ignored.%
+ \MeesageBreak\@ehc}%
+ \fi\fi
+}
+
+%% \bxnf@declare
+\def\bxnf@declare{%
+ \bxnf@get@family@name
+ \unless\ifbxnf@ok
+ \bxnf@set@family@param
+ \bxnf@declare@family
+ \fi
+ \bxnf@oktrue
+}
+
+%% \bxnf@make@cmd\CS
+% Defines \CS to be a protected macro that selects the family
+% which name equals (the current value of) \bxnf@fam.
+% A wierdly-named control sequence is used in the macro body
+% so that \show'ing \CS will display something like:
+% > \CS=\protected macro:
+% \select font FAMILY(ID) .
+\def\bxnf@make@cmd#1{%
+ \expandafter\bxnf@make@cmd@a\bxnf@fam\bxnf@mk#1%
+}
+\begingroup
+\catcode`\ =11\relax\catcode`\_=10\relax
+\gdef\bxnf@make@cmd@a#1\bxnf@mk#2{%
+__\newrobustcmd*#2{\select font#1 }}%
+\endgroup
+
+%% \select_font<family>_
+% (Here '_' means a space with catcode 11.)
+\begingroup
+\catcode`\ =11\relax\catcode`\_=10\relax
+\gdef\select font#1 {%
+__\bxnf@select@family{#1}}%
+\endgroup
+
+%--------------------------------------- Family name
+
+%% variables
+%\[bxnf@varid/<tfm>] % maximum used id number
+%\[bxnf@prm/<family>] % font parameter ({<enc>}{<size>})
+%\[bxnf@pc/<spec>] % cache
+
+%% \bxnf@get@family@name
+% Generates a family name and returns to \bxnf@fam.
+% The name is of the form "<tfm-name>(<id>)".
+\def\bxnf@get@family@name{%
+ \def\bxnf@tmpa{bxnf@pc/\bxnf@enc:\bxnf@tfm:%
+ \ifbxnf@fixed \the\dimexpr\bxnf@size\relax \fi}%
+ \letcs\bxnf@fam{\bxnf@tmpa}%
+ \ifdef\bxnf@fam{%
+ \bxDebug{\bxnf@tmpa==\bxnf@fam}%
+ \bxnf@oktrue
+ }{%else
+ \csnumdef{bxnf@varid/\bxnf@tfm}{\csuse{bxnf@varid/\bxnf@tfm}+1}%
+ \edef\bxnf@fam{\bxnf@tfm(\csuse{bxnf@varid/\bxnf@tfm})}%
+ \cslet{\bxnf@tmpa}\bxnf@fam
+ \bxDebug{\bxnf@tmpa:=\bxnf@fam}%
+ \bxnf@okfalse
+ }%
+}
+
+%% \def\bxnf@set@family@param
+% Sets \[bxnf@prm/*].
+\def\bxnf@set@family@param{%
+ \csedef{bxnf@prm/\bxnf@fam}{{\bxnf@enc}%
+ {\ifbxnf@fixed \expandafter\rem@pt\bxnf@size \fi}}%
+ \bxDebug{bxnf@prm/\bxnf@fam:=\csuse{bxnf@prm/\bxnf@fam}}%
+}
+
+%% \bxnf@declare@family
+\def\bxnf@declare@family{%
+ \DeclareFontFamily{\bxnf@enc}{\bxnf@fam}{}%
+ \DeclareFontShape{\bxnf@enc}{\bxnf@fam}{m}{n}%
+ {<->\bxnf@tfm}{}%
+ % In pTeX, a dummy entry must be declared for the
+ % encoding counterpart.
+ \let\bxnf@tmpb\relax
+ \ifcase\bxnf@type\or % no-op for normal
+ \or \letcs\bxnf@tmpb{t@enc@\bxnf@enc}% yoko->tate
+ \or \letcs\bxnf@tmpb{y@enc@\bxnf@enc}% tate->yoko
+ \fi
+ \unless\ifx\bxnf@tmpb\relax
+ \DeclareFontFamily{\bxnf@tmpb}{\bxnf@fam}{}%
+ \DeclareFontShape{\bxnf@tmpb}{\bxnf@fam}{m}{n}%
+ {<->ssub*\kanjifamilydefault/m/n}{}%
+ \fi
+}
+
+%% \bxnf@select@family{<family>}
+\def\bxnf@select@family#1{%
+ \edef\bxnf@next{\noexpand\bxnf@select@family@a
+ {#1}\csuse{bxnf@prm/#1}}%
+ \bxnf@next
+}
+\def\bxnf@select@family@a#1#2#3{%
+ \bxDebug{select=#2/#1/m/n/#3}%
+ \usefont{#2}{#1}{m}{n}\relax
+ \ifstrempty{#3}{}{%else
+ \fontsize{#3}{#3}\selectfont
+ }%
+}
+
+%--------------------------------------- Inquery on TFM
+
+%% variables
+\let\bxnf@type\relax
+\let\bxnf@size\relax
+
+%% \bxnf@get@tfm@info
+\def\bxnf@get@tfm@info{%
+ \begingroup
+ \chardef\bxnf@type=0 \let\bxnf@size\@empty
+ \font\bxnf@tmpa=\bxnf@tfm\space scaled 2000\relax
+ \ifx\bxnf@tmpa\nullfont\else
+ \bxnf@get@tfm@info@a
+ \bxnf@get@tfm@info@b
+ \fi
+ \xdef\bxnf@g@tmpa{%
+ \chardef\bxnf@type=\number\bxnf@type\relax
+ \def\noexpand\bxnf@size{\bxnf@size}}%
+ \endgroup
+ \bxnf@g@tmpa
+ \bxDebug{tfm=\number\bxnf@type/\bxnf@size}%
+}
+\def\bxnf@get@tfm@info@a{%
+ \bxnf@tmpa
+ \bxnf@curr@font\bxnf@g@tmpa\font
+ \chardef\bxnf@type=1 \let\bxnf@xfont\font
+}
+\def\bxnf@get@tfm@info@b{%
+ \unless\ifnum\bxnf@type=0
+ \expandafter\bxnf@read@at\bxnf@g@tmpa\bxnf@end
+ \ifx\bxnf@size\relax \let\bxnf@size\z@ \fi
+ \dimdef\bxnf@size{\bxnf@size/2}%
+ \bxDebug{tfm1=\number\bxnf@type/\bxnf@size}%
+ \unless\ifx\bxnf@atcl\relax
+ \let\bxnf@tmpb\bxnf@size
+ \bxnf@xfont\bxnf@tmpa=\bxnf@tfm\space\bxnf@atcl\relax
+ \bxnf@tmpa
+ \bxnf@curr@font\bxnf@g@tmpa\bxnf@xfont
+ \expandafter\bxnf@read@at\bxnf@g@tmpa\bxnf@end
+ \ifx\bxnf@size\relax \let\bxnf@size\bxnf@tmpb \fi
+ \fi
+ \fi
+}
+
+%% \bxnf@read@at<text>\bxnf@end
+\begingroup
+ \catcode`\A=12 \catcode`\T=12
+ \lowercase{%
+ \gdef\bxnf@read@at#1\bxnf@end{%
+ \bxnf@read@at@a#1\bxnf@mk AT \bxnf@mk\bxnf@end
+ }%
+ \gdef\bxnf@read@at@a#1AT #2\bxnf@mk#3\bxnf@end{%
+ \ifstrempty{#2}{%
+ \let\bxnf@size\relax
+ }{%else
+ \def\bxnf@size{#2}%
+ }%
+ }%
+ }
+\endgroup
+
+%% \bxnf@curr@font\CS\Xfont
+\def\bxnf@curr@font#1#2{%
+ \xdef#1{\expandafter\meaning\the#2}%
+}
+
+\ifbxnf@ptex %----<*pTeX>
+
+%% revision to \bxnf@get@tfm@info
+\def\bxnf@get@tfm@info@a{%
+ \bxnf@get@tfm@info@init
+ \nullfont \bxnf@jnullfont \bxnf@tnullfont
+ \bxnf@tmpa
+ \bxnf@curr@font\bxnf@g@tmpa\font
+ \unless\ifx\bxnf@g@tmpa\bxnf@dsf@null
+ \chardef\bxnf@type=1 \let\bxnf@xfont\font
+ \else
+ \bxnf@curr@font\bxnf@g@tmpa\jfont
+ \unless\ifx\bxnf@g@tmpa\bxnf@dsf@jnull
+ \chardef\bxnf@type=2 \let\bxnf@xfont\jfont
+ \else
+ \bxnf@curr@font\bxnf@g@tmpa\tfont
+ \unless\ifx\bxnf@g@tmpa\bxnf@dsf@tnull
+ \chardef\bxnf@type=3 \let\bxnf@xfont\tfont
+ \fi
+ \fi
+ \fi
+}
+\def\bxnf@get@tfm@info@init{%
+ \bxDebug{\string\bxnf@get@tfm@info@init}%
+ \begingroup
+ \global\jfont\bxnf@jnullfont=rml\relax
+ \global\tfont\bxnf@tnullfont=rmlv\relax
+ \nullfont \bxnf@jnullfont \bxnf@tnullfont
+ \bxnf@curr@font\bxnf@dsf@null\font
+ \bxnf@curr@font\bxnf@dsf@jnull\jfont
+ \bxnf@curr@font\bxnf@dsf@tnull\tfont
+ \endgroup
+ \bxDebug{null=\bxnf@dsf@null}%
+ \bxDebug{jnull=\bxnf@dsf@jnull}%
+ \bxDebug{tnull=\bxnf@dsf@tnull}%
+ \global\let\bxnf@get@tfm@info@init\relax
+}
+
+\fi %----</pTeX>
+
+%--------------------------------------- Switching of \newfont
+
+%% \bxnf@ltx@newfont
+% The original.
+\let\bxnf@ltx@newfont\newfont
+
+%%<*>\enhancenewfont
+\newcommand*\enhancenewfont{%
+ \let\newfont\newfontx}
+
+%%<*>\noenhancenewfont
+\newcommand*\noenhancenewfont{%
+ \let\newfont\bxnf@ltx@newfont}
+
+%% initial
+\ifbxnf@newfont
+ \enhancenewfont
+\fi
+
+%--------------------------------------- all done
+\endinput
+%% EOF
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 895c38b7fd8..6d386c2079b 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -113,7 +113,7 @@ my @TLP_working = qw(
breakcites breakurl breqn bropd brushscr
bullcntr bundledoc burmese bussproofs
bxbase bxcjkjatype bxdpx-beamer bxdvidriver
- bxpapersize bxpdfver bxeepic bxenclose bxjscls bytefield
+ bxpapersize bxpdfver bxeepic bxenclose bxjscls bxnewfont bytefield
c90 c-pascal cabin cachepic caladea calcage calctab calculation calculator
calligra calligra-type1 calrsfs cals calxxxx-yyyy cancel
canoniclayout cantarell
diff --git a/Master/tlpkg/tlpsrc/bxnewfont.tlpsrc b/Master/tlpkg/tlpsrc/bxnewfont.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/bxnewfont.tlpsrc
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index d255f42c0c9..8098325e1d0 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -100,6 +100,7 @@ depend bussproofs
depend bxdpx-beamer
depend bxdvidriver
depend bxenclose
+depend bxnewfont
depend bxpapersize
depend bxpdfver
depend calcage