texlive[45370] Master/texmf-dist: fixjfm (21sep17)

commits+karl at tug.org commits+karl at tug.org
Thu Sep 21 22:57:22 CEST 2017


Revision: 45370
          http://tug.org/svn/texlive?view=revision&revision=45370
Author:   karl
Date:     2017-09-21 22:57:22 +0200 (Thu, 21 Sep 2017)
Log Message:
-----------
fixjfm (21sep17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/fixjfm/README.txt
    trunk/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf
    trunk/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex
    trunk/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty

Modified: trunk/Master/texmf-dist/doc/generic/fixjfm/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/generic/fixjfm/README.txt	2017-09-21 20:57:10 UTC (rev 45369)
+++ trunk/Master/texmf-dist/doc/generic/fixjfm/README.txt	2017-09-21 20:57:22 UTC (rev 45370)
@@ -6,7 +6,7 @@
 
 Repository: https://github.com/Man-Ting-Fang/fixjfm
 
-Version: 2017-09-12 v0.5
+Version: 2017-09-21 v0.6
 
 Copyright 2017 Yue ZHANG
 

Modified: trunk/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex	2017-09-21 20:57:10 UTC (rev 45369)
+++ trunk/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex	2017-09-21 20:57:22 UTC (rev 45370)
@@ -78,7 +78,7 @@
   \thanks{CTAN Homepage: \texttt{https://ctan.org/pkg/fixjfm}}
   \thanks{Repository: \texttt{https://github.com/Man-Ting-Fang/fixjfm}}}
 \author{Yue \textsc{Zhang}}
-\date{2017-09-12\quad v0.5}
+\date{2017-09-21\quad v0.6}
 
 \maketitle
 
@@ -325,4 +325,11 @@
     https://github.com/Man-Ting-Fang/fixjfm/issues/3
 \end{verbatim}
 
+\begin{history}{2017-09-21 v0.6}
+\item Bug fix and improvement, thanks to Hironobu Yamashita:
+\end{history}
+\begin{verbatim}
+    https://github.com/Man-Ting-Fang/fixjfm/pull/4
+\end{verbatim}
+
 \end{document}

Modified: trunk/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty	2017-09-21 20:57:10 UTC (rev 45369)
+++ trunk/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty	2017-09-21 20:57:22 UTC (rev 45370)
@@ -11,7 +11,7 @@
 \begingroup\expandafter\expandafter\expandafter\endgroup
   \expandafter\ifx\csname ProvidesPackage\endcsname\relax
   \else
-    \ProvidesPackage{fixjfm}[2017/09/12 v0.5 Fix JFM (for *pTeX)]%
+    \ProvidesPackage{fixjfm}[2017/09/21 v0.6 Fix JFM (for *pTeX)]%
   \fi
 
 \edef\FIXJFMDOTSTYRESTORECATCODE{\catcode`\noexpand\@=\the\catcode`\@\relax}
@@ -18,6 +18,8 @@
 
 \catcode`\@=11\relax
 
+% common utilities
+
 \def\fixjfm at ifprimitive#1{%
   \begingroup
     \edef\fixjfm at temp@meaning{\meaning#1}%
@@ -35,10 +37,44 @@
 
 \def\fixjfm at empty{}
 
+\begingroup
+  \let\CATCODE=\catcode
+  \let\RELAX=\relax
+  \let\GDEF=\gdef
+  \let\ENDGROUP=\endgroup
+  \CATCODE`\k=12\RELAX
+  \CATCODE`\a=12\RELAX
+  \CATCODE`\n=12\RELAX
+  \CATCODE`\j=12\RELAX
+  \CATCODE`\i=12\RELAX
+  \CATCODE`\c=12\RELAX
+  \CATCODE`\h=12\RELAX
+  \CATCODE`\r=12\RELAX
+  \CATCODE`\t=12\RELAX
+  \CATCODE`\e=12\RELAX
+  \GDEF\FIXJFM at KANJICHARACTER{kanji character }%
+\ENDGROUP
+
+\def\fixjfm at get@inhibitxspcode#1{%
+  \expandafter\expandafter\expandafter\fixjfm@@get at inhibitxspcode
+    \expandafter\meaning\expandafter#1\FIXJFM at KANJICHARACTER\relax\fixjfm at nil}
+
+\expandafter\def\expandafter\fixjfm@@get at inhibitxspcode
+  \expandafter#\expandafter1\FIXJFM at KANJICHARACTER#2#3\fixjfm at nil{%
+    \count2=-1\relax
+    \def\fixjfm at temp@tokens{#1}%
+    \ifx\fixjfm at temp@tokens\fixjfm at empty
+      \count2=\inhibitxspcode`#2\relax
+    \fi}
+
+% \leavevmode
+
 \fixjfm at ifprimitive\quitvmode
   \let\leavevmode=\quitvmode
 \fi
 
+% \fixjfmspacing
+
 \def\fixjfmspacing{\FixJFMSpacing}
 
 \newif\iffixjfm at lastnodechar@available@
@@ -56,6 +92,37 @@
     \xdef\fixjfm at kana{\kansuji2}%
     \xdef\fixjfm at other{\kansuji3}%
   \endgroup
+  \csname newif\expandafter\endcsname\csname iffixjfm at sp@status@\endcsname
+  \def\fixjfm at ifautospacing{%
+    \fixjfm at sp@status at false
+    \begingroup
+      \kanjiskip=10pt\relax
+      \setbox0=\hbox{\fixjfm at kanji\fixjfm at kanji\fixjfm at kanji}%
+      \dimen4=\wd0\relax
+      \noautospacing
+      \setbox0=\hbox{\fixjfm at kanji\fixjfm at kanji\fixjfm at kanji}%
+      \dimen2=\wd0\relax
+      \expandafter
+    \endgroup
+    \ifdim\dimen4>\dimen2\relax
+      \fixjfm at sp@status at true
+    \fi}%
+  \def\fixjfm at ifautoxspacing{%
+    \fixjfm at sp@status at false
+    \begingroup
+      \xspcode`\A=3\relax
+      \inhibitxspcode\sjis"8ABF=3\relax % U+6F22: Kanji Han
+      \xkanjiskip=20pt\relax
+      \setbox0=\hbox{\fixjfm at kanji A\fixjfm at kanji}%
+      \dimen4=\wd0\relax
+      \noautoxspacing
+      \setbox0=\hbox{\fixjfm at kanji A\fixjfm at kanji}%
+      \dimen2=\wd0\relax
+      \expandafter
+    \endgroup
+    \ifdim\dimen4>\dimen2\relax
+      \fixjfm at sp@status at true
+    \fi}%
   \def\FixJFMSpacing{\futurelet\fixjfm at sp@temp at token\fixjfm at fixspacing}%
   \def\fixjfm at fixspacing{%
     \begingroup
@@ -63,7 +130,21 @@
       \edef\fixjfm at sp@temp at tokens{\fixjfm at sp@temp at token}%
       \expandafter\fixjfm@@fixspacing\fixjfm at sp@temp at tokens\relax\fixjfm at sp@nil
       \ifnum\count0>-1\relax
-        \ifnum\count0<256\relax\hskip\xkanjiskip\else\hskip\kanjiskip\fi
+        \ifnum\count0<256\relax
+          \ifnum\xspcode\count0>1\relax
+            \ifnum\count2>1\relax
+              \fixjfm at ifautoxspacing
+              \iffixjfm at sp@status@
+                \hskip\xkanjiskip
+              \fi
+            \fi
+          \fi
+        \else
+          \fixjfm at ifautospacing
+          \iffixjfm at sp@status@
+            \hskip\kanjiskip
+          \fi
+        \fi
         \setbox0=\hbox{%
           \inhibitglue\char\count0\relax\fixjfm at sp@temp at token\inhibitglue}%
         \setbox2=\hbox{%
@@ -70,10 +151,11 @@
           \inhibitglue\char\count0 \fixjfm at sp@temp at token\inhibitglue}%
         \dimen0=\wd2\relax
         \advance\dimen0 by -\wd0\relax
-        \fixjfm at temp@hskip\relax
+        \fixjfm at temp@hskip
       \fi
     \endgroup}%
   \long\def\fixjfm@@fixspacing#1#2\fixjfm at sp@nil{%
+    \count2=1\relax
     \ifcat#1\fixjfm at kanji
     \else
       \ifcat#1\fixjfm at kana
@@ -81,8 +163,12 @@
         \ifcat#1\fixjfm at other
         \else
           \count0=-1\relax
+          \count2=0\relax
         \fi
       \fi
+    \fi
+    \ifnum\count2>0\relax
+      \fixjfm at get@inhibitxspcode#1\relax
     \fi}%
   \def\SetFixJFMSpacingStretch#1{\def\fixjfm at temp@hskip at stretch{#1}}%
   \def\SetFixJFMSpacingShrink#1{\def\fixjfm at temp@hskip at shrink{#1}}%
@@ -120,6 +206,8 @@
     \UseFixJFMCJKTextFontCommands
   \fi
 
+% \inhibitglue
+
 \fixjfm at ifprimitive\protected
   \protected\def\<{\ifvmode\leavevmode\fi\inhibitglue}%
 \else
@@ -126,6 +214,8 @@
   \def\<{\inhibitglue}%
 \fi
 
+% \fixjfmparindent
+
 \def\fixjfmparindent{\FixJFMParindent}
 
 \begingroup
@@ -139,40 +229,14 @@
   \fi
 \endgroup
 
-\begingroup
-  \let\CATCODE=\catcode
-  \let\RELAX=\relax
-  \let\GDEF=\gdef
-  \let\ENDGROUP=\endgroup
-  \CATCODE`\k=12\RELAX
-  \CATCODE`\a=12\RELAX
-  \CATCODE`\n=12\RELAX
-  \CATCODE`\j=12\RELAX
-  \CATCODE`\i=12\RELAX
-  \CATCODE`\c=12\RELAX
-  \CATCODE`\h=12\RELAX
-  \CATCODE`\r=12\RELAX
-  \CATCODE`\t=12\RELAX
-  \CATCODE`\e=12\RELAX
-  \GDEF\FIXJFM at KANJICHARACTER{kanji character }%
-\ENDGROUP
-
 \def\FixJFMParindent{\futurelet\fixjfm at pi@temp at token\fixjfm at fixparindent}
 
 \def\fixjfm at fixparindent{%
-  \expandafter\expandafter\expandafter\fixjfm@@fixparindent
-    \expandafter\meaning\expandafter\fixjfm at pi@temp at token
-    \FIXJFM at KANJICHARACTER\relax\fixjfm at pi@nil}
+  \begingroup
+    \fixjfm at get@inhibitxspcode\fixjfm at pi@temp at token
+    \ifnum\count2=2\relax\inhibitglue\fi
+  \endgroup}
 
-\expandafter\def\expandafter\fixjfm@@fixparindent
-  \expandafter#\expandafter1\FIXJFM at KANJICHARACTER#2#3\fixjfm at pi@nil{%
-    \def\fixjfm at pi@temp at tokens{#1}%
-    \ifx\fixjfm at pi@temp at tokens\fixjfm at empty
-      \ifnum\the\inhibitxspcode`#2=2\relax
-        \inhibitglue
-      \fi
-    \fi}
-
 \begingroup\expandafter\expandafter\expandafter\endgroup
   \expandafter\ifx\csname PushPostHook\endcsname\relax % everyhook.sty
     \def\EveryparPreHook{}%



More information about the tex-live-commits mailing list