OSDN Git Service

removed unecessary data
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 3 Jul 2019 06:05:50 +0000 (15:05 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 3 Jul 2019 06:05:50 +0000 (15:05 +0900)
src/ltj-jfont.lua
src/ltj-setwidth.lua

index 3bcabf7..7bdbb2a 100644 (file)
@@ -813,8 +813,6 @@ do
       local flds = fields(glyph)
       local vw, tsb, vk = nil, nil, nil
       for _,i in ipairs(flds) do
-         if i=='vwidth' then vw = glyph.vwidth end
-         if i=='tsidebearing' then tsb = glyph.tsidebearing end
          if i=='vkerns' then vk = glyph.vkerns end
       end
       return vw, tsb, vk
@@ -849,14 +847,6 @@ do
             -- vertical metric
             local vw, tsb, vk = glyph_vmetric(gv)
             local gi = unitable[gv.name]
-            if gi and vw and vw~=asc_des then
-               -- We do not use tsidebearing, since (1) fontloader does not read VORG table
-               -- and (2) 'tsidebearing' doea not appear in the returned table by fontloader.fields.
-               -- Hence, we assume that vertical origin == ascender
-               -- (see capsule_glyph_tate in ltj-setwidth.lua)
-               dest = dest or {}; dest[gi] = dest[gi] or {}
-               dest[gi].vwidth = vw/units
-            end
             -- vertical kern
             if gi and vk then
                dest = dest or {};
index 83a4644..4e7ffa2 100644 (file)
@@ -183,10 +183,14 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
            return capsule_glyph_tate_rot(p, met, char_data, head, dir, 0.5*(ascent-descent))
         end
       end
-      pwidth = (cei and cei.vwidth) and cei.vwidth * met.size or (ascent+descent)
+      local ident = fonts.hashes.identifiers[pf]
+      pwidth = (ident.descriptions and ident.descriptions[pc] 
+         and (ident.descriptions[pc].vheight / ident.units * met.size))
+         or (ascent+descent)
       pwidth = pwidth + (met.v_advance[pc] or 0)
       ascent = met.v_origin[pc] and ascent - met.v_origin[pc] or ascent
    end
+   print(fwidth, pwidth)
    fwidth = fwidth or pwidth
    fshift.down = char_data.down; fshift.left = char_data.left
    fshift = call_callback("luatexja.set_width", fshift, met, char_data)