diff options
| -rw-r--r-- | otfl-font-nms.lua | 42 | 
1 files changed, 16 insertions, 26 deletions
| diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index a5cdbb1..fa9edca 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -154,29 +154,23 @@ function names.resolve(specification)                      elseif subfamily == "regular" or                             table.contains(synonyms.regular, subfamily) then                          found.fallback = face -                    elseif name == fullname then -                      --- guard for Libertine Mono which has -                      --- subtype == “mono” -                      found[1] = face -                      break                      end -                else -                    if name == fullname -                    or name == pfullname -                    or name == fontname -                    or name == psname then -                        if optsize then -                            if dsnsize == size -                            or (size > minsize and size <= maxsize) then -                                found[1] = face -                                break -                            else -                                found[#found+1] = face -                            end -                        else +                end +                if name == fullname +                or name == pfullname +                or name == fontname +                or name == psname then +                    if optsize then +                        if dsnsize == size +                        or (size > minsize and size <= maxsize) then                              found[1] = face                              break +                        else +                            found[#found+1] = face                          end +                    else +                        found[1] = face +                        break                      end                  end              end @@ -362,9 +356,7 @@ local function load_font(filename, fontnames, newfontnames, texmf)                          return                      end                      local index = newstatus[basefile].index[i] -                    if newstatus[basefile].index[i] then -                        index = newstatus[basefile].index[i] -                    else +                    if not index then                          index = #newmappings+1                      end                      newmappings[index]           = fullinfo @@ -375,10 +367,8 @@ local function load_font(filename, fontnames, newfontnames, texmf)                  if not fullinfo then                      return                  end -                local index -                if newstatus[basefile].index[1] then -                    index = newstatus[basefile].index[1] -                else +                local index = newstatus[basefile].index[1] +                if not index then                      index = #newmappings+1                  end                  newmappings[index]           = fullinfo | 
