OSDN Git Service

Cherry-picked several commits from kitagawa_tfont branch
[luatex-ja/luatexja.git] / src / ltj-jfmglue.lua
index 9486c32..6b2fb95 100644 (file)
@@ -105,7 +105,7 @@ local slow_find_char_class
 do
    slow_find_char_class = function (c, m, oc)
       local cls = ltjf_find_char_class(oc, m)
-      if not c and  cls==0 then 
+      if cls==0 then 
         return ltjf_find_char_class(-c, m), oc
       else
         return cls, oc
@@ -534,7 +534,7 @@ end
 local function handle_penalty_always(post, pre, g)
    local a = (pre or 0) + (post or 0)
    if #Bp == 0 then
-      if not (g and getid(g)==id_glue) then
+      if not (g and getid(g)==id_glue) or a~=0 then
         local p = node_new(id_penalty)
         if a<-10000 then a = -10000 elseif a>10000 then a = 10000 end
         setfield(p, 'penalty', a)