Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
h-kitagawa committed Jul 27, 2019
1 parent 86bb75a commit 7873040
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 15 deletions.
19 changes: 11 additions & 8 deletions source/texk/web2c/ptexdir/ptex-base.ch
Original file line number Diff line number Diff line change
Expand Up @@ -7204,14 +7204,6 @@ end;
@ This section is a part of |main_control|.

@<Append KANJI-character |cur_chr| ...@>=
if is_char_node(tail) then
begin if not( (last_jchr<>null) and (link(last_jchr)=tail) ) then
begin cx:=qo(character(tail)); @<Insert |post_break_penalty|@>;
end;
end
else if type(tail)=ligature_node then
begin cx:=qo(character(lig_char(tail))); @<Insert |post_break_penalty|@>;
end;
if direction=dir_tate then
begin if font_dir[main_f]=dir_tate then disp:=0
else if font_dir[main_f]=dir_yoko then disp:=t_baseline_shift-y_baseline_shift
Expand All @@ -7224,6 +7216,17 @@ else
else disp:=y_baseline_shift;
main_f:=cur_jfont;
end;
if (type(tail)=disp_node)and(prev_node<>null)and(link(prev_node)=tail) then
begin disp:=disp_dimen(tail); gp:=prev_node; end
else gp:=tail;
if is_char_node(gp) then
begin if not( (last_jchr<>null) and (link(last_jchr)=gp) ) then
begin cx:=qo(character(gp)); @<Insert |post_break_penalty|@>;
end;
end
else if type(gp)=ligature_node then
begin cx:=qo(character(lig_char(gp))); @<Insert |post_break_penalty|@>;
end;
@<Append |disp_node| at end of displace area@>;
ins_kp:=false; ligature_present:=false;
cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f));
Expand Down
42 changes: 35 additions & 7 deletions source/texk/web2c/ptexdir/tests/kinsoku_around_word.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,45 @@
\postbreakpenalty`\^^L=601
\postbreakpenalty`漢=6020
\prebreakpenalty`字=4020
%\ybaselineshift=1pt

\setbox0=\hbox{.漢\relax.漢\null.漢.A{}.漢{}.\showlists}
\setbox0=\hbox{.字\relax.字\null.字.A{}.字{}.\showlists}
%\setbox0=\hbox{.漢\relax.漢\null.漢.A{}.漢{}.\showlists}
%\setbox0=\hbox{.字\relax.字\null.字.A{}.字{}.\showlists}

\setbox0=\hbox{,漢,\relax\null,漢{},\showlists}
\setbox0=\hbox{,字,\relax\null,字{},\showlists}
%\setbox0=\hbox{,漢,\relax 漢\null,漢{},\showlists}
%\setbox0=\hbox{,字,\relax 字\null,字{},\showlists}

\setbox0=\hbox{あ.\null {あ}.\null あ{.}\null{あ}{.}\showlists}
\setbox0=\hbox{,あ\null ,{あ}\null {,}あ\null{,}{あ}\showlists}
\setbox0=\hbox{あ.\showlists}% => 901 期待
\setbox0=\hbox{{あ}.\showlists}% => 901 期待
\setbox0=\hbox{あ{.}\showlists}% => 901 期待
\setbox0=\hbox{{あ}{.}\showlists}%=> 901 期待

\setbox0=\hbox{,あ\showlists}% => 801 期待
\setbox0=\hbox{,{あ}\showlists}% => 801 期待
\setbox0=\hbox{{,}あ\showlists}% => 801 期待
\setbox0=\hbox{{,}{あ}\showlists}%=> 801 期待

{\ybaselineshift=1pt
\setbox0=\hbox{あ.\showlists}% => 901 期待
\setbox0=\hbox{{あ}.\showlists}% => 901 期待
\setbox0=\hbox{あ{.}\showlists}% => 901 期待
\setbox0=\hbox{{あ}{.}\showlists}%=> 901 期待

\setbox0=\hbox{,あ\showlists}% => 801 期待
\setbox0=\hbox{,{あ}\showlists}% => 801 期待
\setbox0=\hbox{{,}あ\showlists}% => 801 期待
\setbox0=\hbox{{,}{あ}\showlists}%=> 801 期待

\setbox0=\hbox{fiあ\showlists}% =>
\setbox0=\hbox{fi{あ}\showlists}% =>
\setbox0=\hbox{{fi}あ\showlists}% =>
\setbox0=\hbox{{fi}{あ}\showlists}%=>
}


\setbox0=\hbox{漢f\showlists} % => 6721 (= 6020 + 701)
\setbox0=\hbox{fi字\showlists}% => 4621 (= 4020 + 601)

\setbox0=\hbox{漢f漢fi字\showlists}


\bye

0 comments on commit 7873040

Please sign in to comment.