diff options
author | Karl Berry <karl@freefriends.org> | 2017-09-21 20:57:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-09-21 20:57:22 +0000 |
commit | c51be598b9cd977c55d61a6a19a98920eb416a66 (patch) | |
tree | 4a402745da44483d03d70d0234f472d50ba64766 /Master/texmf-dist | |
parent | bc6b2d9b5bc8514cdd075cb5ba3182b1c4c16d78 (diff) |
fixjfm (21sep17)
git-svn-id: svn://tug.org/texlive/trunk@45370 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/generic/fixjfm/README.txt | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf | bin | 279837 -> 280203 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex | 9 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty | 130 |
4 files changed, 106 insertions, 35 deletions
diff --git a/Master/texmf-dist/doc/generic/fixjfm/README.txt b/Master/texmf-dist/doc/generic/fixjfm/README.txt index c6575454cf1..2f0b4d90efb 100644 --- a/Master/texmf-dist/doc/generic/fixjfm/README.txt +++ b/Master/texmf-dist/doc/generic/fixjfm/README.txt @@ -6,7 +6,7 @@ CTAN Homepage: https://ctan.org/pkg/fixjfm Repository: https://github.com/Man-Ting-Fang/fixjfm -Version: 2017-09-12 v0.5 +Version: 2017-09-21 v0.6 Copyright 2017 Yue ZHANG diff --git a/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf b/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf Binary files differindex 42bda97e52f..2f279032ba9 100644 --- a/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf +++ b/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.pdf diff --git a/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex b/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex index 4bc4726a017..bd591acb947 100644 --- a/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex +++ b/Master/texmf-dist/doc/generic/fixjfm/fixjfm-doc.tex @@ -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 @@ Thanks to Hironobu Yamashita for suggesting all these changes: 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} diff --git a/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty b/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty index dbfe4fa51af..08e6f6f3d5b 100644 --- a/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty +++ b/Master/texmf-dist/tex/generic/fixjfm/fixjfm.sty @@ -11,13 +11,15 @@ \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} \catcode`\@=11\relax +% common utilities + \def\fixjfm@ifprimitive#1{% \begingroup \edef\fixjfm@temp@meaning{\meaning#1}% @@ -35,10 +37,44 @@ \def\fixjfm@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@KANJICHARACTER{kanji character }% +\ENDGROUP + +\def\fixjfm@get@inhibitxspcode#1{% + \expandafter\expandafter\expandafter\fixjfm@@get@inhibitxspcode + \expandafter\meaning\expandafter#1\FIXJFM@KANJICHARACTER\relax\fixjfm@nil} + +\expandafter\def\expandafter\fixjfm@@get@inhibitxspcode + \expandafter#\expandafter1\FIXJFM@KANJICHARACTER#2#3\fixjfm@nil{% + \count2=-1\relax + \def\fixjfm@temp@tokens{#1}% + \ifx\fixjfm@temp@tokens\fixjfm@empty + \count2=\inhibitxspcode`#2\relax + \fi} + +% \leavevmode + \fixjfm@ifprimitive\quitvmode \let\leavevmode=\quitvmode \fi +% \fixjfmspacing + \def\fixjfmspacing{\FixJFMSpacing} \newif\iffixjfm@lastnodechar@available@ @@ -56,6 +92,37 @@ \xdef\fixjfm@kana{\kansuji2}% \xdef\fixjfm@other{\kansuji3}% \endgroup + \csname newif\expandafter\endcsname\csname iffixjfm@sp@status@\endcsname + \def\fixjfm@ifautospacing{% + \fixjfm@sp@status@false + \begingroup + \kanjiskip=10pt\relax + \setbox0=\hbox{\fixjfm@kanji\fixjfm@kanji\fixjfm@kanji}% + \dimen4=\wd0\relax + \noautospacing + \setbox0=\hbox{\fixjfm@kanji\fixjfm@kanji\fixjfm@kanji}% + \dimen2=\wd0\relax + \expandafter + \endgroup + \ifdim\dimen4>\dimen2\relax + \fixjfm@sp@status@true + \fi}% + \def\fixjfm@ifautoxspacing{% + \fixjfm@sp@status@false + \begingroup + \xspcode`\A=3\relax + \inhibitxspcode\sjis"8ABF=3\relax % U+6F22: Kanji Han + \xkanjiskip=20pt\relax + \setbox0=\hbox{\fixjfm@kanji A\fixjfm@kanji}% + \dimen4=\wd0\relax + \noautoxspacing + \setbox0=\hbox{\fixjfm@kanji A\fixjfm@kanji}% + \dimen2=\wd0\relax + \expandafter + \endgroup + \ifdim\dimen4>\dimen2\relax + \fixjfm@sp@status@true + \fi}% \def\FixJFMSpacing{\futurelet\fixjfm@sp@temp@token\fixjfm@fixspacing}% \def\fixjfm@fixspacing{% \begingroup @@ -63,17 +130,32 @@ \edef\fixjfm@sp@temp@tokens{\fixjfm@sp@temp@token}% \expandafter\fixjfm@@fixspacing\fixjfm@sp@temp@tokens\relax\fixjfm@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@ifautoxspacing + \iffixjfm@sp@status@ + \hskip\xkanjiskip + \fi + \fi + \fi + \else + \fixjfm@ifautospacing + \iffixjfm@sp@status@ + \hskip\kanjiskip + \fi + \fi \setbox0=\hbox{% \inhibitglue\char\count0\relax\fixjfm@sp@temp@token\inhibitglue}% \setbox2=\hbox{% \inhibitglue\char\count0 \fixjfm@sp@temp@token\inhibitglue}% \dimen0=\wd2\relax \advance\dimen0 by -\wd0\relax - \fixjfm@temp@hskip\relax + \fixjfm@temp@hskip \fi \endgroup}% \long\def\fixjfm@@fixspacing#1#2\fixjfm@sp@nil{% + \count2=1\relax \ifcat#1\fixjfm@kanji \else \ifcat#1\fixjfm@kana @@ -81,8 +163,12 @@ \ifcat#1\fixjfm@other \else \count0=-1\relax + \count2=0\relax \fi \fi + \fi + \ifnum\count2>0\relax + \fixjfm@get@inhibitxspcode#1\relax \fi}% \def\SetFixJFMSpacingStretch#1{\def\fixjfm@temp@hskip@stretch{#1}}% \def\SetFixJFMSpacingShrink#1{\def\fixjfm@temp@hskip@shrink{#1}}% @@ -120,12 +206,16 @@ \UseFixJFMCJKTextFontCommands \fi +% \inhibitglue + \fixjfm@ifprimitive\protected \protected\def\<{\ifvmode\leavevmode\fi\inhibitglue}% \else \def\<{\inhibitglue}% \fi +% \fixjfmparindent + \def\fixjfmparindent{\FixJFMParindent} \begingroup @@ -139,39 +229,13 @@ \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@KANJICHARACTER{kanji character }% -\ENDGROUP - \def\FixJFMParindent{\futurelet\fixjfm@pi@temp@token\fixjfm@fixparindent} \def\fixjfm@fixparindent{% - \expandafter\expandafter\expandafter\fixjfm@@fixparindent - \expandafter\meaning\expandafter\fixjfm@pi@temp@token - \FIXJFM@KANJICHARACTER\relax\fixjfm@pi@nil} - -\expandafter\def\expandafter\fixjfm@@fixparindent - \expandafter#\expandafter1\FIXJFM@KANJICHARACTER#2#3\fixjfm@pi@nil{% - \def\fixjfm@pi@temp@tokens{#1}% - \ifx\fixjfm@pi@temp@tokens\fixjfm@empty - \ifnum\the\inhibitxspcode`#2=2\relax - \inhibitglue - \fi - \fi} + \begingroup + \fixjfm@get@inhibitxspcode\fixjfm@pi@temp@token + \ifnum\count2=2\relax\inhibitglue\fi + \endgroup} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname PushPostHook\endcsname\relax % everyhook.sty |