From eeab732aae7905ef02132ea5cd0571c63a420726 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 23 Oct 2019 21:50:28 +0000 Subject: bxjatoucs (22oct19) git-svn-id: svn://tug.org/texlive/trunk@52509 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/bxjatoucs/LICENSE | 21 ++ Master/texmf-dist/doc/latex/bxjatoucs/README.md | 97 +++++++ .../fonts/tfm/public/bxjatoucs/bxjatoucs-cid.tfm | Bin 0 -> 92388 bytes .../fonts/tfm/public/bxjatoucs/bxjatoucs-jis.tfm | Bin 0 -> 31380 bytes .../texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty | 292 +++++++++++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/bxjatoucs.tlpsrc | 0 Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc | 1 + 8 files changed, 412 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/bxjatoucs/LICENSE create mode 100644 Master/texmf-dist/doc/latex/bxjatoucs/README.md create mode 100644 Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-cid.tfm create mode 100644 Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-jis.tfm create mode 100644 Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty create mode 100644 Master/tlpkg/tlpsrc/bxjatoucs.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE b/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE new file mode 100644 index 00000000000..534324b7566 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2019 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/bxjatoucs/README.md b/Master/texmf-dist/doc/latex/bxjatoucs/README.md new file mode 100644 index 00000000000..6e2c9bb7bc9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bxjatoucs/README.md @@ -0,0 +1,97 @@ +BXjatoucs Package +================= + +LaTeX: To convert Japanese character code to Unicode + +This package provides function-like (fully-expandable) macros that +convert a character code value in several Japanese encodings to +a Unicode value. Supported source encodings are: ISO-2022-JP (jis), +EUC-JP (euc), Shift_JIS (sjis) and the Adobe-Japan1 glyph set. + +### System requirement + + * TeX format: LaTeX and plain TeX. + * TeX engine: Anything that has e-TeX extension. + * Dependent packages: + - infwarerr + - ltxcmds + +### Installation + + - `*.sty` → $TEXMF/tex/latex/bxjatoucs + - `*.tfm` → $TEXMF/fonts/tfm/public/bxjatoucs + +### License + +This package is distributed under the MIT License. + + +The bxjatoucs Package ― main +----------------------------- + +### Package Loading + +In plain TeX: + + \input bxjatoucs.sty + +In LaTeX: + + \usepackage{bxjatoucs} + +### Usage + +All the macros take an argument that forms a valid number and represents +the input code value, and expands (in two steps) to the string that +represents the output Unicode scalar value in decimal. + + - `\bxjaJisToUcs{}`: converts from a jis scalar value. + - `\bxjaEucToUcs{}`: converts from an euc scalar value. + - `\bxjaSjisToUcs{}`: converts from a sjis scalar value. + - `\bxjaCidToUcs{}`: converts from an AJ1 CID value. + +There are variants that return in hexadecimal (zero-padded to at least +four digits): + + - `\bxjaJisToUcsHex{}` + - `\bxjaEucToUcsHex{}` + - `\bxjaSjisToUcsHex{}` + - `\bxjaCidToUcsHex{}` + +Note: These macros return zero (decimal `0` and hexadecimal `0000`) +if the input number is out of the valid range of source encoding. +If the input is malformed, the macros issue an error `Missing number` +and then return zero. + +Additional variants: + + - `\bxjaFastCidToUcs{}`: same as `bxjaCidToUcs`, except that + the argument is assumed to be a valid decimal string. + - `\bxjaFastCidToUcsHex{}`: same for `\bxjaCidToUcsHex`. + +## Example + +The following `\message` lines all display `23551:21496`. + + \message{\bxjaJisToUcs{"3C77}:\bxjaJisToUcs{"3B4A}} + \message{\bxjaEucToUcs{"BCF7}:\bxjaEucToUcs{"BBCA}} + \message{\bxjaSjisToUcs{"8EF5}:\bxjaSjisToUcs{"8E69}} + \message{\bxjaCidToUcs{2339}:\bxjaCidToUcs{2200}} + +The following `\message` lines all display `5BFF:53F8`. + + \message{\bxjaJisToUcsHex{"3C77}:\bxjaJisToUcsHex{"3B4A}} + \message{\bxjaEucToUcsHex{"BCF7}:\bxjaEucToUcsHex{"BBCA}} + \message{\bxjaSjisToUcsHex{"8EF5}:\bxjaSjisToUcsHex{"8E69}} + \message{\bxjaCidToUcsHex{2339}:\bxjaCidToUcsHex{2200}} + + +Revision History +---------------- + + * Version 0.2 ‹2019/10/20› + - The first public version. + +-------------------- +Takayuki YATO (aka. "ZR") +https://github.com/zr-tex8r diff --git a/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-cid.tfm b/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-cid.tfm new file mode 100644 index 00000000000..a2ff5dca2cc Binary files /dev/null and b/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-cid.tfm differ diff --git a/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-jis.tfm b/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-jis.tfm new file mode 100644 index 00000000000..1c724cd7d52 Binary files /dev/null and b/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-jis.tfm differ diff --git a/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty b/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty new file mode 100644 index 00000000000..b387872640d --- /dev/null +++ b/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty @@ -0,0 +1,292 @@ +%% +%% This is file 'bxjatoucs.sty'. +%% +%% Copyright (c) 2019 Takayuki YATO (aka. "ZR") +%% GitHub: https://github.com/zr-tex8r +%% Twitter: @zr_tex8r +%% +%% This package is distributed under the MIT License. +%% +% +%% avoid multiple loading +\csname\if11bxjatoucsLoaded\fi\endcsname +%% code guards +\edef\bxjatoucsLoaded{% +\catcode32=\the\catcode32% +\catcode34=\the\catcode34% +\catcode43=\the\catcode43% +\catcode45=\the\catcode45% +\catcode46=\the\catcode46% +\catcode47=\the\catcode47% +\catcode58=\the\catcode58% +\catcode60=\the\catcode60% +\catcode62=\the\catcode62% +\catcode63=\the\catcode63% +\catcode64=\the\catcode64% +\catcode96=\the\catcode96% +\relax} +\catcode32=10\relax +\catcode34=12 % <"> +\catcode43=12 % <+> +\catcode45=12 % <-> +\catcode46=12 % <.> +\catcode47=12 % +\catcode58=12 % <:> +\catcode60=12 % <<> +\catcode62=12 % <>> +\catcode63=12 % +\catcode64=11 % <@> +\catcode96=12 % <`> +\edef\bxju@restore@codes{\bxjatoucsLoaded + \noexpand\let\noexpand\bxju@restore@codes\relax} +\def\bxjatoucsLoaded{\endinput} + +%% check for LaTeX +\ifx\RequirePackage\@undefined %<*!LaTeX> + \let\bxju@latex=f + \long\def\bxju@next#1\ProvidesPackage#2[#3]{% + \immediate\write-1{Package: #2 #3}} + \expandafter\bxju@next +\else %<*LaTeX> + \let\bxju@latex=t +\fi % + +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{bxjatoucs}[2019/10/20 v0.2] +\def\bxju@pkgname{bxjatoucs} + +%--------------------------------------- "check-avail" + +\let\bxju@bad\@undefined +\ifx\bxjatoucsCheckAvail\@undefined\else \if t\bxju@latex + \IfFileExists{ltxcmds.sty}{}{\let\bxju@bad=t} + \IfFileExists{infwarerr.sty}{}{\let\bxju@bad=t} +\fi\fi +\ifx t\bxju@bad + \expandafter\let\csname ver@\bxju@pkgname.sty\endcsname\@undefined + \expandafter\let\csname \bxju@pkgname Loaded\endcsname\@undefined +\bxju@restore@codes\endinput\fi + +%--------------------------------------- general + +\if t\bxju@latex %-------<*LaTeX> + +%% packages +\RequirePackage{ltxcmds}[2010/12/12]% v1.15 +\RequirePackage{infwarerr}[2010/04/08]% v1.3 +%% \bxju@ifdefinable +\let\bxju@ifdefinable\@ifdefinable + +\else %-------<*!LaTeX> + +%% package +\input ltxcmds.sty +\input infwarerr.sty +%% \bxju@ifdefinable +\def\bxju@ifdefinable#1{% + \ifx#1\@undefined \expandafter\ltx@secondoftwo + \else \expandafter\ltx@firstoftwo + \fi{% + \@PackageError\bxju@pkgname + {Command \noexpand#1 already defined}{\@ehd}% + }} + +\fi %------- + +%% unique tokens +\def\bxju@end{\bxju@end@} +\let\bxju@mk\indent % unexpandable + +%% \bxju@cond\ifXXX...\fi{}{} +\ltx@gobbletwo\if\if \def\bxju@cond#1\fi{% + #1\expandafter\ltx@firstoftwo \else\expandafter\ltx@secondoftwo \fi} + +%% \bxju@cond@both\ifXXX...\fi\ifYYY...\fi{}{} +\ltx@gobblefour\if\if\if\if \def\bxju@cond@both#1\fi#2\fi{% + \bxju@cond{\if #1#2T\else F\fi\else F\fi T}\fi} + +%% \bxju@burst-`>... +\let\bxju@burst\romannumeral + +%% check engine +\ifx\numexpr\@undefined + \@PackageError\bxju@pkgname + {Not running under e-TeX}{\@ehd} +\bxju@restore@codes\endinput\fi + +%--------------------------------------- user interface + +% Each function twice-expands to the unicode codevalue. + +%%<*> \bxjaCidToUcs{} +\bxju@ifdefinable\bxjaCidToUcs{% + \def\bxjaCidToUcs{% + \bxju@burst-`>\bxju@cid@to@ucs}} +%%<*> \bxjaJisToUcs{} +\bxju@ifdefinable\bxjaJisToUcs{% + \def\bxjaJisToUcs{% + \bxju@burst-`>\bxju@jis@to@ucs}} +%%<*> \bxjaEucToUcs{} +\bxju@ifdefinable\bxjaEucToUcs{% + \def\bxjaEucToUcs{% + \bxju@burst-`>\bxju@euc@to@ucs}} +%%<*> \bxjaSjisToUcs{} +\bxju@ifdefinable\bxjaSjisToUcs{% + \def\bxjaSjisToUcs{% + \bxju@burst-`>\bxju@sjis@to@ucs}} +%%<*> \bxjaFastCidToUcs{} +\bxju@ifdefinable\bxjaFastCidToUcs{% + \def\bxjaFastCidToUcs{% + \bxju@burst-`>\bxju@fast@cid@to@ucs}} +%%<*> \bxjaFastJscToUcs{} +\bxju@ifdefinable\bxjaFastJscToUcs{% + \def\bxjaFastJscToUcs{% + \bxju@burst-`>\bxju@fast@jsc@to@ucs}} +%%<*> \bxjaCidToUcsHex{} +\bxju@ifdefinable\bxjaCidToUcsHex{% + \def\bxjaCidToUcsHex{% + \bxju@burst-`>\bxju@in@hex\bxju@cid@to@ucs}} +%%<*> \bxjaJisToUcsHex{} +\bxju@ifdefinable\bxjaJisToUcsHex{% + \def\bxjaJisToUcsHex{% + \bxju@burst-`>\bxju@in@hex\bxju@jis@to@ucs}} +%%<*> \bxjaEucToUcsHex{} +\bxju@ifdefinable\bxjaEucToUcsHex{% + \def\bxjaEucToUcsHex{% + \bxju@burst-`>\bxju@in@hex\bxju@euc@to@ucs}} +%%<*> \bxjaSjisToUcsHex{} +\bxju@ifdefinable\bxjaSjisToUcsHex{% + \def\bxjaSjisToUcsHex{% + \bxju@burst-`>\bxju@in@hex\bxju@sjis@to@ucs}} +%%<*> \bxjaFastCidToUcsHex{} +\bxju@ifdefinable\bxjaFastCidToUcsHex{% + \def\bxjaFastCidToUcsHex{% + \bxju@burst-`>\bxju@in@hex\bxju@fast@cid@to@ucs}} +%%<*> \bxjaFastJscToUcsHex{} +\bxju@ifdefinable\bxjaFastJscToUcsHex{% + \def\bxjaFastJscToUcsHex{% + \bxju@burst-`>\bxju@in@hex\bxju@fast@jsc@to@ucs}} + +%--------------------------------------- auxiliary + +%% \bxju@check@number{}\CScont +% Checks if the text is a valid number; if invalid, it causes +% "missing number" error and returns 0; if valid, returns the +% larger of 0 and the input number (in decimal). +\def\bxju@check@number#1{% + \expandafter\bxju@check@number@a\the\parshapeindent#1\bxju@mk{#1}} +\begingroup \lccode`?=`p \lowercase{\endgroup + \def\bxju@check@number@a#1?}#2#3\bxju@mk{% + \ltx@ifempty{#3}{\bxju@check@number@c}{%else + \expandafter\bxju@check@number@b\number\bxju@mk}} +\def\bxju@check@number@b#1\bxju@mk#2#3{#3{#1}} +\def\bxju@check@number@c#1{% + \expandafter\bxju@check@number@d\number#1\bxju@mk} +\def\bxju@check@number@d#1\bxju@mk#2{% + \bxju@cond\ifnum#1>\ltx@zero\fi{#2{#1}}{#2{0}}} + +%% \bxju@decomp{}\CScont +% Divides the by 256 and returns the quotient and +% the remainder as \CScont{}{}. +\def\bxju@decomp#1{% + \expandafter\bxju@decomp@a\number\dimexpr.00390625\dimexpr#1sp:#1:} +\def\bxju@decomp@a#1:#2:{% + \expandafter\bxju@decomp@b\the\numexpr#2-#1*256:#1:} +\def\bxju@decomp@b#1:#2:#3{#3{#2}{#1}} + +%% \bxju@in@hex\CSconv{} +\def\bxju@in@hex#1#2{% + \expandafter\bxju@in@hex@a\bxju@burst-`>#1{#2}:>} +\def\bxju@in@hex@a#1:>{% + \bxju@to@hex{#1}} + +%% \bxju@to@hex{} +\def\bxju@to@hex#1{% {N} + \bxju@to@hex@a#1:4::}% at least 4 digits +\def\bxju@to@hex@a#1:#2:#3:{% N:C:H:| + \bxju@cond@both\ifnum#1=\ltx@zero\fi\ifnum#2<\ltx@one\fi{#3}{%else + \expandafter\bxju@to@hex@b\number\dimexpr.0625\dimexpr#1sp% + \expandafter:\the\numexpr#2-1:#1:#3:}} +\def\bxju@to@hex@b#1:#2:#3:{% Q:C:N:|H: + \expandafter\bxju@to@hex@c\the\numexpr#3-#1*16:#2:#1:} +\def\bxju@to@hex@c#1:{% R:|C:Q:H: + \expandafter\expandafter\expandafter\bxju@to@hex@d + \csname bxju@H/#1\endcsname:} +\def\bxju@to@hex@d#1:#2:#3:#4:{% D:C:Q:H: + \bxju@to@hex@a#3:#2:#1#4:} +\begingroup + \def\do#1{\expandafter\gdef\csname bxju@H/\number"#1\endcsname{#1}} + \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9\do A\do B\do C\do D\do E\do F +\endgroup + +%--------------------------------------- conversions + +%% constants +\mathchardef\bxju@max@cid=23059 +\mathchardef\bxju@minb@jis="21 +\mathchardef\bxju@minb@euc="A1 +\mathchardef\bxju@jisrs=94 + +%% umbralist fontdefs +\font\bxju@ul@cid=bxjatoucs-cid +\font\bxju@ul@jis=bxjatoucs-jis + +%% \bxju@cid@to@ucs{} +\def\bxju@cid@to@ucs#1{% + \bxju@check@number{#1}\bxju@cid@to@ucs@a} +\def\bxju@cid@to@ucs@a#1{% + \bxju@cond\ifnum#1>\bxju@max@cid\fi{0}{% + \number\fontdimen\numexpr#1+8\bxju@ul@cid}} + +%% \bxju@jis@to@ucs{} +\def\bxju@jis@to@ucs#1{% + \bxju@check@number{#1}{\bxju@je@to@ucs\bxju@minb@jis}} +%% \bxju@euc@to@ucs{} +\def\bxju@euc@to@ucs#1{% + \bxju@check@number{#1}{\bxju@je@to@ucs\bxju@minb@euc}} +\def\bxju@je@to@ucs#1#2{% + \bxju@decomp{#2}{\bxju@je@to@ucs@a#1}} +\def\bxju@je@to@ucs@a#1#2#3{% + \expandafter\bxju@je@to@ucs@b\the\numexpr#2-#1\expandafter\bxju@mk + \the\numexpr#3-#1\bxju@mk} +\def\bxju@je@to@ucs@b#1\bxju@mk#2\bxju@mk{% + \expandafter\bxju@je@to@ucs@c\the\numexpr + (\ifnum#1<\ltx@zero -9 \else\ifnum#1<\bxju@jisrs #1 \else + -9 \fi\fi)*\bxju@jisrs+% + (\ifnum#2<\ltx@zero -9999 \else\ifnum#2<\bxju@jisrs #2 \else + -9999 \fi\fi)\bxju@mk} +\def\bxju@je@to@ucs@c#1\bxju@mk{% + \bxju@cond\ifnum#1<\ltx@zero\fi{0}{% + \number\fontdimen\numexpr#1+8\bxju@ul@jis}} + +%% \bxju@sjis@to@ucs{} +\def\bxju@sjis@to@ucs#1{% + \bxju@check@number{#1}\bxju@sjis@to@ucs@a} +\def\bxju@sjis@to@ucs@a#1{% + \bxju@decomp{#1}\bxju@sjis@to@ucs@b} +\def\bxju@sjis@to@ucs@b#1#2{% + \expandafter\bxju@sjis@to@ucs@c\the\numexpr + (\ifnum#1<129 -9 \else\ifnum#1<160 #1-129 \else + \ifnum#1<224 -9 \else\ifnum#1<240 #1-193 \else + -9 \fi\fi\fi\fi)*188+% + (\ifnum#2<64 -9999 \else\ifnum#2<127 #2-64 \else + \ifnum#2<128 -9999 \else\ifnum#2<253 #2-65 \else + -9999 \fi\fi\fi\fi)\bxju@mk} +\def\bxju@sjis@to@ucs@c#1\bxju@mk{% + \bxju@cond\ifnum#1<\ltx@zero\fi{0}{% + \number\fontdimen\numexpr#1+8\bxju@ul@jis}} + +%% \bxju@fast@cid@to@ucs{} +\def\bxju@fast@cid@to@ucs#1{% + \number\fontdimen\numexpr(#1)+8\bxju@ul@cid} +%% \bxju@fast@jsc@to@ucs{} +\def\bxju@fast@jsc@to@ucs#1{% + \number\fontdimen\numexpr(#1)+8\bxju@ul@jis} + +%--------------------------------------- all done +\let\bxju@next\@undefined +\let\bxju@ifdefinable\@undefined +\bxju@restore@codes +\endinput +%% EOF diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index f458ad74689..2e3a79aa436 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -134,7 +134,7 @@ my @TLP_working = qw( breakcites breakurl bredzenie breqn bropd brushscr bullcntr bundledoc burmese businesscard-qrcode bussproofs bussproofs-extra bxbase bxcalc bxcjkjatype bxdpx-beamer bxdvidriver bxghost - bxjaholiday bxjaprnind bxpapersize bxpdfver bxeepic bxenclose + bxjaholiday bxjaprnind bxjatoucs bxpapersize bxpdfver bxeepic bxenclose bxjalipsum bxjscls bxnewfont bxorigcapt bxtexlogo bxwareki bytefield c90 c-pascal cabin cachepic caladea calcage calctab calculation calculator calligra calligra-type1 callouts calrsfs cals calxxxx-yyyy cancel diff --git a/Master/tlpkg/tlpsrc/bxjatoucs.tlpsrc b/Master/tlpkg/tlpsrc/bxjatoucs.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc b/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc index 1d6b389ee38..5dd79c93d23 100644 --- a/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc @@ -12,6 +12,7 @@ depend bxghost depend bxjaholiday depend bxjalipsum depend bxjaprnind +depend bxjatoucs depend bxjscls depend bxorigcapt depend bxwareki -- cgit v1.2.3