diff options
author | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-04-27 03:09:21 -0700 |
---|---|---|
committer | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-04-27 03:09:21 -0700 |
commit | 5649f93c8847b0721ab2f70a0ebc45a1659f533d (patch) | |
tree | 46b47d71e5275743787be46d37affec57e53ae4b | |
parent | ba002a79408a2c5384c906675a035f7aa819fcdf (diff) | |
parent | 2ebaa29db6309416a358fef692d5d35c48e9377c (diff) | |
download | luaotfload-5649f93c8847b0721ab2f70a0ebc45a1659f533d.tar.gz |
Merge pull request #12 from lualatex/texlive2011
Texlive2011
-rw-r--r-- | otfl-font-nms.lua | 42 | ||||
-rw-r--r-- | tests/fontconfig_conf_reading.tex | 5 |
2 files changed, 20 insertions, 27 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 diff --git a/tests/fontconfig_conf_reading.tex b/tests/fontconfig_conf_reading.tex index dbbbc3c..7ffda02 100644 --- a/tests/fontconfig_conf_reading.tex +++ b/tests/fontconfig_conf_reading.tex @@ -1,6 +1,9 @@ \directlua{ require("lualibs") require("otfl-font-nms.lua") -texio.write_nl(table.serialize(fonts.names.read_fonts_conf("fonts.conf.test", {}))) +local res = fonts.names.read_fonts_conf("fonts.conf.test", {}, {}) +if res then + texio.write_nl(table.serialize(res)) +end } \bye |