texlive[71870] Master/texmf-dist: bxjatoucs (22jul24)

commits+karl at tug.org commits+karl at tug.org
Mon Jul 22 23:25:17 CEST 2024


Revision: 71870
          https://tug.org/svn/texlive?view=revision&revision=71870
Author:   karl
Date:     2024-07-22 23:25:17 +0200 (Mon, 22 Jul 2024)
Log Message:
-----------
bxjatoucs (22jul24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE
    trunk/Master/texmf-dist/doc/latex/bxjatoucs/README.md
    trunk/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm

Modified: trunk/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE	2024-07-22 14:19:17 UTC (rev 71869)
+++ trunk/Master/texmf-dist/doc/latex/bxjatoucs/LICENSE	2024-07-22 21:25:17 UTC (rev 71870)
@@ -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

Modified: trunk/Master/texmf-dist/doc/latex/bxjatoucs/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxjatoucs/README.md	2024-07-22 14:19:17 UTC (rev 71869)
+++ trunk/Master/texmf-dist/doc/latex/bxjatoucs/README.md	2024-07-22 21:25:17 UTC (rev 71870)
@@ -69,6 +69,16 @@
     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 @@
 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.
 

Added: trunk/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm
===================================================================
--- trunk/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm	2024-07-22 14:19:17 UTC (rev 71869)
+++ trunk/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm	2024-07-22 21:25:17 UTC (rev 71870)

Property changes on: trunk/Master/texmf-dist/fonts/tfm/public/bxjatoucs/bxjatoucs-tojis.tfm
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty	2024-07-22 14:19:17 UTC (rev 71869)
+++ trunk/Master/texmf-dist/tex/latex/bxjatoucs/bxjatoucs.sty	2024-07-22 21:25:17 UTC (rev 71870)
@@ -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 at pkgname{bxjatoucs}
 
 %--------------------------------------- "check-avail"
@@ -167,6 +167,22 @@
 \bxju at ifdefinable\bxjaFastJscToUcsHex{%
   \def\bxjaFastJscToUcsHex{%
     \bxju at burst-`>\bxju at in@hex\bxju at fast@jsc at to@ucs}}
+%%<*> \bxjaUcsToJis{<ucs>}
+\bxju at ifdefinable\bxjaUcsToJis{%
+  \def\bxjaUcsToJis{%
+    \bxju at burst-`>\bxju at ucs@to at jis}}
+%%<*> \bxjaUcsToEuc{<ucs>}
+\bxju at ifdefinable\bxjaUcsToEuc{%
+  \def\bxjaUcsToEuc{%
+    \bxju at burst-`>\bxju at ucs@to at euc}}
+%%<*> \bxjaUcsToSjis{<ucs>}
+\bxju at ifdefinable\bxjaUcsToSjis{%
+  \def\bxjaUcsToSjis{%
+    \bxju at burst-`>\bxju at ucs@to at sjis}}
+%%<*> \bxjaFastUcsToJsc{<ucs>}
+\bxju at ifdefinable\bxjaFastUcsToJsc{%
+  \def\bxjaFastUcsToJsc{%
+    \bxju at burst-`>\bxju at fast@ucs at to@jsc}}
 
 %--------------------------------------- auxiliary
 
@@ -195,6 +211,16 @@
   \expandafter\bxju at decomp@b\the\numexpr#2-#1*256:#1:}
 \def\bxju at decomp@b#1:#2:#3{#3{#2}{#1}}
 
+%% \bxju at decomp@int{<number>}\CScont
+% Divides the <number> by 94 and returns the quotient and
+% the remainder as \CScont{<high>}{<low>}.
+\def\bxju at decomp@int#1{%
+  \expandafter\bxju at decomp@int at a
+      \number\numexpr\ifnum#1>\ltx at zero(#1-47)/94\else0\fi:#1:}
+\def\bxju at decomp@int at a#1:#2:{%
+  \expandafter\bxju at decomp@int at b\the\numexpr#2-#1*94:#1:}
+\def\bxju at decomp@int at b#1:#2:#3{#3{#2}{#1}}
+
 %% \bxju at in@hex\CSconv{<arg>}
 \def\bxju at in@hex#1#2{%
   \expandafter\bxju at in@hex at a\bxju at burst-`>#1{#2}:>}
@@ -231,6 +257,7 @@
 %% umbralist fontdefs
 \font\bxju at ul@cid=bxjatoucs-cid
 \font\bxju at ul@jis=bxjatoucs-jis
+\font\bxju at ul@tojis=bxjatoucs-tojis
 
 %% \bxju at cid@to at ucs{<cid>}
 \def\bxju at cid@to at ucs#1{%
@@ -284,6 +311,55 @@
 \def\bxju at fast@jsc at to@ucs#1{%
   \number\fontdimen\numexpr(#1)+8\bxju at ul@jis}
 
+%% \bxju at conv@ucs at 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 at conv@ucs at to@jsc#1{%
+  \expandafter\bxju at conv@ucs at to@jsc at a\number\numexpr#1\bxju at mk}
+\def\bxju at conv@ucs at to@jsc at a#1\bxju at mk{%
+  \bxju at cond\ifnum#1<"10000 \fi{%
+    \expandafter\bxju at conv@ucs at to@jsc at b
+        \number\fontdimen\numexpr(#1+480)/64\bxju at ul@tojis:#1\bxju at mk
+  }{\bxju at conv@ucs at to@jsc at a0\bxju at mk}}
+\def\bxju at conv@ucs at to@jsc at b#1:#2\bxju at mk{%
+  \expandafter\bxju at conv@ucs at to@jsc at c
+      \number\fontdimen\numexpr#2+1088-#1\bxju at ul@tojis\bxju at mk}
+\def\bxju at conv@ucs at to@jsc at c#1\bxju at mk#2{#2{#1}}
+
+%% \bxju at ucs@to at jis{<ucs>}
+\def\bxju at ucs@to at jis#1{%
+  \bxju at check@number{#1}\bxju at ucs@to at jiseuc{8481}}
+\def\bxju at ucs@to at jiseuc#1{%
+  \bxju at conv@ucs at to@jsc{#1}\bxju at ucs@to at jiseuc@a}
+\def\bxju at ucs@to at jiseuc@a#1{%
+  \bxju at cond\ifnum#1=9999 \fi{\ltx at firstoftwo{0}}{%else
+    \bxju at decomp@int{#1}\bxju at ucs@to at jiseuc@b}}
+\def\bxju at ucs@to at jiseuc@b#1#2#3{%
+  \number\numexpr#1*256+#2+#3\relax}
+
+%% \bxju at ucs@to at euc{<ucs>}
+\def\bxju at ucs@to at euc#1{%
+  \bxju at check@number{#1}\bxju at ucs@to at jiseuc{41377}}
+
+%% \bxju at ucs@to at sjis{<ucs>}
+\def\bxju at ucs@to at sjis#1{%
+  \bxju at check@number{#1}\bxju at ucs@to at sjis@a}
+\def\bxju at ucs@to at sjis@a#1{%
+  \bxju at conv@ucs at to@jsc{#1}\bxju at ucs@to at sjis@b}
+\def\bxju at ucs@to at sjis@b#1{%
+  \bxju at cond\ifnum#1=9999 \fi{0}{%else
+    \bxju at decomp@int{#1}\bxju at ucs@to at sjis@c}}
+\def\bxju at ucs@to at 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 at fast@ucs at to@jsc{<ucs>}
+\def\bxju at fast@ucs at to@jsc#1{%
+  \bxju at conv@ucs at to@jsc{#1}\bxju at fast@ucs at to@jsc at a}
+\def\bxju at fast@ucs at to@jsc at a#1{%
+  \bxju at cond\ifnum#1=9999 \fi{-1}{#1}}
+
 %--------------------------------------- all done
 \let\bxju at next\@undefined
 \let\bxju at ifdefinable\@undefined



More information about the tex-live-commits mailing list.