From de91415cf4c05bd72a4dfad14623069ed016348e Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 21 Jan 2010 11:28:19 +0100 Subject: 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? --- luaotfload-fonts.lua | 16 +++++++++------- 1 file 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 -- cgit v1.2.3