diff options
author | Elie Roux <eroux@dedibox.ebzao.info> | 2010-01-21 11:28:19 +0100 |
---|---|---|
committer | Elie Roux <eroux@dedibox.ebzao.info> | 2010-01-21 11:28:19 +0100 |
commit | de91415cf4c05bd72a4dfad14623069ed016348e (patch) | |
tree | fb9e1b3495bbdb357cf9fd12c70e67292928f5ee | |
parent | f701c79f37af87fa87270b57953e8d8618e43bf8 (diff) | |
download | luaotfload-de91415cf4c05bd72a4dfad14623069ed016348e.tar.gz |
Changing the database shape
Now keys are font file names, in order to have all fonts listed (it
was not the case all the time). The values are raw_style and
guessed_style. Wdyt?
-rw-r--r-- | luaotfload-fonts.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/luaotfload-fonts.lua b/luaotfload-fonts.lua index 07b98d6..aba210d 100644 --- a/luaotfload-fonts.lua +++ b/luaotfload-fonts.lua @@ -80,7 +80,7 @@ local styles = { -- euristics to normalize the style local function normalize_style(style, family) local s = {} - if style:find("semibold") or style:find("demibold") or style:find("medium") + if style:find("semibold") or style:find("demibold") or style:find("lightbold") or style:match("lb$") then s.weight = "demibold" elseif style:find("bold") or style:find("heavy") or style:match("xb$") @@ -97,7 +97,7 @@ local function normalize_style(style, family) if style:find("regular") or style:match("rg$") then s.regular = true end - if style:find("caption") then + if style:find("caption") or style:find("capt") then s.size_type = 'caption' elseif style:find("display") or style:find("disp") then s.size_type = 'display' @@ -170,8 +170,12 @@ local function load_font(filename, names, texmf) if not fullinfo.style then fullinfo.style = sanitize(file.nameonly(filename)) end - fullinfo.style = normalize_style(fullinfo.style, fullinfo.family) - families[fullinfo.family][fullinfo.style] = {texmf and basename(filename) or filename} + local guessed = normalize_style(fullinfo.style, fullinfo.family) + families[fullinfo.family][texmf and basename(filename) or filename] = + { + guessed_style = guessed, + raw_style = fullinfo.style, + } psnames[fullinfo.psname] = {texmf and basename(filename) or filename} end else @@ -293,14 +297,12 @@ local function append_fccatdirs(fontdirs) if result then return result else - translate = cygwin_translate log(1, "fail") end else log(1, "unable to find TeXLive's fc-cat.exe") - translate = cygwin_translate end - --translate = cygwin_translate + translate = cygwin_translate elseif system == 'windows' then translate = windows_translate end |