OSDN Git Service

updated documents, avoid errors in non-embedded fonts
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 30 Sep 2020 19:18:56 +0000 (04:18 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 30 Sep 2020 19:18:56 +0000 (04:18 +0900)
doc/luatexja-en.pdf
doc/luatexja-ja.pdf
src/ltj-jfont.lua
src/ltj-rmlgbm.lua

index 1078133..ee8235c 100644 (file)
Binary files a/doc/luatexja-en.pdf and b/doc/luatexja-en.pdf differ
index af10219..34affff 100644 (file)
Binary files a/doc/luatexja-ja.pdf and b/doc/luatexja-ja.pdf differ
index 254d8f0..6b7667a 100644 (file)
@@ -781,7 +781,7 @@ end
 ------------------------------------------------------------------------
 -- 追加のフォント情報
 ------------------------------------------------------------------------
-luatexja.jfont.font_extra_info= font_extra_info -- key: fontnumber
+luatexja.jfont.font_extra_info = font_extra_info -- key: fontnumber
 local font_extra_basename = {} -- key: basename
 
 local list_rotate_glyphs
@@ -873,12 +873,23 @@ do
          return bname
       end
    end
+   local dummytable = { } -- dummy
+   local dtvo, dtvh = {}, {}
+   setmetatable(dtvo, {__index = function () return 0.88 end } )
+   setmetatable(dtvh, {__index = function () return 1 end } )
+   ltjr.vert_addfunc = function(id, s)
+       if not dummytable.rotation then
+           dummytable = list_rotate_glyphs(s, dummytable)
+           dummytable.vorigin, dummytable.vheight = dtvo, dtvh
+       end
+   end
+   
    local function prepare_extra_data_font(id, res)
       if type(res)=='table' and (res.psname or res.filename) then
          local bname = res.psname or nameonly(res.filename)
          local t = font_extra_basename[bname]
          if not t then bname = prepare_extra_data_base(res) end
-         font_extra_info[id] = t or font_extra_basename[bname]
+         font_extra_info[id] = bname and (t or font_extra_basename[bname]) or dummytable
       end
    end
     luatexbase.add_to_callback(
@@ -895,9 +906,6 @@ do
       end,
       'ltj.prepare_extra_data', 1)
 
-   local nulltable = {} -- dummy
-   ltjr.vert_addfunc = function (n) font_extra_info[n] = nulltable end
-
    for i=1,font.nextid()-1 do
       local t = font.getfont(i)
       if t then
index 53f5b01..499d3ed 100644 (file)
@@ -291,7 +291,6 @@ local function mk_rml(name, size, id)
    local fontdata = {}
    local cachedata = {}
    local s = cidfont_data[cid_name]
-   luatexja.rmlgbm.vert_addfunc(id)
    for k, v in pairs(s) do
       fontdata[k] = v
       cachedata[k] = v
@@ -328,6 +327,7 @@ local function mk_rml(name, size, id)
       fontdata.characters = cache_chars[cid_name][size]
       cachedata.characters = cache_chars[cid_name][size]
    end
+   luatexja.rmlgbm.vert_addfunc(id, fontdata)
 
    -- other parameters
    do