diff options
| author | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-05-04 00:14:00 -0700 | 
|---|---|---|
| committer | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-05-04 00:14:00 -0700 | 
| commit | 213b9e54f678b56ec3b095a21dc527bc2293b9cc (patch) | |
| tree | 0768cd1518d0ffe568c0673fc1552082410c6227 | |
| parent | f349a934661594c945ad118d85cfd3a7b4a296b8 (diff) | |
| parent | 76830b0a04dbd8ce620edd79d6a18d3d4cb8bcf0 (diff) | |
| download | luaotfload-213b9e54f678b56ec3b095a21dc527bc2293b9cc.tar.gz | |
Merge pull request #40 from phi-gamma/master
fix issue #36
| -rw-r--r-- | luaotfload-auxiliary.lua | 28 | ||||
| -rw-r--r-- | luaotfload-database.lua | 2 | ||||
| -rw-r--r-- | luaotfload-features.lua | 12 | ||||
| -rwxr-xr-x | luaotfload-tool.lua | 7 | ||||
| -rw-r--r-- | luaotfload.dtx | 6 | 
5 files changed, 42 insertions, 13 deletions
| diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index 5ed7bb9..bf567e3 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -62,9 +62,9 @@ local add_fontdata_fallbacks = function (fontdata)        fontdata.units = fontdata.units_per_em      else --- otf        metadata = fontdata.shared.rawdata.metadata -      fontdata.units = fontparameters.units -      local resources      = fontdata.resources -      fontdata.size  = fontparameters.size +      fontdata.units   = fontparameters.units +      local resources  = fontdata.resources +      fontdata.size    = fontparameters.size        --- for legacy fontspec.lua and unicode-math.lua        fontdata.shared.otfdata          = metadata        fontdata.shared.otfdata.metadata = metadata --- brr, that’s meta indeed @@ -85,17 +85,18 @@ luatexbase.add_to_callback(  --[[doc-- -Additionally, the font registry is expected at fonts.identifiers, but -in the meantime it has been migrated to fonts.hashes.identifiers. -We’ll make luaotfload satisfy those assumptions. (Maybe it’d be more -appropriate to use font.getfont() since Hans made it a harmless wrapper -[1].) +Additionally, the font registry is expected at fonts.identifiers +(fontspec) or fonts.ids (microtype), but in the meantime it has been +migrated to fonts.hashes.identifiers.  We’ll make luaotfload satisfy +those assumptions. (Maybe it’d be more appropriate to use +font.getfont() since Hans made it a harmless wrapper [1].)  [1] http://www.ntg.nl/pipermail/ntg-context/2013/072166.html  --doc]]--  fonts.identifiers = fonts.hashes.identifiers +fonts.ids         = fonts.hashes.identifiers  --[[doc--  This sets two dimensions apparently relied upon by the unicode-math @@ -133,6 +134,7 @@ end  --[[doc--  This callback corrects some values of the Cambria font.  --doc]]-- +--- fontobj -> unit  local patch_cambria_domh = function (fontdata)    local mathconstants = fontdata.MathConstants    if mathconstants and fontdata.psname == "CambriaMath" then @@ -352,6 +354,16 @@ end  aux.provides_language = provides_language +--- fontspec apparently has the arguments shuffled +---     theirs:  id -> lang   -> script -> bool +---     ours:    id -> script -> lang   -> bool +--- whereas in the other check_* functions, script is +--- always the second argument ... +aux.provides_language_fontspec = function +                          (font_id, asked_language, asked_script) +  return provides_language(font_id, asked_script, asked_language) +end +  --[[doc--  We strip the syntax elements from feature definitions (shouldn’t  actually be there in the first place, but who cares ...) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index aaba55a..6f95208 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -116,6 +116,7 @@ Auxiliary functions  local report = logs.names_report +--- string -> string  local sanitize_string = function (str)      if str ~= nil then          return utf8gsub(utf8lower(str), "[^%a%d]", "") @@ -1537,6 +1538,7 @@ end  --- export functionality to the namespace “fonts.names”  names.flush_cache                 = flush_cache +names.save_lookups                = save_lookups  names.load                        = load_names  names.save                        = save_names  names.scan                        = scan_external_dir diff --git a/luaotfload-features.lua b/luaotfload-features.lua index 494d02d..cd00a0f 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -465,6 +465,18 @@ end  local handle_request = function (specification)      local request = lpegmatch(font_request,                                specification.specification) +    if not request then +        --- happens when called with an absolute path +        --- in an anonymous lookup; +        --- we try to behave as friendly as possible +        --- just go with it ... +        report("log", 0, "load", "invalid request “%s” of type anon", +            specification.specification) +        report("log", 0, "load", "use square bracket syntax or consult the documentation.") +        specification.name      = specification.specification +        specification.lookup    = "file" +        return specification +    end      local lookup, name = select_lookup(request)      request.features  = set_default_features(request.features) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index bb935cf..0833842 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -253,11 +253,10 @@ actions.generate = function (job)  end  actions.flush = function (job) -    local success, fontnames = names.flush_cache() +    local success, lookups = names.flush_cache()      if success then -        local savedname = names.save(fontnames) -        logs.names_report("info", 2, "cache", -            "Cache emptied", #fontnames.mappings) +        local savedname = names.save_lookups() +        logs.names_report("info", 2, "cache", "Cache emptied")          if savedname then              return true, true          end diff --git a/luaotfload.dtx b/luaotfload.dtx index 6daeece..fb57462 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -124,7 +124,11 @@ and the derived files  ]{hyperref}  \usepackage{fontspec}  %usepackage{unicode-math}%% broken -\setmainfont[Numbers=OldStyle,Ligatures=TeX]{Linux Libertine O} +\setmainfont[ +  Numbers=OldStyle, +  Ligatures=TeX, +  %SlantedFont={Linux Libertine Italic}, +]{Linux Libertine O}  \setmonofont[Ligatures=TeX,Scale=MatchLowercase]{Liberation Mono}  %setsansfont[Ligatures=TeX]{Linux Biolinum O}  \setsansfont[Ligatures=TeX,Scale=MatchLowercase]{Iwona Medium} | 
