• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ソースコードの管理場所


コミットメタ情報

リビジョン7e79c030be542ca5e2c00e69a3395780418ec4f7 (tree)
日時2019-09-14 08:45:34
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

jpotf was broken in recent commits

変更サマリ

差分

--- a/src/ltj-jfont.lua
+++ b/src/ltj-jfont.lua
@@ -854,22 +854,7 @@ do
854854 [0x300C]=0xFE41, [0x300D]=0xFE42, [0x300E]=0xFE43, [0x300F]=0xFE44,
855855 [0xFF3B]=0xFE47, [0xFF3D]=0xFE48,
856856 }
857- local vert_jpotf_table = {}
858- local function add_vform(i, k, vform, ft, add_vert, jpotf_vert)
859- if type(coverage)~='table' then return end
860- for i,v in pairs(vert_form_table) do
861- if not coverage[i] and ft.characters[v] then vform[i] = v end
862- end
863- if jpotf_vert then
864- for i,v in pairs(vert_jpotf_table) do
865- if ft.characters[v] then vform[i] = coverage[v] or vform[v] or v end
866- end
867- end
868- if add_vert then -- vert feature が有効にならない場合
869- for i,v in pairs(coverage) do vform[i] = vform[i] or v end
870- end
871- end
872-
857+ local vert_jpotf_table, vert_feat = {}, {vert=true}
873858 local utfbyte, utfsub = utf.byte, utf.sub
874859 luatexja.jfont.register_vert_replace = function(t)
875860 for i,v in pairs(t) do
@@ -887,20 +872,25 @@ luatexbase.add_to_callback(
887872 function (fmtable, fnum)
888873 local vform = {}; fmtable.vform = vform
889874 local t = font_getfont(fnum)
890- if t.specification and t.resources then
891- local add_vert = not ltju.exist_feature(fnum, 'vert') and not ltju.exist_feature(fnum, 'vrt2')
892- local jpotf_vert = ltju.specified_feature(fnum, 'jpotf')
893- -- 現在の language, script で vert もvrt2 も有効にできない場合,強制的に vert 適用
894- for _,i in pairs(t.resources.sequences) do
895- if i.order[1]== 'vert' and i.type == 'gsub_single' and i.steps then
896- for _,j in pairs(i.steps) do
897- if type(j)=='table' then
898- add_vform(j.coverage,vform, t, add_vert, jpotf_vert)
899- end
900- end
901- end
902- end
875+ if not t then return fmtable end
876+ for i,v in pairs(vert_form_table) do
877+ if t.characters[v] then vform[i] = v end
878+ end
879+ if ltju.specified_feature(fnum, 'jpotf') then
880+ for i,v in pairs(vert_jpotf_table) do
881+ if t.characters[v] then vform[i] = vform[v] or v end
882+ end
883+ end
884+ if not ltju.exist_feature(fnum, 'vert') and not ltju.exist_feature(fnum, 'vrt2') then
885+ -- 現在の (script, lang) で vert もvrt2 も有効にできない場合,
886+ -- 全 (script,lang) の vert を強制的に適用
887+ ltju.loop_over_feat(t, vert_feat, function (i,k) vform[i] = vform[i] or k end, true)
903888 end
889+ -- vform の中身を vert 適用結果に変える
890+ ltju.loop_over_feat(t, vert_feat,
891+ function (i,k)
892+ for j,w in pairs(vform) do if w==k then vform[j]=nil elseif w==i then vform[j] = k end end
893+ end)
904894 return fmtable
905895 end, 'ltj.get_vert_form', 1
906896 )
--- a/src/ltj-lotf_aux.lua
+++ b/src/ltj-lotf_aux.lua
@@ -83,16 +83,17 @@ local function loop_over_duplicates(id, func)
8383 end
8484 aux.loop_over_duplicates = loop_over_duplicates
8585
86-local function loop_over_feat(id, feature_name, func)
86+local function loop_over_feat(id, feature_name, func, universal)
8787 -- feature_name: like { vert=true, vrt2 = true, ...}
8888 -- func: return non-nil iff abort this fn
89+-- universal: true iff look up all (script, lang) pair
8990 local t = (type(id)=="table") and id or getfont(id)
9091 if t and t.resources and t.resources.sequences then
9192 for _,i in pairs(t.resources.sequences) do
9293 if i.order[1] and feature_name[i.order[1]] then
9394 local f = i.features and i.features[i.order[1]]
9495 if i.type == 'gsub_single' and i.steps
95- and f and f[t.properties.script] and f[t.properties.script][t.properties.language] then
96+ and f and (universal or (f[t.properties.script] and f[t.properties.script][t.properties.language])) then
9697 for _,j in pairs(i.steps) do
9798 if type(j)=='table' then
9899 if type(j.coverage)=='table' then