From 298dffaece66c307f9dcbfb23bba855385aa7132 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 17:19:53 +0100 Subject: [main] fix path resolver Close #162 --- luaotfload.dtx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index adbdf26..08f56af 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -2078,13 +2078,14 @@ request_resolvers.path = function (specification) name) file_resolver (specification) else - local suffix = filesuffix (name) - if formats[suffix] then - specification.forced = suffix - specification.name = file.removesuffix(name) - else - specification.name = name - end + local suffix = filesuffix (name) + if formats[suffix] then + specification.forced = suffix + specification.name = file.removesuffix(name) + specification.forcedname = name + else + specification.name = name + end end end -- cgit v1.2.3 From 118a01f6103d2d80e6c18bf9f7640ecf23c04cd4 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:01:48 +0100 Subject: [*] annihilate legacy code --- luaotfload-legacy-attributes.lua | 27 - luaotfload-legacy-database.lua | 724 ---- luaotfload-legacy-merged.lua | 8157 -------------------------------------- luaotfload-legacy-tool.lua | 105 - luaotfload-legacy.lua | 402 -- 5 files changed, 9415 deletions(-) delete mode 100644 luaotfload-legacy-attributes.lua delete mode 100644 luaotfload-legacy-database.lua delete mode 100644 luaotfload-legacy-merged.lua delete mode 100755 luaotfload-legacy-tool.lua delete mode 100644 luaotfload-legacy.lua diff --git a/luaotfload-legacy-attributes.lua b/luaotfload-legacy-attributes.lua deleted file mode 100644 index c6130b4..0000000 --- a/luaotfload-legacy-attributes.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------ --- FILE: otfl-luat-att.lua --- USAGE: with old luaotfload --- DESCRIPTION: setting attributes abide luatexbase rules --- REQUIREMENTS: some old luatex --- AUTHOR: Philipp Gesang (Phg), --- CREATED: 2013-05-10 20:37:19+0200 ------------------------------------------------------------------------ --- - -if not modules then modules = { } end modules ['otfl-luat-att'] = { - version = math.pi/42, - comment = "companion to luaotfload.lua", - author = "Philipp Gesang", - copyright = "Luaotfload Development Team", - license = "GNU GPL v2" -} - -function attributes.private(name) - local attr = "otfl@" .. name - local number = luatexbase.attributes[attr] - if not number then - number = luatexbase.new_attribute(attr) - end - return number -end - diff --git a/luaotfload-legacy-database.lua b/luaotfload-legacy-database.lua deleted file mode 100644 index b31fe88..0000000 --- a/luaotfload-legacy-database.lua +++ /dev/null @@ -1,724 +0,0 @@ -if not modules then modules = { } end modules ['font-nms'] = { - version = "old", - comment = "companion to luaotfload.lua", - author = "Khaled Hosny and Elie Roux", - copyright = "Luaotfload Development Team", - license = "GNU GPL v2" -} - -fonts = fonts or { } -fonts.names = fonts.names or { } - -local names = fonts.names -local names_dir = "luatex-cache/generic/names" -names.version = "old" -- not the same as in context -names.data = nil -names.path = { - basename = "otfl-names.lua", --- different from current - localdir = file.join(kpse.expand_var("$TEXMFVAR"), names_dir), - systemdir = file.join(kpse.expand_var("$TEXMFSYSVAR"), names_dir), -} - - -local splitpath, expandpath = file.split_path, kpse.expand_path -local glob, basename = dir.glob, file.basename -local upper, lower, format = string.upper, string.lower, string.format -local gsub, match, rpadd = string.gsub, string.match, string.rpadd -local gmatch, sub, find = string.gmatch, string.sub, string.find -local utfgsub = unicode.utf8.gsub - -local trace_short = false --tracing adapted to rebuilding of the database inside a document -local trace_search = false --trackers.register("names.search", function(v) trace_search = v end) -local trace_loading = false --trackers.register("names.loading", function(v) trace_loading = v end) - -local function sanitize(str) - if str then - return utfgsub(lower(str), "[^%a%d]", "") - else - return str -- nil - end -end - -local function fontnames_init() - return { - mappings = { }, - status = { }, - version = names.version, - } -end - -local function load_names() - local localpath = file.join(names.path.localdir, names.path.basename) - local systempath = file.join(names.path.systemdir, names.path.basename) - local kpsefound = kpse.find_file(names.path.basename) - local foundname - local data - if kpsefound and file.isreadable(kpsefound) then - data = dofile(kpsefound) - foundname = kpsefound - elseif file.isreadable(localpath) then - data = dofile(localpath) - foundname = localpath - elseif file.isreadable(systempath) then - data = dofile(systempath) - foundname = systempath - end - if data then - logs.info("Font names database loaded: " .. foundname) - else - logs.info([[Font names database not found, generating new one. - This can take several minutes; please be patient.]]) - data = names.update(fontnames_init()) - names.save(data) - end - return data -end - -local synonyms = { - regular = { "normal", "roman", "plain", "book", "medium" }, - -- boldregular was for old versions of Linux Libertine, is it still useful? - -- semibold is in new versions of Linux Libertine, but there is also a bold, - -- not sure it's useful here... - bold = { "demi", "demibold", "semibold", "boldregular" }, - italic = { "regularitalic", "normalitalic", "oblique", "slanted" }, - bolditalic = { "boldoblique", "boldslanted", "demiitalic", "demioblique", "demislanted", "demibolditalic", "semibolditalic" }, -} - -local loaded = false -local reloaded = false - -function names.resolve(specification) - local name = sanitize(specification.name) - local style = sanitize(specification.style) or "regular" - - local size - if specification.optsize then - size = tonumber(specification.optsize) - elseif specification.size then - size = specification.size / 65536 - end - - - if not loaded then - names.data = names.load() - loaded = true - end - - local data = names.data - if type(data) == "table" and data.version == names.version then - if data.mappings then - local found = { } - for _,face in next, data.mappings do - local family, subfamily, fullname, psname - local optsize, dsnsize, maxsize, minsize - - if face.names then - family = sanitize(face.names.family) - subfamily = sanitize(face.names.subfamily) - fullname = sanitize(face.names.fullname) - psname = sanitize(face.names.psname) - end - local fontname = sanitize(face.fontname) - local pfullname = sanitize(face.fullname) - if #face.size > 0 then - optsize = face.size - dsnsize = optsize[1] and optsize[1] / 10 - -- can be nil - maxsize = optsize[2] and optsize[2] / 10 or dsnsize - minsize = optsize[3] and optsize[3] / 10 or dsnsize - end - if name == family then - if subfamily == style 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 - elseif synonyms[style] and - table.contains(synonyms[style], subfamily) 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 - elseif subfamily == "regular" or - table.contains(synonyms.regular, subfamily) then - found.fallback = face - elseif 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 - 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 - found[1] = face - break - end - end - end - end - if #found == 1 then - if kpse.lookup(found[1].filename[1]) then - logs.report("load font", - "font family='%s', subfamily='%s' found: %s", - name, style, found[1].filename[1]) - return found[1].filename[1], found[1].filename[2] - elseif lfs.isfile(found[1].found_at) then - logs.report("load font", - "font family='%s', subfamily='%s' found: %s", - name, style, found[1].found_at) - return found[1].found_at, found[1].filename[2] - end - elseif #found > 1 then - -- we found matching font(s) but not in the requested optical - -- sizes, so we loop through the matches to find the one with - -- least difference from the requested size. - local closest - local least = math.huge -- initial value is infinity - for i,face in next, found do - local dsnsize = face.size[1]/10 - local difference = math.abs(dsnsize-size) - if difference < least then - closest = face - least = difference - end - end - if kpse.lookup(closest.filename[1]) then - logs.report("load font", - "font family='%s', subfamily='%s' found: %s", - name, style, closest.filename[1]) - return closest.filename[1], closest.filename[2] - elseif lfs.isfile(closest.found_at) then - logs.report("load font", - "font family='%s', subfamily='%s' found: %s", - name, style, closest.found_at) - return closest.found_at, closest.filename[2] - end - elseif found.fallback then - return found.fallback.filename[1], found.fallback.filename[2] - end - -- no font found so far - if not reloaded then - -- try reloading the database - names.data = names.update(names.data) - names.save(names.data) - reloaded = true - return names.resolve(specification) - else - -- else, fallback to filename - return specification.name, false - end - end - else - if not reloaded then - names.data = names.update() - names.save(names.data) - reloaded = true - return names.resolve(specification) - else - return specification.name, false - end - end -end - -names.resolvespec = names.resolve - -function names.set_log_level(level) - if level == 2 then - trace_loading = true - elseif level >= 3 then - trace_loading = true - trace_search = true - end -end - -local lastislog = 0 - -local function log(fmt, ...) - lastislog = 1 - texio.write_nl(format("luaotfload | %s", format(fmt,...))) - io.flush() -end - -logs = logs or { } -logs.report = logs.report or log -logs.info = logs.info or log - -local function font_fullinfo(filename, subfont, texmf) - local found_at = filename - local t = { } - local f = fontloader.open(filename, subfont) - if not f then - if trace_loading then - logs.report("error: failed to open %s", filename) - end - return - end - local m = fontloader.to_table(f) - fontloader.close(f) - collectgarbage('collect') - -- see http://www.microsoft.com/typography/OTSPEC/features_pt.htm#size - if m.fontstyle_name then - for _,v in next, m.fontstyle_name do - if v.lang == 1033 then - t.fontstyle_name = v.name - end - end - end - if m.names then - for _,v in next, m.names do - if v.lang == "English (US)" then - t.names = { - -- see - -- http://developer.apple.com/textfonts/ - -- TTRefMan/RM06/Chap6name.html - fullname = v.names.compatfull or v.names.fullname, - family = v.names.preffamilyname or v.names.family, - subfamily= t.fontstyle_name or v.names.prefmodifiers or v.names.subfamily, - psname = v.names.postscriptname - } - end - end - else - -- no names table, propably a broken font - if trace_loading then - logs.report("broken font rejected: %s", basefile) - end - return - end - t.fontname = m.fontname - t.fullname = m.fullname - t.familyname = m.familyname - t.filename = { texmf and basename(filename) or filename, subfont } - t.weight = m.pfminfo.weight - t.width = m.pfminfo.width - t.slant = m.italicangle - -- don't waste the space with zero values - t.size = { - m.design_size ~= 0 and m.design_size or nil, - m.design_range_top ~= 0 and m.design_range_top or nil, - m.design_range_bottom ~= 0 and m.design_range_bottom or nil, - } - -- rather, waste space on paths - t.found_at = found_at - return t -end - -local function load_font(filename, fontnames, newfontnames, texmf) - local newmappings = newfontnames.mappings - local newstatus = newfontnames.status - local mappings = fontnames.mappings - local status = fontnames.status - local basefile = texmf and basename(filename) or filename - if filename then - if table.contains(names.blacklist, filename) or - table.contains(names.blacklist, basename(filename)) then - if trace_search then - logs.report("ignoring font '%s'", filename) - end - return - end - local timestamp, db_timestamp - db_timestamp = status[basefile] and status[basefile].timestamp - timestamp = lfs.attributes(filename, "modification") - - local index_status = newstatus[basefile] or (not texmf and newstatus[basename(filename)]) - if index_status and index_status.timestamp == timestamp then - -- already indexed this run - return - end - - newstatus[basefile] = newstatus[basefile] or { } - newstatus[basefile].timestamp = timestamp - newstatus[basefile].index = newstatus[basefile].index or { } - - if db_timestamp == timestamp and not newstatus[basefile].index[1] then - for _,v in next, status[basefile].index do - local index = #newstatus[basefile].index - newmappings[#newmappings+1] = mappings[v] - newstatus[basefile].index[index+1] = #newmappings - end - if trace_loading then - logs.report("font already indexed: %s", basefile) - end - return - end - local info = fontloader.info(filename) - if info then - if type(info) == "table" and #info > 1 then - for i in next, info do - local fullinfo = font_fullinfo(filename, i-1, texmf) - if not fullinfo then - return - end - local index = newstatus[basefile].index[i] - if not index then - index = #newmappings+1 - end - newmappings[index] = fullinfo - newstatus[basefile].index[i] = index - end - else - local fullinfo = font_fullinfo(filename, false, texmf) - if not fullinfo then - return - end - local index = newstatus[basefile].index[1] - if not index then - index = #newmappings+1 - end - newmappings[index] = fullinfo - newstatus[basefile].index[1] = index - end - else - if trace_loading then - logs.report("failed to load %s", basefile) - end - end - end -end - -local function path_normalize(path) - --[[ - path normalization: - - a\b\c -> a/b/c - - a/../b -> b - - /cygdrive/a/b -> a:/b - - reading symlinks under non-Win32 - - using kpse.readable_file on Win32 - ]] - if os.type == "windows" or os.type == "msdos" then - path = path:gsub('\\', '/') - path = path:lower() - path = path:gsub('^/cygdrive/(%a)/', '%1:/') - end - if os.type ~= "windows" and os.type ~= "msdos" then - local dest = lfs.readlink(path) - if dest then - if kpse.readable_file(dest) then - path = dest - elseif kpse.readable_file(file.join(file.dirname(path), dest)) then - path = file.join(file.dirname(path), dest) - else - -- broken symlink? - end - end - end - path = file.collapse_path(path) - return path -end - -fonts.path_normalize = path_normalize - -names.blacklist = { } - -local function read_blacklist() - local files = { - kpse.lookup("otfl-blacklist.cnf", {all=true, format="tex"}) - } - local blacklist = names.blacklist - - if files and type(files) == "table" then - for _,v in next, files do - for line in io.lines(v) do - line = line:strip() -- to get rid of lines like " % foo" - if line:find("^%%") or line:is_empty() then - -- comment or empty line - else - line = line:split("%")[1] - line = line:strip() - if trace_search then - logs.report("blacklisted file: %s", line) - end - blacklist[#blacklist+1] = line - end - end - end - end -end - -local font_extensions = { "otf", "ttf", "ttc", "dfont" } - -local function scan_dir(dirname, fontnames, newfontnames, texmf) - --[[ - This function scans a directory and populates the list of fonts - with all the fonts it finds. - - dirname is the name of the directory to scan - - names is the font database to fill - - texmf is a boolean saying if we are scanning a texmf directory - ]] - local list, found = { }, { } - local nbfound = 0 - if trace_search then - logs.report("scanning '%s'", dirname) - end - for _,i in next, font_extensions do - for _,ext in next, { i, upper(i) } do - found = glob(format("%s/**.%s$", dirname, ext)) - -- note that glob fails silently on broken symlinks, which happens - -- sometimes in TeX Live. - if trace_search then - logs.report("%s '%s' fonts found", #found, ext) - end - nbfound = nbfound + #found - table.append(list, found) - end - end - if trace_search then - logs.report("%d fonts found in '%s'", nbfound, dirname) - end - - for _,file in next, list do - file = path_normalize(file) - if trace_loading then - logs.report("loading font: %s", file) - end - load_font(file, fontnames, newfontnames, texmf) - end -end - -local function scan_texmf_fonts(fontnames, newfontnames) - --[[ - This function scans all fonts in the texmf tree, through kpathsea - variables OPENTYPEFONTS and TTFONTS of texmf.cnf - ]] - if expandpath("$OSFONTDIR"):is_empty() then - logs.info("Scanning TEXMF fonts...") - else - logs.info("Scanning TEXMF and OS fonts...") - end - local fontdirs = expandpath("$OPENTYPEFONTS"):gsub("^%.", "") - fontdirs = fontdirs .. expandpath("$TTFONTS"):gsub("^%.", "") - if not fontdirs:is_empty() then - for _,d in next, splitpath(fontdirs) do - scan_dir(d, fontnames, newfontnames, true) - end - end -end - ---[[ - For the OS fonts, there are several options: - - if OSFONTDIR is set (which is the case under windows by default but - not on the other OSs), it scans it at the same time as the texmf tree, - in the scan_texmf_fonts. - - in addition: - - under Windows and Mac OSX, we take a look at some hardcoded directories - - under Unix, we read /etc/fonts/fonts.conf and read the directories in it - - This means that if you have fonts in fancy directories, you need to set them - in OSFONTDIR if they cannot be found by fontconfig. -]] - -local function read_fonts_conf(path, results, passed_paths) - --[[ - This function parses /etc/fonts/fonts.conf and returns all the dir it finds. - The code is minimal, please report any error it may generate. - ]] - local f = io.open(path) - table.insert(passed_paths, path) - if not f then - logs.info("Warning: unable to read "..path.. ", skipping...") - return results - end - local incomments = false - for line in f:lines() do - while line and line ~= "" do - -- spaghetti code... hmmm... - if incomments then - local tmp = find(line, '-->') - if tmp then - incomments = false - line = sub(line, tmp+3) - else - line = nil - end - else - local tmp = find(line, ' current -require("luaotfload-legacy-database") ---> old -require("alt_getopt") ---> ? - -local name = "mkluatexfontdb" -local version = "1.31 (legacy)" - -local names = fonts.names - -local function help_msg() - texio.write(string.format([[ -Usage: %s [OPTION]... - -================================================================================ - please update your luatex binary - this version is unsupported and likely to break things -================================================================================ - -Rebuild the LuaTeX font database. - -Valid options: - -f --force force re-indexing all fonts - -q --quiet don't output anything - -v --verbose=LEVEL be more verbose (print the searched directories) - -vv print the loaded fonts - -vvv print all steps of directory searching - -V --version print version and exit - -h --help print this message - -The output database file is named otfl-names.lua and is placed under: - - %s - -contact: https://github.com/lualatex/luaotfload - -]], name, names.path.localdir)) -end - -local function version_msg() - texio.write(string.format( - "%s version %s, database version %s.\n", name, version, names.version)) -end - ---[[ -Command-line processing. -Here we fill cmdargs with the good values, and then analyze it. ---]] - -local long_opts = { - force = "f", - quiet = "q", - help = "h", - verbose = 1 , - version = "V", -} - -local short_opts = "fqpvVh" - -local force_reload = nil - -local function process_cmdline() - local opts, optind, optarg = alt_getopt.get_ordered_opts (arg, short_opts, long_opts) - local log_level = 1 - for i,v in ipairs(opts) do - if v == "q" then - log_level = 0 - elseif v == "v" then - if log_level > 0 then - log_level = log_level + 1 - else - log_level = 2 - end - elseif v == "V" then - version_msg() - os.exit(0) - elseif v == "h" then - help_msg() - os.exit(0) - elseif v == "f" then - force_reload = 1 - end - end - names.set_log_level(log_level) -end - -local function generate(force) - local fontnames, saved - fontnames = names.update(fontnames, force) - logs.report("%s fonts in the database", #fontnames.mappings) - saved = names.save(fontnames) -end - -process_cmdline() -generate(force_reload) diff --git a/luaotfload-legacy.lua b/luaotfload-legacy.lua deleted file mode 100644 index 8bb1790..0000000 --- a/luaotfload-legacy.lua +++ /dev/null @@ -1,402 +0,0 @@ -module("luaotfload", package.seeall) - -luaotfload.module = { - name = "luaotfload-legacy", - version = 1.31, - date = "2013/04/25", - description = "Unsupported Luaotfload", - author = "Elie Roux & Hans Hagen", - copyright = "Elie Roux", - license = "GPL v2" -} - -local error, warning, info, log = luatexbase.provides_module(luaotfload.module) - ---[[doc-- - - This used to be a necessary initalization in order not to rebuild an - existing font. Maybe 600 should be replaced by |\pdfpkresolution| - or |texconfig.pk_dpi| (and it should be replaced dynamically), but - we don't have access (yet) to the |texconfig| table, so we let it be - 600. Anyway, it does still work fine even if |\pdfpkresolution| is - changed. - ---doc]]-- - -kpse.init_prog("", 600, "/") - ---[[doc-- - - The minimal required \luatex version. - We are tolerant folks. - ---doc]]-- - -local luatex_version = 60 -if tex.luatexversion < luatex_version then - warning("LuaTeX v%.2f is old, v%.2f is required, v0.76 recommended.", - tex.luatexversion/100, - luatex_version /100) -end - ---[[doc-- - - \subsection{Module loading} - We load the outdated \context files with this function. It - automatically adds the |otfl-| prefix to it, so that we call it with - the actual \context name. - ---doc]]-- - -function luaotfload.loadmodule(tofind) - local found = kpse.find_file(tofind,"tex") - if found then - log("loading file %s.", found) - dofile(found) - else - error("file %s not found.", tofind) - end -end -local loadmodule = luaotfload.loadmodule - ---[[doc-- - - Keep away from these lines! - ---doc]]-- -loadmodule"luaotfload-legacy-merged.lua" - -if not fonts then - loadmodule("otfl-luat-dum.lua") -- not used in context at all - loadmodule("otfl-luat-ovr.lua") -- override some luat-dum functions - loadmodule("otfl-data-con.lua") -- maybe some day we don't need this one - loadmodule("otfl-font-ini.lua") - loadmodule("otfl-node-dum.lua") - loadmodule("otfl-node-inj.lua") ---[[doc-- - By default \context takes some private attributes for internal use. To - avoide attribute clashes with other packages, we override the function - that allocates new attributes, making it a wraper around - |luatexbase.new_attribute()|. We also prefix attributes with |otfl@| to - avoid possiple name clashes. ---doc]]-- - loadmodule("luaotfload-legacy-attributes.lua") -- patch attributes ---[[doc-- - Font handling modules. ---doc]]-- - loadmodule("otfl-font-tfm.lua") - loadmodule("otfl-font-cid.lua") - loadmodule("otfl-font-ott.lua") - loadmodule("otfl-font-map.lua") - loadmodule("otfl-font-otf.lua") - loadmodule("otfl-font-otd.lua") - loadmodule("otfl-font-oti.lua") - loadmodule("otfl-font-otb.lua") - loadmodule("otfl-font-otn.lua") - loadmodule("otfl-font-ota.lua") - loadmodule("otfl-font-otc.lua") - loadmodule("otfl-font-def.lua") ---[[doc-- - \textsf{old luaotfload} specific modules. ---doc]]-- - loadmodule("otfl-font-xtx.lua") - loadmodule("otfl-font-dum.lua") - loadmodule("otfl-font-clr.lua") -end -loadmodule"luaotfload-legacy-database.lua" --- unmerged coz needed in db script - ---[[doc-- - - This is a patch for |otfl-font-def.lua|, that defines a reader for ofm - fonts, this is necessary if we set the forced field of the specification - to |ofm|. - ---doc]]-- - -if fonts and fonts.tfm and fonts.tfm.readers then - fonts.tfm.readers.ofm = fonts.tfm.readers.tfm -end - ---[[doc-- - - \subsection{Post-processing TFM table} - Here we do some final touches to the loaded TFM table before passing it - to the \tex end. - First we create a callback for patching fonts on the fly, to be used by - other packages. - ---doc]]-- - -luatexbase.create_callback("luaotfload.patch_font", "simple", function() end) - ---[[doc-- - - then define a function where font manipulation will take place. - ---doc]]-- - -local function def_font(...) - local fontdata = fonts.define.read(...) - if type(fontdata) == "table" and fontdata.shared then ---[[doc-- - - Then we populate |MathConstants| table, which is required for - OpenType math. - - Note: actually it isn’t, but you’re asking for it by using outdated - code. - ---doc]]-- - local otfdata = fontdata.shared.otfdata - if otfdata.metadata.math then - local mc = { } - for k,v in next, otfdata.metadata.math do - if k:find("Percent") then - -- keep percent values as is - mc[k] = v - else - mc[k] = v / fontdata.units * fontdata.size - end - end - -- for \overwithdelims - mc.FractionDelimiterSize = 1.01 * fontdata.size - mc.FractionDelimiterDisplayStyleSize = 2.39 * fontdata.size - - fontdata.MathConstants = mc - end ---[[doc-- - - Execute any registered font patching callbacks. - ---doc]]-- - luatexbase.call_callback("luaotfload.patch_font", fontdata) - end - return fontdata -end - ---[[doc-- -\subsection{\context override} - - We have a unified function for both file and name resolver. This - line is commented as it makes database reload too often. This means - that in some cases, a font in the database will not be found if - it's not in the texmf tree. A similar thing will reappear in next - version. - ---doc]]-- - ---fonts.define.resolvers.file = fonts.define.resolvers.name - ---[[doc-- - - Overriding some defaults set in \context code. - ---doc]]-- - -fonts.mode = "node" - ---[[doc-- - - The following features are useful in math (e.g. in XITS Math font), - but \textsf{luaotfload} does not recognize them in |base| mode. - ---doc]]-- - -local register_base_sub = fonts.otf.features.register_base_substitution -local gsubs = { - "ss01", "ss02", "ss03", "ss04", "ss05", - "ss06", "ss07", "ss08", "ss09", "ss10", - "ss11", "ss12", "ss13", "ss14", "ss15", - "ss16", "ss17", "ss18", "ss19", "ss20", -} - -for _,v in next, gsubs do - register_base_sub(v) -end - ---[[doc-- - - Finally we register the callbacks - ---doc]]-- - -luatexbase.add_to_callback("pre_linebreak_filter", - nodes.simple_font_handler, - "luaotfload.pre_linebreak_filter") -luatexbase.add_to_callback("hpack_filter", - nodes.simple_font_handler, - "luaotfload.hpack_filter") -luatexbase.reset_callback("define_font") -luatexbase.add_to_callback("define_font", - def_font, - "luaotfload.define_font", 1) -luatexbase.add_to_callback("find_vf_file", - fonts.vf.find, - "luaotfload.find_vf_file") ---[[doc-- - - XXX: see https://github.com/wspr/unicode-math/issues/185 - \luatex does not provide interface to accessing - |(Script)ScriptPercentScaleDown| math constants, so we - emulate \xetex behaviour by setting |\fontdimen10| and - |\fontdimen11|. - - Note: actually, it does now, but not unless you update. - ---doc]]-- - -local function set_sscale_diments(fontdata) - local mc = fontdata.MathConstants - if mc then - if mc["ScriptPercentScaleDown"] then - fontdata.parameters[10] = mc.ScriptPercentScaleDown - else -- resort to plain TeX default - fontdata.parameters[10] = 70 - end - if mc["ScriptScriptPercentScaleDown"] then - fontdata.parameters[11] = mc.ScriptScriptPercentScaleDown - else -- resort to plain TeX default - fontdata.parameters[11] = 50 - end - end -end - -luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_diments, "unicodemath.set_sscale_diments") - ---[[doc-- - Version 2.3c of fontspec dropped a couple features that are now - provided in the luaotfload auxiliary libraries. To avoid breaking - Mik\TEX (again), which is sorta the entire point of distributing the - legacy codebase, we temporarily restore those functions here. - - Note that apart from cosmetic changes these are still the same as in - pre-TL2013 fontspec, relying on pairs() and other inefficient methods. ---doc]]-- - -luaotfload.aux = luaotfload.aux or { } -local aux = luaotfload.aux - -local stringlower = string.lower -local fontid = font.id - -local identifiers = fonts.identifiers - -local check_script = function (id, script) - local s = stringlower(script) - if id and id > 0 then - local tfmdata = identifiers[id] - local otfdata = tfmdata.shared and tfmdata.shared.otfdata - if otfdata then - local features = otfdata.luatex.features - for i, _ in pairs(features) do - for j, _ in pairs(features[i]) do - if features[i][j][s] then - fontspec.log("script '%s' exists in font '%s'", - script, tfmdata.fullname) - return true - end - end - end - end - end -end - -local check_language = function (id, script, language) - local s = stringlower(script) - local l = stringlower(language) - if id and id > 0 then - local tfmdata = identifiers[id] - local otfdata = tfmdata.shared and tfmdata.shared.otfdata - if otfdata then - local features = otfdata.luatex.features - for i, _ in pairs(features) do - for j, _ in pairs(features[i]) do - if features[i][j][s] and features[i][j][s][l] then - fontspec.log("language '%s' for script '%s' exists in font '%s'", - language, script, tfmdata.fullname) - return true - end - end - end - end - end -end - -local check_feature = function (id, script, language, feature) - local s = stringlower(script) - local l = stringlower(language) - local f = stringlower(feature:gsub("^[+-]", ""):gsub("=.*$", "")) - if id and id > 0 then - local tfmdata = identifiers[id] - local otfdata = tfmdata.shared and tfmdata.shared.otfdata - if otfdata then - local features = otfdata.luatex.features - for i, _ in pairs(features) do - if features[i][f] and features[i][f][s] then - if features[i][f][s][l] == true then - fontspec.log("feature '%s' for language '%s' and script '%s' exists in font '%s'", - feature, language, script, tfmdata.fullname) - return true - end - end - end - end - end -end - -local get_math_dimension = function(fnt, str) - if type(fnt) == "string" then - fnt = fontid(fnt) - end - local tfmdata = identifiers[fnt] - if tfmdata then - local mathdata = tfmdata.MathConstants - if mathdata then - return mathdata[str] - end - end -end - -aux.provides_script = check_script -aux.provides_language = check_language -aux.provides_feature = check_feature -aux.get_math_dimension = get_math_dimension - -local set_capheight = function (tfmdata) - local capheight - local shared = tfmdata.shared - if shared then - local metadata = shared.otfdata.metadata - local units_per_em = metadata.units_per_em or tfmdata.units - local os2_capheight = shared.otfdata.pfminfo.os2_capheight - local size = tfmdata.size - - if os2_capheight > 0 then - capheight = os2_capheight / units_per_em * size - else - local X8 = string.byte"X" - if tfmdata.characters[X8] then - capheight = tfmdata.characters[X8].height - else - capheight = metadata.ascent / units_per_em * size - end - end - else - local X8 = string.byte"X" - if tfmdata.characters[X8] then - capheight = tfmdata.characters[X8].height - end - end - if capheight then - tfmdata.parameters[8] = capheight - end -end -luatexbase.add_to_callback("luaotfload.patch_font", - set_capheight, - "luaotfload.set_capheight") - ---[[doc-- -End of auxiliary functionality that was moved from fontspec.lua. ---doc]]-- - --- vim:ts=2:sw=2:expandtab:ft=lua -- cgit v1.2.3 From cf11e5a0d9155095649460aa207dac80ce75ae80 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:06:29 +0100 Subject: [main] extinguish references to legacy code + bump version and dates --- luaotfload.dtx | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 08f56af..320b9d9 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2009-2013 +% Copyright (C) 2009-2014 % by Elie Roux % and Khaled Hosny % and Philipp Gesang @@ -40,7 +40,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload v2.4 OpenType layout system} +\Msg{* Package: luaotfload v2.5 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -51,7 +51,7 @@ \preamble This is a generated file. -Copyright (C) 2009-2013 +Copyright (C) 2009-2014 by Elie Roux and Khaled Hosny and Philipp Gesang @@ -111,7 +111,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2013/12/28 v2.4 OpenType layout system]% +[2014/**/** v2.5 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace} \usepackage[x11names]{xcolor} @@ -231,7 +231,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \identifier{luaotfload} package} -% \date{2013/12/28 v2.4} +% \date{2014/**/** v2.5} % \author{Elie Roux · Khaled Hosny · Philipp Gesang\\ % Home: \url{https://github.com/lualatex/luaotfload}\\ % Support: \email{lualatex-dev@tug.org}} @@ -855,7 +855,7 @@ and the derived files % \identifier{luaotfload} adds a number of features that are not defined % in the original \OpenType specification, most of them % aiming at emulating the behavior familiar from other \TEX engines. -% Currently (2013) there are three of them: +% Currently (2014) there are three of them: % % \begin{description} % @@ -1608,8 +1608,8 @@ end luaotfload.module = { name = "luaotfload", - version = 2.40003, - date = "2013/12/28", + version = 2.50000, + date = "2014/**/**", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", @@ -2233,16 +2233,10 @@ luaotfload.aux.start_rewrite_fontname () --- to be migrated to fontspec \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2013/12/28 v2.4 OpenType layout system] + [2014/**/** v2.5 OpenType layout system] \RequirePackage{luatexbase} \fi -\ifnum\luatexversion<76 - %% here some deprecation warning would be in order - \RequireLuaModule{lualibs} - \RequireLuaModule{luaotfload-legacy} -\else - \RequireLuaModule{luaotfload} -\fi +\RequireLuaModule{luaotfload} \endinput % \end{macrocode} % \iffalse -- cgit v1.2.3 From b86cc36d326998dfb0d8bf1e062cfbf53a0c2b3a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:10:08 +0100 Subject: [tool] exterminate references to legacy code --- luaotfload-tool.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index fd84fa4..9c3569a 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -33,8 +33,7 @@ kpse.set_program_name "luatex" --[[doc-- We test for Lua 5.1 by means of capability detection to see if - we’re running an outdated Luatex. If so, we hand over control to - the legacy db runner. + we’re running an outdated Luatex. If so, we bail. \url{http://lua-users.org/wiki/LuaVersionCompatibility} @@ -63,8 +62,10 @@ if _G.getfenv ~= nil then -- 5.1 or LJ runtime = { "jit", jit.version } else runtime = { "stock", _VERSION } - local oldscript = kpsefind_file "luaotfload-legacy-tool.lua" - return require (oldscript) + print "FATAL ERROR" + print "Luaotfload requires a Luatex version >=0.76." + print "Please update your TeX distribution!" + os.exit (-1) end else -- 5.2 runtime = { "stock", _VERSION } -- cgit v1.2.3 From cd9eb96cbb2fe57061aa7efdec3e4bc1513aa04e Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:16:37 +0100 Subject: [tool] destroy --alias option and legacy mkluatexfontdb emulation --- luaotfload-tool.lua | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 9c3569a..894cf63 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -127,12 +127,7 @@ do -- we don’t have file.basename and the likes yet, so inline parser ftw local extension = dot * (1 - slash - dot)^1 local p_basename = path^-1 * C(thename) * extension^-1 * P(-1) - local self = lpegmatch(p_basename, stringlower(arg[0])) - if self == "luaotfload-tool" then - luaotfloadconfig.self = "luaotfload-tool" - else - luaotfloadconfig.self = "mkluatexfontdb" - end + luaotfloadconfig.self = "luaotfload-tool" end config.lualibs = config.lualibs or { } @@ -211,9 +206,6 @@ This tool is part of the luaotfload package. Valid options are: "environment", "index", "permissions", or "repository" - --alias= force behavior of "luaotfload-tool" or legacy - "mkluatexfontdb" - ------------------------------------------------------------------------------- DATABASE @@ -258,26 +250,9 @@ The font cache will be written to ]], mkluatexfontdb = [[ - -Usage: %s [OPTION]... - -Rebuild or update the Luaotfload font names database. - -Valid options: - -f --force force re-indexing all fonts - -q --quiet don't output anything - -v --verbose=LEVEL be more verbose (print the searched directories) - -vv print the loaded fonts - -vvv print all steps of directory searching - -V --version print version and exit - -h --help print this message - --alias= force behavior of "luaotfload-tool" or legacy - "mkluatexfontdb" - -The font database will be saved to - %s - %s - +FATAL ERROR +As of Luaotfload v2.5, legacy behavior is not supported anymore. Please +update your scripts and/or habits! Kthxbye. ]], short = [[ Usage: luaotfload-tool [--help] [--version] [--verbose=] @@ -1099,7 +1074,6 @@ local process_cmdline = function ( ) -- unit -> jobspec } local long_options = { - alias = 1, cache = 1, ["no-compress"] = "c", diagnose = 1, @@ -1186,8 +1160,6 @@ local process_cmdline = function ( ) -- unit -> jobspec elseif v == "I" then result.show_info = true result.full_info = true - elseif v == "alias" then - luaotfloadconfig.self = optarg[n] elseif v == "l" then action_pending["flush"] = true elseif v == "list" then @@ -1233,12 +1205,7 @@ local process_cmdline = function ( ) -- unit -> jobspec end end - if luaotfloadconfig.self == "mkluatexfontdb" then --- TODO drop legacy ballast after 2.4 - result.help_version = "mkluatexfontdb" - action_pending["generate"] = true - result.log_level = math.max(1, result.log_level) - logs.set_logout("stdout", finalizers) - elseif nopts == 0 then + if nopts == 0 then action_pending["help"] = true result.help_version = "short" end -- cgit v1.2.3 From d882e29709b07212bb4d85a0af0bb3d208927c81 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:19:06 +0100 Subject: [doc] silence claims about the existence of mkluatexfontdb# --- luaotfload-tool.lua | 4 +++- luaotfload-tool.rst | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 894cf63..517a88f 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -13,6 +13,8 @@ local version = "2.4" --- . --[[doc-- +luaotfload-tool(1) + This file was originally written (as \fileent{mkluatexfontdb.lua}) by Elie Roux and Khaled Hosny and, as a derived work of ConTeXt, is provided under the terms of the GPL v2.0 license as printed in full @@ -1055,7 +1057,7 @@ end --[[-- Command-line processing. -mkluatexfontdb.lua relies on the script alt_getopt to process argv and +luaotfload-tool relies on the script alt_getopt to process argv and analyzes its output. TODO with extended lualibs we have the functionality from the diff --git a/luaotfload-tool.rst b/luaotfload-tool.rst index 957ec85..04c34e9 100644 --- a/luaotfload-tool.rst +++ b/luaotfload-tool.rst @@ -49,10 +49,6 @@ the *Luaotfload* package. There are two general modes: **update** and + **update**: update the database or rebuild it entirely; + **query**: resolve a font name or display close matches. -Note that if the script is named ``mkluatexfontdb`` it will behave like -earlier versions (<=1.3) and always update the database first. Also, -the verbosity level will be set to 2. - OPTIONS ======================================================================= -- cgit v1.2.3 From e794cfd74ae38a332122cf2b53df5b2af5d3b1fb Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:20:43 +0100 Subject: [doc] update NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index b8f380d..922d4ff 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ Change History -------------- +2014/**/**, luaotfload v2.5 + * Remove legacy code. + * Remove compatibility with the old mkluatexfontdb script. + 2013/12/31, luaotfload v2.4 * Additional self-tests, now in separate file (luaotfload-diagnostics.lua) * Better path and directory handling, especially on Windows -- cgit v1.2.3 From 9e2424f29eb2e54968026f4c847bf57c64f59ed6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:27:11 +0100 Subject: [*] bump version --- luaotfload-auxiliary.lua | 6 +++--- luaotfload-colors.lua | 4 ++-- luaotfload-database.lua | 4 ++-- luaotfload-diagnostics.lua | 4 ++-- luaotfload-features.lua | 2 +- luaotfload-letterspace.lua | 2 +- luaotfload-loaders.lua | 2 +- luaotfload-override.lua | 6 +++--- luaotfload-tool.lua | 10 +++++----- luaotfload-tool.rst | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index d3de731..821a436 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -2,10 +2,10 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-auxiliary.lua -- DESCRIPTION: part of luaotfload --- REQUIREMENTS: luaotfload 2.4 +-- REQUIREMENTS: luaotfload 2.5 -- AUTHOR: Khaled Hosny, Élie Roux, Philipp Gesang --- VERSION: 2.4 --- CREATED: 2013-05-01 14:40:50+0200 +-- VERSION: 2.5 +-- MODIFIED: 2014-01-02 21:24:25+0100 ----------------------------------------------------------------------- -- diff --git a/luaotfload-colors.lua b/luaotfload-colors.lua index b8ecb87..86e493f 100644 --- a/luaotfload-colors.lua +++ b/luaotfload-colors.lua @@ -1,9 +1,9 @@ if not modules then modules = { } end modules ['luaotfload-colors'] = { - version = "2.4", + version = "2.5", comment = "companion to luaotfload.lua (font color)", author = "Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "Luaotfload Development Team", - license = "GNU GPL v2" + license = "GNU GPL v2.0" } --[[doc-- diff --git a/luaotfload-database.lua b/luaotfload-database.lua index b47fc8b..b22afd7 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1,9 +1,9 @@ if not modules then modules = { } end modules ['luaotfload-database'] = { - version = "2.4", + version = "2.5", comment = "companion to luaotfload.lua", author = "Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "Luaotfload Development Team", - license = "GNU GPL v2" + license = "GNU GPL v2.0" } --[[doc-- diff --git a/luaotfload-diagnostics.lua b/luaotfload-diagnostics.lua index 68ed18c..1f29e3d 100644 --- a/luaotfload-diagnostics.lua +++ b/luaotfload-diagnostics.lua @@ -4,8 +4,8 @@ -- DESCRIPTION: functionality accessible by the --diagnose option -- REQUIREMENTS: luaotfload-tool.lua -- AUTHOR: Philipp Gesang (Phg), --- VERSION: 2.4 --- CREATED: 2013-07-28 10:01:18+0200 +-- VERSION: 2.5 +-- MODIFIED: 2014-01-02 21:23:06+0100 ----------------------------------------------------------------------- -- local names = fonts.names diff --git a/luaotfload-features.lua b/luaotfload-features.lua index 4b2f206..dc6b8a4 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ["features"] = { - version = "2.4", + version = "2.5", comment = "companion to luaotfload.lua", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "PRAGMA ADE / ConTeXt Development Team", diff --git a/luaotfload-letterspace.lua b/luaotfload-letterspace.lua index 7c5a967..d17aedf 100644 --- a/luaotfload-letterspace.lua +++ b/luaotfload-letterspace.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ['letterspace'] = { - version = "2.4", + version = "2.5", comment = "companion to luaotfload.lua", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL; adapted by Philipp Gesang", copyright = "PRAGMA ADE / ConTeXt Development Team", diff --git a/luaotfload-loaders.lua b/luaotfload-loaders.lua index 523dc24..fa00633 100644 --- a/luaotfload-loaders.lua +++ b/luaotfload-loaders.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ["loaders"] = { - version = "2.4", + version = "2.5", comment = "companion to luaotfload.lua", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "PRAGMA ADE / ConTeXt Development Team", diff --git a/luaotfload-override.lua b/luaotfload-override.lua index b1773fa..a692cb4 100644 --- a/luaotfload-override.lua +++ b/luaotfload-override.lua @@ -1,9 +1,9 @@ if not modules then modules = { } end modules ['luat-ovr'] = { - version = "2.4", - comment = "companion to luatex-*.tex", + version = "2.5", + comment = "companion to Luaotfload", author = "Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "Luaotfload Development Team", - license = "GNU GPL v2" + license = "GNU GPL v2.0" } --[[doc-- diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 517a88f..ba3fcb5 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -2,14 +2,14 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-tool.lua -- DESCRIPTION: database functionality --- REQUIREMENTS: luaotfload 2.2 +-- REQUIREMENTS: luaotfload 2.5 -- AUTHOR: Khaled Hosny, Élie Roux, Philipp Gesang --- VERSION: 2.4 --- LICENSE: GPL v2 --- MODIFIED: 2013-07-28 13:12:04+0200 +-- VERSION: 2.5 +-- LICENSE: GPL v2.0 +-- MODIFIED: 2014-01-02 21:21:10+0100 ----------------------------------------------------------------------- -local version = "2.4" --- . +local version = "2.5" --- . --[[doc-- diff --git a/luaotfload-tool.rst b/luaotfload-tool.rst index 04c34e9..be53ded 100644 --- a/luaotfload-tool.rst +++ b/luaotfload-tool.rst @@ -6,9 +6,9 @@ generate and query the Luaotfload font names database ----------------------------------------------------------------------- -:Date: 2013-07-31 +:Date: 2014-01-02 :Copyright: GPL v2.0 -:Version: 2.4 +:Version: 2.5 :Manual section: 1 :Manual group: text processing -- cgit v1.2.3 From 23b4da05696ec0c3a4c48083209ae37facd09acc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:28:37 +0100 Subject: [*] remove tests directory Testing has been done using the test repo exclusively for quite some time now: https://bitbucket.org/phg/lua-la-tex-tests. Also, the ``mktests`` script partially automates testing of the font management. This changeset is just codifying the facts. If any of the tests deserves preservation please file an issue for inclusion into the test repo. Thanks! --- tests/alternate_sub.tex | 15 --- tests/anum.tex | 17 ---- tests/caseinsensitive.tex | 6 -- tests/color.tex | 10 -- tests/fallback.tex | 6 -- tests/featurefiles.tex | 5 - tests/font_patch.tex | 28 ------ tests/fontconfig_conf_reading.tex | 8 -- tests/fontencoding.tex | 4 - tests/fonts.conf.test | 25 ----- tests/fontspec_lookup.ltx | 41 --------- tests/frac.tex | 4 - tests/fullname.tex | 15 --- tests/itlc.tex | 5 - tests/lookups.tex | 20 ---- tests/marks.tex | 10 -- tests/math.tex | 56 ------------ tests/microtypography.tex | 36 -------- tests/opbd.fea | 187 -------------------------------------- tests/opbd.tex | 35 ------- tests/opticalsize.tex | 13 --- tests/pln-aux-1.tex | 55 ----------- tests/pln-aux-2.tex | 102 --------------------- tests/pln-aux-3.tex | 39 -------- tests/pln-aux-4.tex | 41 --------- tests/pln-request-4-slashed.tex | 12 --- tests/pln-request-5-cached.tex | 18 ---- tests/pln-subfont-1.tex | 12 --- tests/pln-tfm.tex | 10 -- tests/sanitize_color.tex | 8 -- tests/systemfonts.tex | 50 ---------- tests/texligatures.tex | 7 -- tests/tfmofm.ltx | 6 -- tests/tkrn.fea | 8 -- tests/weirdfonts.tex | 15 --- tests/zero_width_marks_lig.tex | 16 ---- 36 files changed, 945 deletions(-) delete mode 100644 tests/alternate_sub.tex delete mode 100644 tests/anum.tex delete mode 100644 tests/caseinsensitive.tex delete mode 100644 tests/color.tex delete mode 100644 tests/fallback.tex delete mode 100644 tests/featurefiles.tex delete mode 100644 tests/font_patch.tex delete mode 100644 tests/fontconfig_conf_reading.tex delete mode 100644 tests/fontencoding.tex delete mode 100644 tests/fonts.conf.test delete mode 100644 tests/fontspec_lookup.ltx delete mode 100644 tests/frac.tex delete mode 100644 tests/fullname.tex delete mode 100644 tests/itlc.tex delete mode 100644 tests/lookups.tex delete mode 100644 tests/marks.tex delete mode 100644 tests/math.tex delete mode 100644 tests/microtypography.tex delete mode 100644 tests/opbd.fea delete mode 100644 tests/opbd.tex delete mode 100644 tests/opticalsize.tex delete mode 100644 tests/pln-aux-1.tex delete mode 100644 tests/pln-aux-2.tex delete mode 100644 tests/pln-aux-3.tex delete mode 100644 tests/pln-aux-4.tex delete mode 100644 tests/pln-request-4-slashed.tex delete mode 100644 tests/pln-request-5-cached.tex delete mode 100644 tests/pln-subfont-1.tex delete mode 100644 tests/pln-tfm.tex delete mode 100644 tests/sanitize_color.tex delete mode 100644 tests/systemfonts.tex delete mode 100644 tests/texligatures.tex delete mode 100644 tests/tfmofm.ltx delete mode 100644 tests/tkrn.fea delete mode 100644 tests/weirdfonts.tex delete mode 100644 tests/zero_width_marks_lig.tex diff --git a/tests/alternate_sub.tex b/tests/alternate_sub.tex deleted file mode 100644 index 862c665..0000000 --- a/tests/alternate_sub.tex +++ /dev/null @@ -1,15 +0,0 @@ -\input luaotfload.sty -\font\0=name:Scheherazade:mode=node;script=arab;salt=0 at 10pt -\font\1=name:Scheherazade:mode=node;script=arab;salt=1 at 10pt -\font\2=name:Scheherazade:mode=node;script=arab;salt=2 at 10pt -\0 \char"06DD -\1 \char"06DD -\2 \char"06DD - -\font\0=name:Scheherazade:mode=base;script=arab;salt=0 at 10pt -\font\1=name:Scheherazade:mode=base;script=arab;salt=1 at 10pt -\font\2=name:Scheherazade:mode=base;script=arab;salt=2 at 10pt -\0 \char"06DD -\1 \char"06DD -\2 \char"06DD -\bye diff --git a/tests/anum.tex b/tests/anum.tex deleted file mode 100644 index 773955f..0000000 --- a/tests/anum.tex +++ /dev/null @@ -1,17 +0,0 @@ -\input luaotfload.sty - -\font\testd={name:amiri:script=arab;language=dflt;+anum} -\font\testa={name:amiri:script=arab;language=ara;+anum} -\font\testp={name:amiri:script=arab;language=far;+anum} -\font\tests={name:amiri:script=arab;language=snd;+anum} -\font\testu={name:amiri:script=arab;language=urd;+anum} -\font\testx={name:amiri:script=arab;language=xxx;+anum} - -\def\test{\luatextextdir TRT ضرب 0123456789} -\testd \test\par -\testa \test\par -\testp \test\par -\tests \test\par -\testu \test\par -\testx \test\par -\bye diff --git a/tests/caseinsensitive.tex b/tests/caseinsensitive.tex deleted file mode 100644 index 0e9fb5f..0000000 --- a/tests/caseinsensitive.tex +++ /dev/null @@ -1,6 +0,0 @@ -\input luaotfload.sty - -\font\termesr ={tex gyre termes:+liga} at 10pt - -\termesr fi fl ffi ffl ff\par -\bye diff --git a/tests/color.tex b/tests/color.tex deleted file mode 100644 index 188889c..0000000 --- a/tests/color.tex +++ /dev/null @@ -1,10 +0,0 @@ -\input luaotfload.sty - -\font\testa=file:lmroman10-regular.otf:color=FF0000BB;+trep at 10pt -\font\testb=file:lmroman10-regular.otf:color=FFFF0099;+trep at 10pt -\font\testc=file:lmroman10-regular.otf:color=559922;+trep at 12pt - -\testa FF0000BB \par -\testb FFFF0099 \par -\testc 559922 \par -\bye diff --git a/tests/fallback.tex b/tests/fallback.tex deleted file mode 100644 index 71baea9..0000000 --- a/tests/fallback.tex +++ /dev/null @@ -1,6 +0,0 @@ -\input luaotfload.sty -\font\testa={XITS Math} -\font\testb={XITS Math/B} -\testa text\par -\testb text\par -\bye diff --git a/tests/featurefiles.tex b/tests/featurefiles.tex deleted file mode 100644 index c1a3044..0000000 --- a/tests/featurefiles.tex +++ /dev/null @@ -1,5 +0,0 @@ -\input luaotfload.sty -\font\pagella=texgyrepagella-regular:mode=node;featurefile=tkrn.fea;+tkrn - -\pagella TEX -\bye diff --git a/tests/font_patch.tex b/tests/font_patch.tex deleted file mode 100644 index d3bba07..0000000 --- a/tests/font_patch.tex +++ /dev/null @@ -1,28 +0,0 @@ -\input{luaotfload.sty} -\directlua { - local function patch(fontdata) - local mc = fontdata.MathConstants - local em = fontdata.parameters.units - local sz = fontdata.parameters.size - if fontdata.psname == "CambriaMath" and mc then - mc.DisplayOperatorMinHeight = 2800 / em * sz - end - end - %% part of luaotfload-auxiliary - %luatexbase.add_to_callback( - %"luaotfload.patch_font", - %patch, - %"luaotfload.aux.patch_cambria_domh") -} - -\font\4={name:Cambria Math:mode=base;script=math} at 10pt -\font\5={name:Cambria Math:mode=base;script=math;ssty=1} at 7pt -\font\6={name:Cambria Math:mode=node;script=math;ssty=2} at 5pt -\textfont4=\4 \scriptfont4=\5 \scriptscriptfont4=\6 - -$$ -\Umathchar"1"4`∫ -\Umathchar"1"4`∑ -$$ -\bye - diff --git a/tests/fontconfig_conf_reading.tex b/tests/fontconfig_conf_reading.tex deleted file mode 100644 index 66ab377..0000000 --- a/tests/fontconfig_conf_reading.tex +++ /dev/null @@ -1,8 +0,0 @@ -\directlua{ - config = { lualibs = { load_extended = false } } - require"lualibs" - require"luaotfload-database" - local results = fonts.names.read_fonts_conf{"fonts.conf.test"} - inspect(results) -} -\bye diff --git a/tests/fontencoding.tex b/tests/fontencoding.tex deleted file mode 100644 index bbbbac6..0000000 --- a/tests/fontencoding.tex +++ /dev/null @@ -1,4 +0,0 @@ -\input luaotfload.sty -\font\tenrm=ec-lmr10 -\tenrm -\bye diff --git a/tests/fonts.conf.test b/tests/fonts.conf.test deleted file mode 100644 index 3c3e132..0000000 --- a/tests/fonts.conf.test +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - fontconfig/fonts.conf - test 1 ok - test 2 oktest 3 ok - test 4 oktest 5 ok - - /etc/fonts/conf.d - /etc/fonts/fonts.conf - /etc/fonts/conf.d/69-unifont.conf - diff --git a/tests/fontspec_lookup.ltx b/tests/fontspec_lookup.ltx deleted file mode 100644 index 6645427..0000000 --- a/tests/fontspec_lookup.ltx +++ /dev/null @@ -1,41 +0,0 @@ -\documentclass[a5paper,12pt]{scrartcl} -\usepackage{fontspec} -%% -------------------------------------------------------------------- -%% weirdness ahead -%% -------------------------------------------------------------------- -\setmainfont - [Numbers=Lining, - BoldFont={TeX Gyre Pagella Bold}, - BoldItalicFont={TeX Gyre Termes BoldItalic}] - {EB Garamond} -%% -------------------------------------------------------------------- - -%% -------------------------------------------------------------------- -%% excerpt from samples/knuth.tex -%% -------------------------------------------------------------------- -\def\knuth{% - Thus, I came to the conclusion that the designer of a new - system must not only be the implementer and first - large--scale user; the designer should also write the first - user manual. - - The separation of any of these four components would have - hurt \TeX\ significantly. If I had not participated fully in - all these activities, literally hundreds of improvements - would never have been made, because I would never have - thought of them or perceived why they were important. - -} - -%% -------------------------------------------------------------------- -%% main -%% -------------------------------------------------------------------- -\begin{document} - - \section{regular} {\rmfamily\upshape\knuth} - \section{bold face} {\rmfamily\bfseries\knuth} - \section{italic} {\rmfamily\itshape\knuth} - \section{slanted} {\rmfamily\slshape\knuth} - \section{bold italic} {\rmfamily\bfseries\itshape\knuth} - -\end{document} diff --git a/tests/frac.tex b/tests/frac.tex deleted file mode 100644 index c6a4868..0000000 --- a/tests/frac.tex +++ /dev/null @@ -1,4 +0,0 @@ -\input luaotfload.sty -\font\testa={name:Linux Libertine O:script=latn;+frac} at 10pt -\testa 1/8 -\bye diff --git a/tests/fullname.tex b/tests/fullname.tex deleted file mode 100644 index 78cf4d0..0000000 --- a/tests/fullname.tex +++ /dev/null @@ -1,15 +0,0 @@ -\input luaotfload.sty - -\font\testa={LM Roman Slanted 10 Regular} at 10pt -\font\testb={LM Roman 9 Italic} at 10pt -\font\testc={TeX Gyre Termes Bold} at 25pt -% Also testing with absolute filename, please change the path according to your -% system -\font\testd=file:/usr/share/texmf/fonts/opentype/public/lm/lmmono10-italic.otf - -\testa abcd ABCD\par -\testb abcd ABCD\par -\testc abcd ABCD\par -\testd abcd ABCD\par - -\bye diff --git a/tests/itlc.tex b/tests/itlc.tex deleted file mode 100644 index bff0c39..0000000 --- a/tests/itlc.tex +++ /dev/null @@ -1,5 +0,0 @@ -\input luaotfload.sty -\font\testa={Latin Modern Roman:script=latn} at 10pt -\font\testb={Latin Modern Roman/I:script=latn} at 10pt -\testa ({\testb f\/}) -\bye diff --git a/tests/lookups.tex b/tests/lookups.tex deleted file mode 100644 index 8b03d8e..0000000 --- a/tests/lookups.tex +++ /dev/null @@ -1,20 +0,0 @@ -\input luaotfload.sty -%% lookup font by name (involving database) -\font\first=name:iwonaregular at 42pt -%% lookup font by file name (kpse) -\font\second=file:antpoltltsemiexpd-bolditalic.otf at 42pt -%% lookup font by name, with style in slash notation -\font\third={name:Antykwa torunska/I} at 42pt -%% unspecified lookup; in definers.read: -%% - first it falls back to “file” -%% - empty “method” field triggers fallback to “name” -%% - names.resolve -> kpse.lookup -> hit! -\font\fourth=iwona at 42pt - -{\first foo \endgraf} -{\second bar \endgraf} -{\third baz \endgraf} -{\fourth xyzzy \endgraf} - -\bye - diff --git a/tests/marks.tex b/tests/marks.tex deleted file mode 100644 index 9dcf460..0000000 --- a/tests/marks.tex +++ /dev/null @@ -1,10 +0,0 @@ -\input luaotfload.sty -\font\test={file:GenBasR.ttf:script=latn} -%font\test={name:AntykwaTorunska:script=latn} -\test ä\quad Ä - -\test a\char"0308 %% -> combining dihaeresis -\quad A\char"0308 %% -> combining dihaeresis -\quad j\char"0323 %% -> combining dot below - -\bye diff --git a/tests/math.tex b/tests/math.tex deleted file mode 100644 index a2615f1..0000000 --- a/tests/math.tex +++ /dev/null @@ -1,56 +0,0 @@ -% start out with plain.tex, -% having TFM-based CM fonts preloaded in \fam 0...3 - -% load OT math font in \fam 4 -\input luaotfload.sty -\font\4={name:XITS Math:mode=base;script=math} at 10pt -\font\5={name:XITS Math:mode=base;script=math;ssty=1} at 7pt -\font\6={name:XITS Math:mode=node;script=math;ssty=2} at 5pt -\textfont4=\4 \scriptfont4=\5 \scriptscriptfont4=\6 - -\Umathcode`a="7"4"1D44E -\Umathcode`b="7"4"1D44F -\Umathcode`x="7"4"1D465 -\Umathcode`y="7"4"1D466 -\Umathcode`A="7"4"1D434 -\Umathcode`B="7"4"1D435 -\Umathcode`C="7"4"1D436 -\Umathcode`P="7"4"1D443 -\Umathcode`3="7"4`3 -\Umathcode`+="2"4`+ -\Umathcode`=="3"4`= -\Umathcode`(="4"4`( -\Umathcode`)="5"4`) - -\Udelcode`(="4`( -\Udelcode`)="4`) - -$$\Uradical "4 "221A {x}$$ -$$\Uroot "4 "221A {3}{x^3+y^3}$$ - -$$ - \Udelimiterover "4 "23DE {a+b} -+ \Udelimiterunder "4 "23DF {a+b} = C -$$ - -$$ - \Umathaccent "0 "4 "23DE {a+b} -$$ - -$$ -A \mathrel{\Uoverdelimiter "4 "2192 {a+b}} -B \mathrel{\Uunderdelimiter "4 "2192 {a+b}} -$$ - -$$ -{a \overwithdelims() b} -$$ - - -\centerline{$ a \overwithdelims() b $} - -$$ -P(a) -$$ - -\bye diff --git a/tests/microtypography.tex b/tests/microtypography.tex deleted file mode 100644 index 99deb5f..0000000 --- a/tests/microtypography.tex +++ /dev/null @@ -1,36 +0,0 @@ -\input luaotfload.sty - -\pdfprotrudechars2 \pdfadjustspacing2 - -\font\testa=file:texgyretermes-regular:script=latn at 12pt -\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt - -\testa We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\testb We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\bye diff --git a/tests/opbd.fea b/tests/opbd.fea deleted file mode 100644 index 54f687a..0000000 --- a/tests/opbd.fea +++ /dev/null @@ -1,187 +0,0 @@ -languagesystem DFLT dlft; -languagesystem grek dflt; -languagesystem latn dflt; -languagesystem latn AZE; -languagesystem latn CRT; -languagesystem latn MOL; -languagesystem latn NLD; -languagesystem latn PLK; -languagesystem latn ROM; -languagesystem latn TRK; - -feature rtbd { - lookupflag 0; - pos \exclam <100 0 0 0>; - pos \percent <100 0 0 0>; - pos \ampersand <100 0 0 0>; - pos \parenright <300 0 0 0>; - pos \asterisk <200 0 0 0>; - pos \plus <250 0 0 0>; - pos \comma <500 0 0 0>; - pos \hyphen <500 0 0 0>; - pos \period <700 0 0 0>; - pos \slash <300 0 0 0>; - pos \one <100 0 0 0>; - pos \seven <50 0 0 0>; - pos \colon <500 0 0 0>; - pos \semicolon <500 0 0 0>; - pos \question <200 0 0 0>; - pos \at <50 0 0 0>; - pos \A <50 0 0 0>; - pos \K <50 0 0 0>; - pos \L <50 0 0 0>; - pos \T <50 0 0 0>; - pos \V <50 0 0 0>; - pos \W <50 0 0 0>; - pos \X <50 0 0 0>; - pos \Y <50 0 0 0>; - pos \k <50 0 0 0>; - pos \p <50 0 0 0>; - pos \r <50 0 0 0>; - pos \v <50 0 0 0>; - pos \w <50 0 0 0>; - pos \x <50 0 0 0>; - pos \y <70 0 0 0>; - pos \asciitilde <250 0 0 0>; - pos \Agrave <50 0 0 0>; - pos \Aacute <50 0 0 0>; - pos \Acircumflex <50 0 0 0>; - pos \Atilde <50 0 0 0>; - pos \Adieresis <50 0 0 0>; - pos \Aring <50 0 0 0>; - pos \Amacron <50 0 0 0>; - pos \Abreve <50 0 0 0>; - pos \Aogonek <50 0 0 0>; - pos \Kcommaaccent <50 0 0 0>; - pos \kcommaaccent <50 0 0 0>; - pos \Lacute <50 0 0 0>; - pos \Lcommaaccent <50 0 0 0>; - pos \Lcaron <50 0 0 0>; - pos \Ldot <50 0 0 0>; - pos \Lslash <50 0 0 0>; - pos \racute <50 0 0 0>; - pos \rcommaaccent <50 0 0 0>; - pos \rcaron <50 0 0 0>; - pos \wcircumflex <50 0 0 0>; - pos \ycircumflex <70 0 0 0>; - pos \Acaron <50 0 0 0>; - pos \Aringacute <50 0 0 0>; - pos \Adblgrave <50 0 0 0>; - pos \rdblgrave <50 0 0 0>; - pos \uni021A <50 0 0 0>; - pos \Alpha <50 0 0 0>; - pos \Kappa <50 0 0 0>; - pos \Lambda <50 0 0 0>; - pos \Tau <50 0 0 0>; - pos \Ldotbelow <50 0 0 0>; - pos \Ldotbelowmacron <50 0 0 0>; - pos \rdotaccent <50 0 0 0>; - pos \rdotbelow <50 0 0 0>; - pos \rdotbelowmacron <50 0 0 0>; - pos \Tdotbelow <50 0 0 0>; - pos \Tlinebelow <50 0 0 0>; - pos \wgrave <50 0 0 0>; - pos \wacute <50 0 0 0>; - pos \wdieresis <50 0 0 0>; - pos \Ahookabove <50 0 0 0>; - pos \Acircumflexacute <50 0 0 0>; - pos \Acircumflexgrave <50 0 0 0>; - pos \Acircumflexhookabove <50 0 0 0>; - pos \Acircumflextilde <50 0 0 0>; - pos \Acircumflexdotbelow <50 0 0 0>; - pos \Abreveacute <50 0 0 0>; - pos \Abrevegrave <50 0 0 0>; - pos \Abrevehookabove <50 0 0 0>; - pos \Abrevetilde <50 0 0 0>; - pos \Abrevedotbelow <50 0 0 0>; - pos \ygrave <70 0 0 0>; - pos \ydotbelow <70 0 0 0>; - pos \yhookabove <70 0 0 0>; - pos \ytilde <70 0 0 0>; - pos \endash <300 0 0 0>; - pos \emdash <200 0 0 0>; - pos \quoteleft <700 0 0 0>; - pos \quoteright <700 0 0 0>; - pos \quotedblleft <400 0 0 0>; - pos \quotedblright <400 0 0 0>; - pos \Aogonekacute <50 0 0 0>; - pos \L_uni0303 <50 0 0 0>; - pos \T_uni0303 <50 0 0 0>; - pos \T_uni0308 <50 0 0 0>; -} rtbd; - -feature lfbd { - lookupflag 0; - pos \percent <-100 0 -100 0>; - pos \ampersand <-50 0 -50 0>; - pos \parenleft <-100 0 -100 0>; - pos \asterisk <-200 0 -200 0>; - pos \plus <-250 0 -250 0>; - pos \hyphen <-400 0 -400 0>; - pos \slash <-200 0 -200 0>; - pos \one <-100 0 -100 0>; - pos \at <-50 0 -50 0>; - pos \A <-50 0 -50 0>; - pos \J <-50 0 -50 0>; - pos \T <-50 0 -50 0>; - pos \V <-50 0 -50 0>; - pos \W <-50 0 -50 0>; - pos \X <-50 0 -50 0>; - pos \Y <-50 0 -50 0>; - pos \p <-50 0 -50 0>; - pos \q <-50 0 -50 0>; - pos \v <-50 0 -50 0>; - pos \w <-50 0 -50 0>; - pos \x <-50 0 -50 0>; - pos \y <-50 0 -50 0>; - pos \asciitilde <-200 0 -200 0>; - pos \Agrave <-50 0 -50 0>; - pos \Aacute <-50 0 -50 0>; - pos \Acircumflex <-50 0 -50 0>; - pos \Atilde <-50 0 -50 0>; - pos \Adieresis <-50 0 -50 0>; - pos \Aring <-50 0 -50 0>; - pos \Amacron <-50 0 -50 0>; - pos \Abreve <-50 0 -50 0>; - pos \Aogonek <-50 0 -50 0>; - pos \Jcircumflex <-50 0 -50 0>; - pos \wcircumflex <-50 0 -50 0>; - pos \ycircumflex <-50 0 -50 0>; - pos \Acaron <-50 0 -50 0>; - pos \Aringacute <-50 0 -50 0>; - pos \Adblgrave <-50 0 -50 0>; - pos \uni021A <-50 0 -50 0>; - pos \Alpha <-50 0 -50 0>; - pos \Lambda <-50 0 -50 0>; - pos \Tau <-50 0 -50 0>; - pos \Tdotbelow <-50 0 -50 0>; - pos \Tlinebelow <-50 0 -50 0>; - pos \wgrave <-50 0 -50 0>; - pos \wacute <-50 0 -50 0>; - pos \wdieresis <-50 0 -50 0>; - pos \Ahookabove <-50 0 -50 0>; - pos \Acircumflexacute <-50 0 -50 0>; - pos \Acircumflexgrave <-50 0 -50 0>; - pos \Acircumflexhookabove <-50 0 -50 0>; - pos \Acircumflextilde <-50 0 -50 0>; - pos \Acircumflexdotbelow <-50 0 -50 0>; - pos \Abreveacute <-50 0 -50 0>; - pos \Abrevegrave <-50 0 -50 0>; - pos \Abrevehookabove <-50 0 -50 0>; - pos \Abrevetilde <-50 0 -50 0>; - pos \Abrevedotbelow <-50 0 -50 0>; - pos \ygrave <-50 0 -50 0>; - pos \ydotbelow <-50 0 -50 0>; - pos \yhookabove <-50 0 -50 0>; - pos \ytilde <-50 0 -50 0>; - pos \endash <-300 0 -300 0>; - pos \emdash <-200 0 -200 0>; - pos \quoteleft <-500 0 -500 0>; - pos \quoteright <-500 0 -500 0>; - pos \quotedblleft <-300 0 -300 0>; - pos \quotedblright <-300 0 -300 0>; - pos \Aogonekacute <-50 0 -50 0>; - pos \J_uni030C.cap <-50 0 -50 0>; - pos \T_uni0303 <-50 0 -50 0>; - pos \T_uni0308 <-50 0 -50 0>; -} lfbd; diff --git a/tests/opbd.tex b/tests/opbd.tex deleted file mode 100644 index 1a838cd..0000000 --- a/tests/opbd.tex +++ /dev/null @@ -1,35 +0,0 @@ -\input luaotfload.sty - -\pdfprotrudechars2 \pdfadjustspacing2 - -\font\testa=file:texgyrepagella-regular:script=latn at 12pt -\font\testb=file:texgyrepagella-regular:mode=node;script=latn;protrusion=yes;featurefile=opbd.fea;+opbd at 12pt - -\testa We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\testb We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par -\bye diff --git a/tests/opticalsize.tex b/tests/opticalsize.tex deleted file mode 100644 index 53b1bb8..0000000 --- a/tests/opticalsize.tex +++ /dev/null @@ -1,13 +0,0 @@ -\input luaotfload.sty - -\font\testa={Latin Modern Roman/S=12} at 10pt -\font\testb={Latin Modern Roman} at 5pt -\font\testc={Latin Modern Roman} at 10pt -\font\testd={Latin Modern Roman/S=15} at 10pt -\font\teste={Latin Modern Roman/S=3} at 10pt -\testa abcd ABCD \par -\testb abcd ABCD \par -\testc abcd ABCD \par -\testd abcd ABCD \par -\teste abcd ABCD \par -\bye diff --git a/tests/pln-aux-1.tex b/tests/pln-aux-1.tex deleted file mode 100644 index a228be0..0000000 --- a/tests/pln-aux-1.tex +++ /dev/null @@ -1,55 +0,0 @@ -\input luaotfload.sty - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% usage for glyph tests -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\baselineskip=17.28pt - -\font\iwonaregular=name:iwona at 14.4pt -\font\lmromanten=file:lmroman10-regular.otf at 14.4pt -\font\cmuregular=file:cmunrm.otf at 14.4pt - -%% wrap tests in macros (could move to style file) -\def\doifglyphelse#1#2#3{% - \directlua{ - local codepoint = tonumber('\string#1') - if not codepoint then codepoint = unicode.utf8.byte('\string#1') end - if luaotfload.aux.font_has_glyph(font.current(), codepoint) then - tex.sprint('\string#2') - else - tex.sprint('\string#3') - end - }% -} - -\def\doifglyph#1#2{\doifglyphelse{#1}{#2}{}} - -%% no otf font loaded yet, so both fail: -first: -\doifglyphelse{a}{true}{false} -\doifglyph {a}{yep} - -%% load lm and try repeat: -\lmromanten -second: -\doifglyphelse{a}{true}{false} -\doifglyph {a}{yep} - -%% let’s test some more free fonts -\def\checkglyphset{% - \doifglyphelse ö{ö}{nope} - \doifglyphelse п{п}{nope} - \doifglyphelse α{α}{nope} - \doifglyphelse Æ{Æ}{nope} - \doifglyphelse ą{ą}{nope} - \doifglyphelse ř{ř}{nope} - \doifglyphelse ˝{˝}{nope} - \doifglyphelse ѩ{ѩ}{nope} - \endgraf -} - -\iwonaregular \checkglyphset -\lmromanten \checkglyphset -\cmuregular \checkglyphset - -\bye diff --git a/tests/pln-aux-2.tex b/tests/pln-aux-2.tex deleted file mode 100644 index 62192a5..0000000 --- a/tests/pln-aux-2.tex +++ /dev/null @@ -1,102 +0,0 @@ -\input luaotfload.sty -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% script, features, and language -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\font\minionregular=file:MinionPro_Regular.otf at 9pt -\font\biolinum=file:LinBiolinum_R.otf at 9pt -\font\cmuregular=file:cmunrm.otf at 9pt - -%% (1) luaotfload.aux.provides_script(font_id, script) -%% #1 defined font; #2 OT script tag -\def\providesscript[#1][#2]{% - \bgroup#1% - let’s see whether \detokenize{#1} has script #2: - \directlua{ - local aux = luaotfload.aux - local succ = aux.provides_script(font.current(), [[#2]]) - if succ then tex.sprint"true" else tex.sprint"false" end - }% - \egroup - \endgraf% -} - -\providesscript [\minionregular][latn]%% Latin -\providesscript [\biolinum][latn] -\providesscript [\cmuregular][latn] -\providesscript [\minionregular][cyrl]%% Cyrillic -\providesscript [\biolinum][cyrl] -\providesscript [\cmuregular][cyrl] -\providesscript [\minionregular][tibt]%% Tibetan -\providesscript [\biolinum][tibt] -\providesscript [\cmuregular][tibt] - -\hrule % -------------------------------------------------------------- - -%% (2) luaotfload.aux.provides_language(font_id, script, language) -%% #1 defined font; #2 OT script tag; #3 OT language tag -\def\provideslanguage[#1][#2][#3]{% - \bgroup#1% - let’s see whether \detokenize{#1} supports language #3 for script #2: - \directlua{ - local aux = luaotfload.aux - local succ = aux.provides_language(font.current(), [[#2]], [[#3]]) - if succ then tex.sprint"true" else tex.sprint"false" end - }% - \egroup - \endgraf% -} - -\provideslanguage [\minionregular][latn][nld]%% Latin/Dutch -\provideslanguage [\biolinum][latn][nld] -\provideslanguage [\cmuregular][latn][nld] -\provideslanguage [\minionregular][latn][deu]%% Latin/German -\provideslanguage [\biolinum][latn][deu] -\provideslanguage [\cmuregular][latn][deu] -\provideslanguage [\minionregular][cyrl][rus]%% Cyrillic/Russian -\provideslanguage [\biolinum][cyrl][rus] -\provideslanguage [\cmuregular][cyrl][rus] -\provideslanguage [\minionregular][cyrl][klm]%% Cyrillic/Kalmyk -\provideslanguage [\biolinum][cyrl][klm] -\provideslanguage [\cmuregular][cyrl][klm] -\provideslanguage [\minionregular][cyrl][srb]%% Cyrillic/Serbian -\provideslanguage [\biolinum][cyrl][srb] -\provideslanguage [\cmuregular][cyrl][srb] -\provideslanguage [\minionregular][tibt][tib]%% Tibetan -\provideslanguage [\biolinum][tibt][tib] -\provideslanguage [\cmuregular][tibt][tib] - -\hrule % -------------------------------------------------------------- - -%% (3) luaotfload.aux.provides_feature( -%% font_id, script, language, feature) -%% #1 defined font; #2 OT script tag; -%% #3 OT language tag; #4 OT feature -\def\providesfeature[#1][#2][#3][#4]{%this is getting ridiculous - \bgroup#1% - let’s see whether \detokenize{#1} supports feature #4 for the - combination of script #2 with language #3: - \directlua{ - local aux = luaotfload.aux - local succ = aux.provides_feature( - font.current(), [[#2]], [[#3]], [[#4]]) - if succ then tex.sprint"true" else tex.sprint"false" end - }% - \egroup - \endgraf% -} - -\providesfeature [\minionregular][latn][nld][liga]%% Latin/Dutch -\providesfeature [\biolinum][latn][nld][liga] -\providesfeature [\cmuregular][latn][nld][liga] -\providesfeature [\minionregular][latn][deu][liga]%% Latin/German -\providesfeature [\biolinum][latn][deu][liga] -\providesfeature [\cmuregular][latn][deu][liga] -\providesfeature [\minionregular][cyrl][srb][liga]%% Cyrillic/Serbian -\providesfeature [\biolinum][cyrl][srb][liga] -\providesfeature [\cmuregular][cyrl][srb][liga] -\providesfeature [\minionregular][tibt][tib][liga]%% Tibetan -\providesfeature [\biolinum][tibt][tib][liga] -\providesfeature [\cmuregular][tibt][tib][liga] - -\bye diff --git a/tests/pln-aux-3.tex b/tests/pln-aux-3.tex deleted file mode 100644 index 12a80cf..0000000 --- a/tests/pln-aux-3.tex +++ /dev/null @@ -1,39 +0,0 @@ -\input luaotfload.sty - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% math dimension getter -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\font\xitsmath=file:xits-math.otf -\font\cambriamath=file:cambria.ttc(1) - -\font\main=file:Iwona-Regular.otf at 12pt\main - -\directlua{ - local aux = luaotfload.aux - local test_a = function (fontname, dimension) - tex.sprint( - "(", fontname, " (", dimension, " ", - aux.get_math_dimension(fontname, dimension), - [[))\endgraf ]]) - end - - local test_b = function (fontname, dimension) - aux.sprint_math_dimension(fontname, dimension) - tex.print[[\endgraf ]] - end - - test_a("xitsmath", "AxisHeight") - test_a("xitsmath", "RadicalVerticalGap") - test_a("cambriamath", "StackTopShiftUp") - test_a("cambriamath", "FractionNumeratorGapMin") - - test_b("xitsmath", "AxisHeight") - test_b("xitsmath", "RadicalVerticalGap") - test_b("cambriamath", "StackTopShiftUp") - test_b("cambriamath", "FractionNumeratorGapMin") -} - -foo bar baz - -\bye diff --git a/tests/pln-aux-4.tex b/tests/pln-aux-4.tex deleted file mode 100644 index 80ffc0b..0000000 --- a/tests/pln-aux-4.tex +++ /dev/null @@ -1,41 +0,0 @@ -\input luaotfload.sty - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% unicode character mappings -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\font\ptserifregular = file:PTF55F.ttf \ptserifregular - -%% here we map the function luaotfload.aux.name_of_slot -%% on a short text, printing a list of letters, their -%% code points and names (as specified in the Adobe -%% Glyph List). - -\directlua{ - local aux = luaotfload.aux - local cbk = function (str) - if string.match(str, "^EOF") then - luatexbase.remove_from_callback("process_input_buffer", "weird") - return [[the end!]] - end - local res = { } - for chr in string.utfcharacters(str) do - local val = unicode.utf8.byte(chr) - local line = chr .. " <> " .. tostring(val) - line = line .. " <> " .. (aux.name_of_slot(val) or "") - res[\string#res+1] = line - end - return table.concat(res, [[\endgraf]]) - end - - luatexbase.add_to_callback("process_input_buffer", cbk, "weird") -} - -Я узнал что у меня -Есть огромная семья -И тропинка и лесок -В поле каждый колосок - -EOF - -\bye diff --git a/tests/pln-request-4-slashed.tex b/tests/pln-request-4-slashed.tex deleted file mode 100644 index 5e7d99e..0000000 --- a/tests/pln-request-4-slashed.tex +++ /dev/null @@ -1,12 +0,0 @@ -\ifdefined\directlua\input luaotfload.sty\fi -\font\iwona =iwona at 20pt -\font\iwonabold =iwona/b at 20pt -\font\iwonaitalic =iwona/i at 20pt -\font\iwonabolditalic =iwona/bi at 20pt - -\def\test{foo bar baz \endgraf} -{\iwona \test} -{\iwonabold \test} -{\iwonaitalic \test} -{\iwonabolditalic \test} -\bye diff --git a/tests/pln-request-5-cached.tex b/tests/pln-request-5-cached.tex deleted file mode 100644 index 8ba4a5e..0000000 --- a/tests/pln-request-5-cached.tex +++ /dev/null @@ -1,18 +0,0 @@ -\ifdefined\directlua - \directlua{config = config or { luaotfload = { } } - config.luaotfload.resolver = "cached" - config.luaotfload.loglevel = 5 } - \input luaotfload.sty -\fi - -\font\iwona =name:iwona at 20pt -\font\iwonabold =name:iwona/b at 20pt -\font\iwonaitalic =name:iwona/i at 20pt -\font\iwonabolditalic =name:iwona/bi at 20pt - -\def\test{foo bar baz \endgraf} -{\iwona \test} -{\iwonabold \test} -{\iwonaitalic \test} -{\iwonabolditalic \test} -\bye diff --git a/tests/pln-subfont-1.tex b/tests/pln-subfont-1.tex deleted file mode 100644 index fb8e1e7..0000000 --- a/tests/pln-subfont-1.tex +++ /dev/null @@ -1,12 +0,0 @@ -\ifdefined\directlua\input luaotfload.sty\fi -%% This requires the Cambria fonts from MS. -\directlua{ - inspect(fontloader.info"cambria.ttc") -} -%% Here we load both subfonts in the collection -%% with the not-quite documented subfont syntax. -\font\subfontone="file:cambria.ttc(0)" at 42pt -\font\subfonttwo="file:cambria.ttc(1)" at 42pt -\subfontone foo bar baz \endgraf -\subfonttwo foo bar baz \endgraf -\bye diff --git a/tests/pln-tfm.tex b/tests/pln-tfm.tex deleted file mode 100644 index 16ae41a..0000000 --- a/tests/pln-tfm.tex +++ /dev/null @@ -1,10 +0,0 @@ -\ifdefined\directlua\input luaotfload.sty \fi -%% TFM’s can be loaded with a file: request ... -\font\antykwatorunska="file:rm-anttr" -%% or with an anonymous request, like in þe olde TeX: -\font\antykwatorunskabcap=ec-anttbcap -\font\lmromanten={file:ec-lmr10} at 10pt -\antykwatorunska foo bar -\antykwatorunskabcap baz xyzzy -\lmromanten Donde, está, la biblioteca. Me llamo T-Bone La araña discoteca. -\bye diff --git a/tests/sanitize_color.tex b/tests/sanitize_color.tex deleted file mode 100644 index fe95d37..0000000 --- a/tests/sanitize_color.tex +++ /dev/null @@ -1,8 +0,0 @@ -\input luaotfload.sty -\font\testa={name:Latin Modern Roman:color=0000ff99f} at 10pt -\font\testb={name:Latin Modern Roman:color=0000ff9} at 10pt -\font\testc={name:Latin Modern Roman:color=0000f} at 10pt -\testa test\par -\testb test\par -\testc test\par -\bye diff --git a/tests/systemfonts.tex b/tests/systemfonts.tex deleted file mode 100644 index af08509..0000000 --- a/tests/systemfonts.tex +++ /dev/null @@ -1,50 +0,0 @@ -\input luaotfload.sty - -\font\termesr ={TeX Gyre Termes:+liga} at 10pt -\font\termesb ={TeX Gyre Termes/B:+liga} at 10pt -\font\termesi ={TeX Gyre Termes/I:+liga} at 10pt -\font\termesbi ={TeX Gyre Termes/BI:+liga} at 10pt -\font\termesib ={TeX Gyre Termes/IB:+liga} at 10pt -\font\termesicu={TeX Gyre Termes/ICU/B:+liga} at 10pt -\font\termesaat={TeX Gyre Termes/AAT/IB:+liga} at 10pt -\font\termess ={TeX Gyre Termes/ICU/S=10:+liga} at 10pt -\font\dsans ={DejaVu Sans:+liga} at 10pt -\font\dsansi ={DejaVu Sans/I:+liga} at 10pt -\font\dsansb ={DejaVu Sans/B:+liga} at 10pt -\font\dsansib ={DejaVu Sans/IB:+liga} at 10pt -\font\dsansextr={DejaVu Sans/Extra Light:+liga} at 10pt -\font\dsansecnd={DejaVu Sans/Condensed:+liga} at 10pt -\font\lmr ={Latin Modern Roman:+liga} at 10pt -\font\lmf ={Latin Modern Roman/S=5:+liga} at 10pt -\font\lmb ={Latin Modern Roman/B:+liga} at 10pt -\font\lmi ={Latin Modern Roman/I:+liga} at 10pt -\font\lmbi ={Latin Modern Roman/BI:+liga} at 10pt -\font\lms ={Latin Modern Roman Slanted:+liga} at 10pt -\font\lmltn ={Latin Modern Roman:script=latn} at 10pt -%% get this font here: -%% http://sourceforge.net/projects/arabeyes/files/kacst_fonts/kacst_one_5.0.tar.bz2/download -\font\arab ={KacstOne:mode=node;script=arab} at 10pt - -\termesr fi fl ffi ffl ff\par -\termesb fi fl ffi ffl ff\par -\termesi fi fl ffi ffl ff\par -\termesbi fi fl ffi ffl ff\par -\termesib fi fl ffi ffl ff\par -\termesicu fi fl ffi ffl ff\par -\termesaat fi fl ffi ffl ff\par -\termess fi fl ffi ffl ff\par -\dsans fi fl ffi ffl ff\par -\dsansi fi fl ffi ffl ff\par -\dsansb fi fl ffi ffl ff\par -\dsansib fi fl ffi ffl ff\par -\dsansextr fi fl ffi ffl ff\par -\dsansecnd fi fl ffi ffl ff\par -\lmr fi fl ffi ffl ff\par -\lmf fi fl ffi ffl ff\par -\lmb fi fl ffi ffl ff\par -\lmi fi fl ffi ffl ff\par -\lmbi fi fl ffi ffl ff\par -\lms fi fl ffi ffl ff\par -\lmltn fi fl ffi ffl ff\par -\leavevmode\arab\luatextextdir TRT بِسْمِ الله الرَّحْمنِ الرحيم\par -\bye diff --git a/tests/texligatures.tex b/tests/texligatures.tex deleted file mode 100644 index 8317ee1..0000000 --- a/tests/texligatures.tex +++ /dev/null @@ -1,7 +0,0 @@ -\input luaotfload.sty - -\font\testa={file:lmroman10-regular:mode=base;script=latn;+tlig} at 10pt -\font\testb={file:lmroman10-regular:mode=node;script=latn;+tlig} at 10pt -\testa ``fi `fl' ffi--ffl---ff'' !` ?` "\par -\testb ``fi `fl' ffi--ffl---ff'' !` ?` "\par -\bye diff --git a/tests/tfmofm.ltx b/tests/tfmofm.ltx deleted file mode 100644 index 0f9f904..0000000 --- a/tests/tfmofm.ltx +++ /dev/null @@ -1,6 +0,0 @@ -\documentclass{article} -\usepackage{luaotfload} - -\begin{document} -Hello \(1+1=\sqrt{4}\) -\end{document} diff --git a/tests/tkrn.fea b/tests/tkrn.fea deleted file mode 100644 index c83927d..0000000 --- a/tests/tkrn.fea +++ /dev/null @@ -1,8 +0,0 @@ -languagesystem DFLT dflt; -languagesystem latn dflt; - -feature tkrn { - lookupflag 0; - pos E X -125; - pos T <0 0 -166 0> E <0 -235 0 0>; -} tkrn; diff --git a/tests/weirdfonts.tex b/tests/weirdfonts.tex deleted file mode 100644 index 9cbf8ac..0000000 --- a/tests/weirdfonts.tex +++ /dev/null @@ -1,15 +0,0 @@ -%% non-standard fonts deserve an extra test file -\documentclass{scrartcl} -\usepackage{fontspec} -%% ···································································· -%% libertine monospace -%% ------------------- -%% real-world example from: http://tex.stackexchange.com/q/110566 -%% causing database lookups to fail; addressed in luaotfload since -%% https://github.com/phi-gamma/luaotfload/commit/4d0d2c19ab36d4918a72041a087fbcb451ac8c52 -\setmonofont{Linux Libertine Mono O} -%% ···································································· - -\begin{document} - foo {\ttfamily bar} baz -\end{document} diff --git a/tests/zero_width_marks_lig.tex b/tests/zero_width_marks_lig.tex deleted file mode 100644 index 2c6dba9..0000000 --- a/tests/zero_width_marks_lig.tex +++ /dev/null @@ -1,16 +0,0 @@ -\input luaotfload.sty - -% https://bugs.freedesktop.org/attachment.cgi?id=72363 -\font\testa=file:TestLig.ttf:script=tibt;+ccmp+abvs+blws+kern at 10pt - -\testa གཚོའི་ཁིའུ་ཨཱཿཀ - -% good result for the first part: -% https://bugs.freedesktop.org/attachment.cgi?id=72365 -% for the second part, the two circles shoud appear clearlybefore the last -% letter, not mixed with it - -% see http://lists.freedesktop.org/archives/harfbuzz/2013-April/003101.html -% for some technical details. - -\bye -- cgit v1.2.3 From e8016ee1a59d7d5921bc4918a65ce6a37a4b07e7 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:32:41 +0100 Subject: [*] excise test-related make rules --- Makefile | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 2d618e7..aec2ac0 100644 --- a/Makefile +++ b/Makefile @@ -34,12 +34,6 @@ UNPACKED = luaotfload.sty luaotfload.lua GENERATED = $(GRAPHED) $(UNPACKED) $(COMPILED) $(RESOURCES) $(MAN) SOURCE = $(DTX) $(MANSOURCE) $(OTFL) README Makefile NEWS $(RESOURCESCRIPTS) -# test files -TESTDIR = tests -TESTSTATUS = $(wildcard $(TESTDIR)/*.tex $(TESTDIR)/*.ltx) -TESTSTATUS_SYS = $(TESTDIR)/systemfonts.tex $(TESTDIR)/fontconfig_conf_reading.tex -TESTSTATUS_TL = $(filter-out $(TESTSTATUS_SYS), $(TESTSTATUS)) - # Files grouped by installation location SCRIPTSTATUS = $(SCRIPT) $(OLDSCRIPT) $(RESOURCESCRIPTS) RUNSTATUS = $(UNPACKED) $(filter-out $(SCRIPTSTATUS),$(OTFL)) @@ -146,21 +140,6 @@ install: $(ALL_STATUS) @echo "Installing in '$(TEXMFROOT)'." $(run-install) -check: $(RUNSTATUS) $(TESTSTATUS_TL) - @rm -rf var - @for f in $(TESTSTATUS_TL); do \ - echo "check: luatex $$f"; \ - luatex --interaction=batchmode $$f \ - > /dev/null || exit $$?; \ - done - -check-all: $(TESTSTATUS_SYS) check - @cd $(TESTDIR); for f in $(TESTSTATUS_SYS); do \ - echo "check: luatex $$f"; \ - $(TESTENV) luatex --interaction=batchmode ../$$f \ - > /dev/null || exit $$?; \ - done - manifest: @echo "Source files:" @for f in $(SOURCE); do echo $$f; done @@ -169,9 +148,9 @@ manifest: @for f in $(GENERATED); do echo $$f; done clean: - @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg *.out $(TESTDIR)/*.log + @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg *.out mrproper: clean - @$(RM) -- $(GENERATED) $(ZIPS) $(GLYPHSOURCE) $(TESTDIR)/*.pdf + @$(RM) -- $(GENERATED) $(ZIPS) $(GLYPHSOURCE) @$(RM) -r -- $(DISTDIR) -- cgit v1.2.3 From 56ac9fbd9adf570501e358334adef356c572905b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:34:00 +0100 Subject: [doc] update news --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 922d4ff..9211e31 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ Change History 2014/**/**, luaotfload v2.5 * Remove legacy code. * Remove compatibility with the old mkluatexfontdb script. + * Remove test directory. Use https://bitbucket.org/phg/lua-la-tex-tests + instead. 2013/12/31, luaotfload v2.4 * Additional self-tests, now in separate file (luaotfload-diagnostics.lua) -- cgit v1.2.3 From cfd807af6c4f27fc8bc95744cd1c4da8a07559e1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 18:14:20 +0100 Subject: [db] handle missing metadata table Fixes issue #164, hopefully. --- luaotfload-database.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index b22afd7..4be54d6 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -574,7 +574,16 @@ load_names = function (dry_run) report ("info", 3, "db", "Loading took %0.f ms.", 1000 * (osgettimeofday () - starttime)) - local db_version, nms_version = data.meta.version, names.version + local db_version, nms_version + if data.meta then + db_version = data.meta.version + else + --- Compatibility branch; the version info used to be + --- stored in the table root which is why updating from + --- an earlier index version broke. + db_version = data.version or -42 --- invalid + end + nms_version = names.version if db_version ~= nms_version then report ("both", 0, "db", [[Version mismatch; expected %4.3f, got %4.3f.]], -- cgit v1.2.3 From 5d21d8a105a5634e16a9c45ba5cbf6749a7b47db Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 18:17:16 +0100 Subject: [db] fix incorrect local --- luaotfload-database.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 4be54d6..cc32bb8 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -83,7 +83,7 @@ local tableconcat = table.concat local tablesort = table.sort local utf8gsub = unicode.utf8.gsub local utf8lower = unicode.utf8.lower -local utf8length = unicode.utf8.length +local utf8len = unicode.utf8.len local zlibcompress = zlib.compress --- these come from Lualibs/Context @@ -2127,7 +2127,7 @@ end local truncate_string = function (str, restrict) local tw = luaotfloadconfig.termwidth local wd = tw - restrict - local len = utf8length (str) + local len = utf8len (str) if wd - len < 0 then --- combined length exceeds terminal, str = ".." .. stringsub(str, len - wd + 2) -- cgit v1.2.3 From 8cf014615f6dd78b59d03a189e91140c48770373 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 20:03:08 +0100 Subject: [db] use (sanitized) names.fullname field when resolving fonts by name --- luaotfload-database.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index cc32bb8..72b043b 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1070,9 +1070,10 @@ local resolve_fontname = function (specification, name, style) local face = mappings [i] local prefmodifiers = face.prefmodifiers local subfamily = face.subfamily - if face.fontname == name - or face.fullname == name - or face.psname == name + if face.fontname == name + or face.splainname == name + or face.fullname == name + or face.psname == name then return face.basename, face.subfont elseif face.familyname == name then @@ -1608,6 +1609,7 @@ t1_fullinfo = function (filename, _subfont, location, basename, format) fontname = sanitized.fontname, familyname = sanitized.familyname, plainname = fullname, + splainname = sanitized.fullname, psname = sanitized.fontname, version = metadata.version, size = false, @@ -2775,6 +2777,7 @@ local pull_values = function (entry) entry.psname = english.psname entry.fontname = info.fontname entry.fullname = english.fullname or info.fullname + entry.splainname = metadata.fullname entry.prefmodifiers = english.prefmodifiers local metafamily = metadata.familyname local familyname = english.preffamily or english.family -- cgit v1.2.3 From 7e1a7178de67590f0a484d06abfb933062c0ac87 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 20:17:47 +0100 Subject: [tests] include two kinds of tests for Minion Pro --- mktests | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mktests b/mktests index 688e5f8..baa710c 100755 --- a/mktests +++ b/mktests @@ -86,6 +86,11 @@ local infer_regular_style = { { "Garamond Premier Pro", "GaramondPremrPro.otf" }, { "CMU Serif", "cmunrm.otf" }, { "CMU Sans Serif", "cmunss.otf" }, + { "Minion Pro", "MinionPro_Regular.otf" }, + --- Below test will succeed only if we match for the + --- splainname (= sanitized tfmdata.fullname) field + --- explicitly. + { "Minion Pro Italic", "MinionPro_It.otf" }, } local choose_optical_size = { @@ -120,6 +125,25 @@ local choose_style = { { { name = "CMU Sans Serif", style = "italic" }, "cmunsi.otf" }, -- no “italic” but “oblique” { { name = "CMU Sans Serif", style = "bold" }, "cmunsx.otf" }, { { name = "CMU Sans Serif", style = "bolditalic" }, "cmunso.otf" }, + --[[-- + Minion Pro Italic is exceptionally weird regarding identifiers in + that the postscript fontname and both info.fontname and + info.fullname are given as “minionproit”. Now its english fullname + (field 18) is “minionproital”. Only the value “fullname” in the root of + the tfmdata structure (not the one returned by fontloader.info()!) + accurately yields “Minion Pro Italic”. + + To complete the picture, the file naming isn’t very consistent either: + we find the suffixes “Regular” and “Bold”, but “It” and “BoldIt”. What + the hell were the designers smoking? + + Also, the full Minion Pro set comes with different optical sizes which + for monetary reasons cannot considered here. + --]]-- + { { name = "Minion Pro", style = "regular" }, "MinionPro_Regular.otf" }, + { { name = "Minion Pro", style = "italic" }, "MinionPro_It.otf" }, + { { name = "Minion Pro", style = "bold" }, "MinionPro_Bold.otf" }, + { { name = "Minion Pro", style = "bolditalic" }, "MinionPro_BoldIt.otf" }, } --- this needs a database built with --formats=+pfa,pfb,afm -- cgit v1.2.3 From a69e72718162d0bf1b701e31e67de2f2b8d2aebd Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 22:33:19 +0100 Subject: [main] set correct default loglevel when running as tex (seriously, dtx is an abomination) --- luaotfload.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 320b9d9..f450d61 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1595,7 +1595,7 @@ config.luaotfload = config.luaotfload or { } config.luaotfload.resolver = config.luaotfload.resolver or "cached" config.luaotfload.definer = config.luaotfload.definer or "patch" config.luaotfload.compatibility = config.luaotfload.compatibility or false -config.luaotfload.loglevel = config.luaotfload.loglevel or 1 +config.luaotfload.loglevel = config.luaotfload.loglevel or 2 config.luaotfload.color_callback = config.luaotfload.color_callback or "pre_linebreak_filter" config.luaotfload.prioritize = config.luaotfload.prioritize or "sys" config.luaotfload.names_dir = config.luaotfload.names_dir or "names" -- cgit v1.2.3 From 5d207c36c8bdf259f5c8b4e7d1a7894774f0edcf Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 22:43:05 +0100 Subject: [log] fix newline handling of the last status message when imitating texio.*() Issue reported by /u/eg9 on https://github.com/lualatex/luaotfload/issues/164#issuecomment-31551430 --- luaotfload-override.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/luaotfload-override.lua b/luaotfload-override.lua index a692cb4..7cb9c5d 100644 --- a/luaotfload-override.lua +++ b/luaotfload-override.lua @@ -166,6 +166,8 @@ if texjob == true then statusln = function (str) if first_status == false then iowrite (kill_line) + else + iowrite "\n" end iowrite (str) end @@ -326,7 +328,9 @@ end local status_stop = function (...) if first_status == false then status_writer(...) - writeln "" + if texjob == false then + writeln "" + end end end -- cgit v1.2.3 From 1d16a614853476a8cc00f06a4f018e515b175b8d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 6 Jan 2014 21:00:17 +0100 Subject: [fontloader] sync with Context as of 2014-01-06 --- luaotfload-fontloader.lua | 140 +++++++++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 59 deletions(-) diff --git a/luaotfload-fontloader.lua b/luaotfload-fontloader.lua index 1773241..2563739 100644 --- a/luaotfload-fontloader.lua +++ b/luaotfload-fontloader.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 12/24/13 17:52:44 +-- merge date : 01/06/14 18:10:50 do -- begin closure to overcome local limits and interference @@ -6405,7 +6405,7 @@ local type,next,tonumber,tostring=type,next,tonumber,tostring local abs=math.abs local insert=table.insert local lpegmatch=lpeg.match -local reversed,concat,remove=table.reversed,table.concat,table.remove +local reversed,concat,remove,sortedkeys=table.reversed,table.concat,table.remove,table.sortedkeys local ioflush=io.flush local fastcopy,tohash,derivetable=table.fastcopy,table.tohash,table.derive local formatters=string.formatters @@ -7045,7 +7045,6 @@ actions["prepare glyphs"]=function(data,filename,raw) } local altuni=glyph.altuni if altuni then - local d for i=1,#altuni do local a=altuni[i] local u=a.unicode @@ -7058,15 +7057,8 @@ actions["prepare glyphs"]=function(data,filename,raw) vv={ [u]=unicode } variants[v]=vv end - elseif d then - d[#d+1]=u - else - d={ u } end end - if d then - duplicates[unicode]=d - end end else report_otf("potential problem: glyph %U is used but empty",index) @@ -7084,47 +7076,49 @@ actions["check encoding"]=function(data,filename,raw) local duplicates=resources.duplicates local mapdata=raw.map or {} local unicodetoindex=mapdata and mapdata.map or {} + local indextounicode=mapdata and mapdata.backmap or {} local encname=lower(data.enc_name or mapdata.enc_name or "") local criterium=0xFFFF if find(encname,"unicode") then if trace_loading then report_otf("checking embedded unicode map %a",encname) end - for unicode,index in next,unicodetoindex do - if unicode<=criterium and not descriptions[unicode] then - local parent=indices[index] - if not parent then - report_otf("weird, unicode %U points to nowhere with index %H",unicode,index) - else - local parentdescription=descriptions[parent] - if parentdescription then - local altuni=parentdescription.altuni - if not altuni then - altuni={ { unicode=unicode } } - parentdescription.altuni=altuni - duplicates[parent]={ unicode } - else - local done=false - for i=1,#altuni do - if altuni[i].unicode==unicode then - done=true - break - end - end - if not done then - insert(altuni,{ unicode=unicode }) - insert(duplicates[parent],unicode) + local hash={} + for index,unicode in next,indices do + hash[index]=descriptions[unicode] + end + local reported={} + for unicode,index in next,unicodetoindex do + if not descriptions[unicode] then + local d=hash[index] + if d then + if d.unicode~=unicode then + local c=d.copies + if c then + c[unicode]=true + else + d.copies={ [unicode]=true } end end - if trace_loading then - report_otf("weird, unicode %U points to nowhere with index %H",unicode,index) - end - else - report_otf("weird, unicode %U points to %U with index %H",unicode,index) + elseif not reported[i] then + report_otf("missing index %i",index) + reported[i]=true end end end - end + for index,data in next,hash do + data.copies=sortedkeys(data.copies) + end + for index,unicode in next,indices do + local description=hash[index] + local copies=description.copies + if copies then + duplicates[unicode]=copies + description.copies=nil + else + report_otf("copies but no unicode parent %U",unicode) + end + end elseif properties.cidinfo then report_otf("warning: no unicode map, used cidmap %a",properties.cidinfo.usedname) else @@ -7132,6 +7126,7 @@ actions["check encoding"]=function(data,filename,raw) end if mapdata then mapdata.map={} + mapdata.backmap={} end end actions["add duplicates"]=function(data,filename,raw) @@ -7142,28 +7137,37 @@ actions["add duplicates"]=function(data,filename,raw) local indices=resources.indices local duplicates=resources.duplicates for unicode,d in next,duplicates do - for i=1,#d do - local u=d[i] - if not descriptions[u] then - local description=descriptions[unicode] - local duplicate=table.copy(description) - duplicate.comment=format("copy of U+%05X",unicode) - descriptions[u]=duplicate - local n=0 - for _,description in next,descriptions do - if kerns then - local kerns=description.kerns - for _,k in next,kerns do - local ku=k[unicode] - if ku then - k[u]=ku - n=n+1 + local nofduplicates=#d + if nofduplicates>4 then + if trace_loading then + report_otf("ignoring excessive duplicates of %U (n=%s)",unicode,nofduplicates) + end + else + for i=1,nofduplicates do + local u=d[i] + if not descriptions[u] then + local description=descriptions[unicode] + local n=0 + for _,description in next,descriptions do + if kerns then + local kerns=description.kerns + for _,k in next,kerns do + local ku=k[unicode] + if ku then + k[u]=ku + n=n+1 + end end end end - end - if trace_loading then - report_otf("duplicating %U to %U with index %H (%s kerns)",unicode,u,description.index,n) + if u>0 then + local duplicate=table.copy(description) + duplicate.comment=format("copy of U+%05X",unicode) + descriptions[u]=duplicate + if trace_loading then + report_otf("duplicating %U to %U with index %H (%s kerns)",unicode,u,description.index,n) + end + end end end end @@ -8184,6 +8188,24 @@ local function otftotfm(specification) local features=specification.features.normal local rawdata=otf.load(filename,sub,features and features.featurefile) if rawdata and next(rawdata) then + local descriptions=rawdata.descriptions + local duplicates=rawdata.resources.duplicates + if duplicates then + local nofduplicates,nofduplicated=0,0 + for parent,list in next,duplicates do + for i=1,#list do + local unicode=list[i] + if not descriptions[unicode] then + descriptions[unicode]=descriptions[parent] + nofduplicated=nofduplicated+1 + end + end + nofduplicates=nofduplicates+#list + end + if trace_otf and nofduplicated~=nofduplicates then + report_otf("%i extra duplicates copied out of %i",nofduplicated,nofduplicates) + end + end rawdata.lookuphash={} tfmdata=copytotfm(rawdata,cache_id) if tfmdata and next(tfmdata) then -- cgit v1.2.3