diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/bxjatoucs/LICENSE | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/bxjatoucs/README.md | 14 | ||||
-rw-r--r-- | Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm | bin | 0 -> 94324 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty | 80 |
4 files changed, 93 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE b/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE index 534324b7566..aff6b30c936 100644 --- a/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE +++ b/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2019 Takayuki YATO (aka. "ZR") +Copyright (c) 2019-2024 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 diff --git a/Master/texmf-dist/doc/latex/bxjatoucs/README.md b/Master/texmf-dist/doc/latex/bxjatoucs/README.md index 6e2c9bb7bc9..cc3dd0a7a5b 100644 --- a/Master/texmf-dist/doc/latex/bxjatoucs/README.md +++ b/Master/texmf-dist/doc/latex/bxjatoucs/README.md @@ -69,6 +69,16 @@ Additional variants: the argument is assumed to be a valid decimal string. - `\bxjaFastCidToUcsHex{<value>}`: same for `\bxjaCidToUcsHex`. +### Conversions from Unicode + +Starting from v0.3, macros for some conversions *from* Unicode (rather +than conversions *to* Unicode) are available. The rule of input/output +is the same as the existing macros. + + - `\bxjaUcsToJis{<value>}`: converts to a jis scalar value. + - `\bxjaUcsToEuc{<value>}`: converts to an euc scalar value. + - `\bxjaUcsToSjis{<value>}`: converts to a sjis scalar value. + ## Example The following `\message` lines all display `23551:21496`. @@ -89,6 +99,10 @@ The following `\message` lines all display `5BFF:53F8`. Revision History ---------------- + * Version 0.3a ‹2024/07/22› + - Renamed TFM 'bxjatoucs-fromjis' to 'bxjatoucs-tojis'. + * Version 0.3 ‹2024/07/20› + - Added “Unicode to JIS”type conversions. * Version 0.2 ‹2019/10/20› - The first public version. diff --git a/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm b/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm Binary files differnew file mode 100644 index 00000000000..fc0ede1a9d1 --- /dev/null +++ b/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm diff --git a/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty b/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty index b387872640d..04fb01765a4 100644 --- a/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty +++ b/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty @@ -1,7 +1,7 @@ %% %% This is file 'bxjatoucs.sty'. %% -%% Copyright (c) 2019 Takayuki YATO (aka. "ZR") +%% Copyright (c) 2019-2024 Takayuki YATO (aka. "ZR") %% GitHub: https://github.com/zr-tex8r %% Twitter: @zr_tex8r %% @@ -53,7 +53,7 @@ %% package declaration \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bxjatoucs}[2019/10/20 v0.2] +\ProvidesPackage{bxjatoucs}[2024/07/22 v0.3a] \def\bxju@pkgname{bxjatoucs} %--------------------------------------- "check-avail" @@ -167,6 +167,22 @@ \bxju@ifdefinable\bxjaFastJscToUcsHex{% \def\bxjaFastJscToUcsHex{% \bxju@burst-`>\bxju@in@hex\bxju@fast@jsc@to@ucs}} +%%<*> \bxjaUcsToJis{<ucs>} +\bxju@ifdefinable\bxjaUcsToJis{% + \def\bxjaUcsToJis{% + \bxju@burst-`>\bxju@ucs@to@jis}} +%%<*> \bxjaUcsToEuc{<ucs>} +\bxju@ifdefinable\bxjaUcsToEuc{% + \def\bxjaUcsToEuc{% + \bxju@burst-`>\bxju@ucs@to@euc}} +%%<*> \bxjaUcsToSjis{<ucs>} +\bxju@ifdefinable\bxjaUcsToSjis{% + \def\bxjaUcsToSjis{% + \bxju@burst-`>\bxju@ucs@to@sjis}} +%%<*> \bxjaFastUcsToJsc{<ucs>} +\bxju@ifdefinable\bxjaFastUcsToJsc{% + \def\bxjaFastUcsToJsc{% + \bxju@burst-`>\bxju@fast@ucs@to@jsc}} %--------------------------------------- auxiliary @@ -195,6 +211,16 @@ \expandafter\bxju@decomp@b\the\numexpr#2-#1*256:#1:} \def\bxju@decomp@b#1:#2:#3{#3{#2}{#1}} +%% \bxju@decomp@int{<number>}\CScont +% Divides the <number> by 94 and returns the quotient and +% the remainder as \CScont{<high>}{<low>}. +\def\bxju@decomp@int#1{% + \expandafter\bxju@decomp@int@a + \number\numexpr\ifnum#1>\ltx@zero(#1-47)/94\else0\fi:#1:} +\def\bxju@decomp@int@a#1:#2:{% + \expandafter\bxju@decomp@int@b\the\numexpr#2-#1*94:#1:} +\def\bxju@decomp@int@b#1:#2:#3{#3{#2}{#1}} + %% \bxju@in@hex\CSconv{<arg>} \def\bxju@in@hex#1#2{% \expandafter\bxju@in@hex@a\bxju@burst-`>#1{#2}:>} @@ -231,6 +257,7 @@ %% umbralist fontdefs \font\bxju@ul@cid=bxjatoucs-cid \font\bxju@ul@jis=bxjatoucs-jis +\font\bxju@ul@tojis=bxjatoucs-tojis %% \bxju@cid@to@ucs{<cid>} \def\bxju@cid@to@ucs#1{% @@ -284,6 +311,55 @@ \def\bxju@fast@jsc@to@ucs#1{% \number\fontdimen\numexpr(#1)+8\bxju@ul@jis} +%% \bxju@conv@ucs@to@jsc{<ucs>}\CScont +% Converts a UCS value <ucs> to JSC and returns the result. +% If no corresponding JSC codepoint exists, returns 9999. +\def\bxju@conv@ucs@to@jsc#1{% + \expandafter\bxju@conv@ucs@to@jsc@a\number\numexpr#1\bxju@mk} +\def\bxju@conv@ucs@to@jsc@a#1\bxju@mk{% + \bxju@cond\ifnum#1<"10000 \fi{% + \expandafter\bxju@conv@ucs@to@jsc@b + \number\fontdimen\numexpr(#1+480)/64\bxju@ul@tojis:#1\bxju@mk + }{\bxju@conv@ucs@to@jsc@a0\bxju@mk}} +\def\bxju@conv@ucs@to@jsc@b#1:#2\bxju@mk{% + \expandafter\bxju@conv@ucs@to@jsc@c + \number\fontdimen\numexpr#2+1088-#1\bxju@ul@tojis\bxju@mk} +\def\bxju@conv@ucs@to@jsc@c#1\bxju@mk#2{#2{#1}} + +%% \bxju@ucs@to@jis{<ucs>} +\def\bxju@ucs@to@jis#1{% + \bxju@check@number{#1}\bxju@ucs@to@jiseuc{8481}} +\def\bxju@ucs@to@jiseuc#1{% + \bxju@conv@ucs@to@jsc{#1}\bxju@ucs@to@jiseuc@a} +\def\bxju@ucs@to@jiseuc@a#1{% + \bxju@cond\ifnum#1=9999 \fi{\ltx@firstoftwo{0}}{%else + \bxju@decomp@int{#1}\bxju@ucs@to@jiseuc@b}} +\def\bxju@ucs@to@jiseuc@b#1#2#3{% + \number\numexpr#1*256+#2+#3\relax} + +%% \bxju@ucs@to@euc{<ucs>} +\def\bxju@ucs@to@euc#1{% + \bxju@check@number{#1}\bxju@ucs@to@jiseuc{41377}} + +%% \bxju@ucs@to@sjis{<ucs>} +\def\bxju@ucs@to@sjis#1{% + \bxju@check@number{#1}\bxju@ucs@to@sjis@a} +\def\bxju@ucs@to@sjis@a#1{% + \bxju@conv@ucs@to@jsc{#1}\bxju@ucs@to@sjis@b} +\def\bxju@ucs@to@sjis@b#1{% + \bxju@cond\ifnum#1=9999 \fi{0}{%else + \bxju@decomp@int{#1}\bxju@ucs@to@sjis@c}} +\def\bxju@ucs@to@sjis@c#1#2{% + \number\numexpr#1*128+#2 % + \ifodd#1 -33 \else\ifnum#2>62 +1 \fi\fi + \ifnum#1<62 +33088 \else +49472 \fi\relax} + +%% \bxju@fast@ucs@to@jsc{<ucs>} +\def\bxju@fast@ucs@to@jsc#1{% + \bxju@conv@ucs@to@jsc{#1}\bxju@fast@ucs@to@jsc@a} +\def\bxju@fast@ucs@to@jsc@a#1{% + \bxju@cond\ifnum#1=9999 \fi{-1}{#1}} + %--------------------------------------- all done \let\bxju@next\@undefined \let\bxju@ifdefinable\@undefined |