• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョンf8fad384d02f7f79bf591e967a9476d897bc9a15 (tree)
日時2019-05-03 06:22:12
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

\CID for non-AJ1 font

変更サマリ

差分

--- a/src/ltj-otf.lua
+++ b/src/ltj-otf.lua
@@ -82,21 +82,27 @@ local function get_ucs_from_rmlgbm(c)
8282 elseif v<0xF0000 then -- 素直に Unicode にマップ可能
8383 return v
8484 else -- privete use area
85- local w = ltjr_cidfont_data["Adobe-Japan1"].characters[v]. tounicode
86- -- must be non-nil!
87- local i = string.len(w)
88- local r
89- if i==4 then -- UCS2
90- r = tonumber(w,16)
91- elseif i==8 then
92- i,w = tonumber(string.sub(w,1,4),16), tonumber(string.sub(w,-4),16)
93- if (w>=0xD800) and (w<=0xDB7F) and (i>=0xDC00) and (i<=0xDFFF) then -- Surrogate pair
94- r = (w-0xD800)*0x400 + (i-0xDC00)
95- else
96- r = 0
85+ local r, aj = nil, ltjr_cidfont_data["Adobe-Japan1"]
86+ -- 先に ltj_vert_table を見る
87+ for i,w in pairs(aj.shared.ltj_vert_table) do
88+ if w==v then r=i; break end
89+ end
90+ if not r then
91+ -- なければ ToUnicode から引く
92+ local w = aj.characters[v].tounicode -- must be non-nil!
93+ local i = string.len(w)
94+ if i==4 then -- UCS2
95+ r = tonumber(w,16)
96+ elseif i==8 then
97+ i,w = tonumber(string.sub(w,1,4),16), tonumber(string.sub(w,-4),16)
98+ if (w>=0xD800) and (w<=0xDB7F) and (i>=0xDC00) and (i<=0xDFFF) then -- Surrogate pair
99+ r = (w-0xD800)*0x400 + (i-0xDC00)
100+ else
101+ r = 0
102+ end
97103 end
98104 end
99- if ltjr_cidfont_data["Adobe-Japan1"].shared.ltj_vert_table[r] then
105+ if aj.shared.ltj_vert_table[r] then
100106 -- CID が縦組用字形だった場合
101107 local curjfnt_num = tex_get_attr((ltjd_get_dir_count()==dir_tate)
102108 and attr_curtfnt or attr_curjfnt)
旧リポジトリブラウザで表示