• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョン9a6b24dad229f0c279d46b8243ebb6691cf0c684 (tree)
日時2019-08-02 11:17:45
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

use new whatsit to support ligatures between right boundary

変更サマリ

差分

--- a/src/ltj-jfmglue.lua
+++ b/src/ltj-jfmglue.lua
@@ -469,6 +469,10 @@ calc_np_auxtable = {
469469 local lq = node_next(lp);
470470 head = node_remove(head, lp); node_free(lp); non_ihb_flag = false
471471 return false, lq;
472+ elseif getfield(lp, 'user_id')==luatexja.userid_table.JA_AL_BDD then
473+ local lq = node_next(lp);
474+ head = node_remove(head, lp); node_free(lp)
475+ return false, lq;
472476 else
473477 set_attr(lp, attr_icflag, PROCESSED)
474478 luatexbase.call_callback("luatexja.jfmglue.whatsit_getinfo",
@@ -1279,7 +1283,7 @@ end
12791283 end
12801284
12811285 do
1282- local IHB = luatexja.userid_table.IHB
1286+ local IHB = luatexja.userid_table.IHB
12831287 local BPAR = luatexja.userid_table.BPAR
12841288 local BOXB = luatexja.userid_table.BOXB
12851289 local node_prev = node.direct.getprev
--- a/src/ltj-pretreat.lua
+++ b/src/ltj-pretreat.lua
@@ -45,6 +45,7 @@ local ltjs_orig_char_table = ltjs.orig_char_table
4545 local ltjf_replace_altfont = ltjf.replace_altfont
4646 local STCK = luatexja.userid_table.STCK
4747 local DIR = luatexja.userid_table.DIR
48+local JA_AL_BDD = luatexja.userid_table.JA_AL_BDD
4849 local PROCESSED_BEGIN_FLAG = luatexja.icflag_table.PROCESSED_BEGIN_FLAG
4950
5051 local dir_tate = luatexja.dir_table.dir_tate
@@ -85,6 +86,9 @@ do
8586 {
8687 __index = function() return node_next end,
8788 })
89+ local id_boundary = node.id('boundary')
90+ local node_new, insert_before = node.direct.new, node.direct.insert_before
91+ local setsubtype = node.direct.setsubtype or function(n,l) setfield(n,'subtype',l) end
8892 local function suppress_hyphenate_ja (h)
8993 start_time_measure('ltj_hyphenate')
9094 head = to_direct(h)
@@ -97,15 +101,26 @@ do
97101 do
98102 local p = head
99103 while p do
100- local pid = getid(p)
104+ local pid, prev_chartype = getid(p), 0
105+ -- prev_chartype: 0: not char 1: ALchar 2: JAchar
101106 while pid==id_glyph do
102107 local pc = getchar(p)
103108 if has_attr(p, attr_icflag, 0) and is_ucs_in_japanese_char(p, pc) then
109+ if prev_chartype==1 then
110+ local b = node_new(id_whatsit,sid_user);
111+ setfield(b, 'type', 100); setfield(b, 'user_id', JA_AL_BDD);
112+ insert_before(head, p, b)
113+ end
104114 local pf = has_attr(p, attr_curjfnt)
105115 pf = (pf and pf>0 and pf) or getfont(p)
106116 setfont(p, ltjf_replace_altfont(pf, pc))
107117 setlang(p, lang_ja)
108- ltjs_orig_char_table[p] = pc
118+ ltjs_orig_char_table[p], prev_chartype = pc, 2
119+ elseif prev_chartype==2 then
120+ local b = node_new(id_whatsit,sid_user);
121+ setfield(b, 'type', 100); setfield(b, 'user_id', JA_AL_BDD);
122+ insert_before(head, p, b); prev_chartype = 1
123+ else prev_chartype = 1
109124 end
110125 p = node_next(p); pid = getid(p)
111126 end
--- a/src/luatexja.lua
+++ b/src/luatexja.lua
@@ -80,6 +80,7 @@ userid_table.STCK = luatexbase.newuserwhatsitid('stack_marker', 'luatexja') --
8080 userid_table.BPAR = luatexbase.newuserwhatsitid('begin_par', 'luatexja') -- 「段落始め」
8181 userid_table.DIR = luatexbase.newuserwhatsitid('direction', 'luatexja') -- 組方向
8282 userid_table.BOXB = luatexbase.newuserwhatsitid('box_boundary', 'luatexja') -- 「ボックス始め・終わり」
83+userid_table.JA_AL_BDD = luatexbase.newuserwhatsitid('ja_al_boundary', 'luatexja')
8384
8485 local dir_table = {}
8586 luatexja.dir_table = dir_table
旧リポジトリブラウザで表示