• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョンf078ac2f7998a102c7ec765e725f2269eed9f872 (tree)
日時2019-07-26 06:58:51
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

Fix #39431: support notdef=... (introduced in luaotfload v2.98)

変更サマリ

差分

--- a/src/ltj-jfmglue.lua
+++ b/src/ltj-jfmglue.lua
@@ -3,7 +3,7 @@
33 --
44 luatexbase.provides_module({
55 name = 'luatexja.jfmglue',
6- date = '2018/08/11',
6+ date = '2019/07/26',
77 description = 'Insertion process of JFM glues, [x]kanjiskip and others',
88 })
99 luatexja.jfmglue = luatexja.jfmglue or {}
@@ -267,7 +267,7 @@ luatexbase.create_callback("luatexja.jfmglue.whatsit_after", "data",
267267
268268 -- calc next Np
269269 local calc_np
270-do
270+do -- 001 -----------------------------------------------
271271
272272 local traverse = node.direct.traverse
273273 local function check_next_ickern(lp)
@@ -306,21 +306,40 @@ local function calc_np_pbox(lp, last)
306306 return lp
307307 end
308308
309-local ltjw_apply_ashift_math = ltjw.apply_ashift_math
310-local ltjw_apply_ashift_disc = ltjw.apply_ashift_disc
311-local min, max = math.min, math.max
312-local function calc_np_aux_glyph_common(lp, acc_flag)
313- Np.nuc = lp
314- Np.first= (Np.first or lp)
315- if if_lang_ja(lp) then
309+local calc_np_aux_glyph_common
310+do -- 002 ---------------------------------------
311+ local min, max = math.min, math.max
312+ local getwhd = node.direct.getwhd
313+ local attr_jchar_class = luatexbase.attributes['ltj@charclass']
314+ local attr_jchar_code = luatexbase.attributes['ltj@charcode']
315+ local identifiers = fonts.hashes.identifiers
316+ local function calc_np_notdef(lp)
317+ local ident = identifiers[getfont(lp)]
318+ if not ident.characters[getchar(p)] then
319+ local ln = node_next(lp)
320+ if (ident.shared and ident.shared.features and ident.shared.features.notdef)
321+ and ln and getid(ln)==id_char then
322+ set_attr(lp, attr_icflag, PROCESSED)
323+ set_attr(ln, attr_jchar_code, has_attr(lp, attr_jchar_code) or getchar(lp))
324+ set_attr(ln, attr_jchar_class, has_attr(lp, attr_jchar_class) or 0)
325+ Np.nuc, lp = ln, ln
326+ end
327+ end
328+ return lp
329+ end
330+function calc_np_aux_glyph_common(lp, acc_flag)
331+ Np.nuc, Np.first = lp, (Np.first or lp)
332+ if if_lang_ja(lp) then -- JAchar
316333 Np.id = id_jglyph
317334 local m, mc, cls = set_np_xspc_jachar(Np, lp)
318335 local npi, npf
336+ local w, h, d = getwhd(lp)
337+ if w==0 and h==0 and d==0 then lp = calc_np_notdef(lp) end
319338 lp, head, npi, npf = capsule_glyph(lp, m, mc[cls], head, tex_dir)
320339 Np.first = (Np.first~=Np.nuc) and Np.first or npf or npi
321340 Np.nuc = npi
322341 return true, check_next_ickern(lp);
323- else
342+ else --ALchar
324343 Np.id = id_glyph
325344 set_np_xspc_alchar(Np, getchar(lp), lp, 1)
326345 -- loop
@@ -403,8 +422,11 @@ local function calc_np_aux_glyph_common(lp, acc_flag)
403422 return true, lp
404423 end
405424 end
425+end -- 002 ---------------------------------------
406426 local calc_np_auxtable
407-do
427+do -- 002 ---------------------------------------
428+local ltjw_apply_ashift_math = ltjw.apply_ashift_math
429+local ltjw_apply_ashift_disc = ltjw.apply_ashift_disc
408430 local node_end_of_math = node.direct.end_of_math
409431 local dir_tate = luatexja.dir_table.dir_tate
410432 local sid_start_link = node.subtype('pdf_start_link')
@@ -513,7 +535,7 @@ calc_np_auxtable = {
513535 return false, node_next(lp)
514536 end,
515537 }
516-end
538+end -- 002 ---------------------------------------
517539 calc_np_auxtable[id_rule] = calc_np_auxtable.box_like
518540 calc_np_auxtable[15] = calc_np_auxtable.box_like
519541
@@ -551,7 +573,7 @@ function calc_np(last, lp)
551573 end
552574 Np=nil
553575 end
554-end
576+end -- 001 -----------------------------------------------
555577
556578 -- extract informations from Np
557579 -- We think that "Np is a Japanese character" if Np.met~=nil,
--- a/src/ltj-pretreat.lua
+++ b/src/ltj-pretreat.lua
@@ -43,7 +43,6 @@ local attr_icflag = luatexbase.attributes['ltj@icflag']
4343 local is_ucs_in_japanese_char = ltjc.is_ucs_in_japanese_char_direct
4444 local ltjs_orig_char_table = ltjs.orig_char_table
4545 local ltjf_replace_altfont = ltjf.replace_altfont
46-local attr_orig_char = luatexbase.attributes['ltj@origchar']
4746 local STCK = luatexja.userid_table.STCK
4847 local DIR = luatexja.userid_table.DIR
4948 local PROCESSED_BEGIN_FLAG = luatexja.icflag_table.PROCESSED_BEGIN_FLAG
--- a/src/luatexja-core.sty
+++ b/src/luatexja-core.sty
@@ -137,7 +137,6 @@
137137 \newattribute\ltj@icflag % attribute for italic correction
138138 \newattribute\ltj@curjfnt % index for ``current horizontal Japanese font''
139139 \newattribute\ltj@curtfnt % index for ``current vertical Japanese font''
140-\newattribute\ltj@origchar %
141140 \newattribute\ltj@charclass %
142141 \newattribute\ltj@charcode %
143142 \newattribute\ltj@autospc % attribute for autospacing
@@ -153,7 +152,6 @@
153152 \newlanguage\ltj@@japanese
154153 \ltj@dir\z@
155154 \ltj@icflag\z@
156-\ltj@origchar\z@
157155 \ltj@charclass\z@
158156 \ltj@curjfnt\m@ne
159157 \ltj@curtfnt\m@ne
旧リポジトリブラウザで表示