• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョンebce39476872ee236b46b375c63798c523b6e1d7 (tree)
日時2019-09-12 05:26:02
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

more

変更サマリ

差分

--- a/src/ltj-lotf_aux.lua
+++ b/src/ltj-lotf_aux.lua
@@ -48,6 +48,29 @@ function aux.get_vheight(id, c) -- scaled points
4848 end
4949 end
5050
51+function aux.replace_vert_variant(id, c)
52+ local t = getfont(id)
53+ if t and t.resources and t.resources.sequences then
54+ for _,i in pairs(t.resources.sequences) do
55+ if (i.order[1]=='vert' or i.order[1]=='vrt2')
56+ and i.type == 'gsub_single' and i.steps then
57+ for _,j in pairs(i.steps) do
58+ if type(j)=='table' then
59+ if type(j.coverage)=='table' then
60+ for i,k in pairs(j.coverage) do
61+ if i==c then return k end
62+ end
63+ end
64+ end
65+ end
66+ end
67+ end
68+ end
69+ return c
70+end
71+
72+
73+
5174 local search
5275 search = function (t, key, prefix)
5376 if type(t)=="table" then
--- a/src/ltj-otf.lua
+++ b/src/ltj-otf.lua
@@ -10,6 +10,7 @@ luatexja.load_module('rmlgbm'); local ltjr = luatexja.rmlgbm
1010 luatexja.load_module('charrange'); local ltjc = luatexja.charrange
1111 luatexja.load_module('direction'); local ltjd = luatexja.direction
1212 luatexja.load_module('stack'); local ltjs = luatexja.stack
13+luatexja.load_module('lotf_aux'); local ltju = luatexja.lotf_aux
1314
1415 local id_glyph = node.id('glyph')
1516 local id_whatsit = node.id('whatsit')
@@ -104,25 +105,9 @@ local function get_ucs_from_rmlgbm(c)
104105 end
105106 if aj.shared.ltj_vert_table[r] then
106107 -- CID が縦組用字形だった場合
107- local curjfnt_num = tex_get_attr((ltjd_get_dir_count()==dir_tate)
108- and attr_curtfnt or attr_curjfnt)
109- local t = font_getfont(curjfnt_num)
110- if t.resources.sequences then
111- for _,i in pairs(t.resources.sequences) do
112- if (i.order[1]=='vert' or i.order[1]=='vrt2')
113- and i.type == 'gsub_single' and i.steps then
114- for _,j in pairs(i.steps) do
115- if type(j)=='table' then
116- if type(j.coverage)=='table' then
117- for i,k in pairs(j.coverage) do
118- if i==r then return k end
119- end
120- end
121- end
122- end
123- end
124- end
125- end
108+ return ltju.replace_vert_variant(
109+ tex_get_attr((ltjd_get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt),
110+ r)
126111 end
127112 return r
128113 end
@@ -141,29 +126,12 @@ end
141126 local utf
142127 do
143128 utf = function (ucs)
144- local char = ucs
145129 if ltjd_get_dir_count()==dir_tate then
146- local curjfnt_num = tex_get_attr((ltjd_get_dir_count()==dir_tate)
147- and attr_curtfnt or attr_curjfnt)
148- local t = font_getfont(curjfnt_num)
149- if t.resources.sequences then
150- for _,i in pairs(t.resources.sequences) do
151- if (i.order[1]=='vert' or i.order[1]=='vrt2')
152- and i.type == 'gsub_single' and i.steps then
153- for _,j in pairs(i.steps) do
154- if type(j)=='table' then
155- if type(j.coverage)=='table' then
156- for i,k in pairs(j.coverage) do
157- if i==char then return append_jglyph(k) end
158- end
159- end
160- end
161- end
162- end
163- end
164- end
130+ ucs = ltju.replace_vert_variant(
131+ tex_get_attr((ltjd_get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt),
132+ ucs)
165133 end
166- return append_jglyph(char)
134+ return append_jglyph(ucs)
167135 end
168136 end
169137
旧リポジトリブラウザで表示