OSDN Git Service

fix "Command `\colon' already defined" error when fontspec is loaded without no-math...
[luatex-ja/luatexja.git] / src / ltj-jfont.lua
index 3c028af..3679ad1 100644 (file)
@@ -371,7 +371,7 @@ do
       if jfm_dir == 'tate' then
         is_vert_enabled = (not name:match('[:;]%-vert')) and (not  name:match('[:;]%-vrt2'))
          if not name:match('vert') and not name:match('vrt2') then
-            name = name .. ';vert;vrt2'
+            name = name .. ';+vert;+vrt2'
          end
       else
         is_vert_enabled = nil
@@ -385,6 +385,7 @@ do
    function luatexja.font_callback(name, size, id)
       local new_name = is_def_jfont and extract_metric(name) or name
       is_def_jfont = false
+      --local res =  otfl_fdr(new_name, size, id)
       local res =  ltjr_font_callback(new_name, size, id, otfl_fdr)
       luatexbase.call_callback('luatexja.define_font', res, new_name, size, id)
       -- this callback processes variation selector, so we execute it always
@@ -698,7 +699,7 @@ do
    local function add_fl_table(dest, glyphs, unitable, asc_des, units)
       local tg, glyphmin, glyphmax = glyphs.glyphs, 0, glyphs.glyphmax
       for _,v in pairs(fields(glyphs)) do
-        if v=='glyphmin' then glyphmin = glyphs.glyphmin; break end
+        if v=='glyphmin' then glyphmin, glyphmax = glyphs.glyphmin, glyphmax+1; break end
       end
       for i = glyphmin, glyphmax-1 do
         local gv = tg[i]
@@ -969,8 +970,10 @@ do
            if h then
               local g = node_new(id_kern)
               setfield(g, 'subtype', 1); set_attr(g, attr_icflag, ITALIC)
-              setfield(g, 'kern', h.characters[getchar(p)].italic)
-              node_write(g); ensure_tex_attr(attr_icflag, 0)
+              if h.characters[getchar(p)] and h.characters[getchar(p)].italic then 
+                 setfield(g, 'kern', h.characters[getchar(p)].italic)
+                 node_write(g); ensure_tex_attr(attr_icflag, 0)
+              end
            end
         end
       end