summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-11-09 12:01:08 -0800
committerPhilipp Gesang <phg42.2a@gmail.com>2013-11-09 12:01:08 -0800
commitdc1075ac573d0db0cc748706adb7205528a73635 (patch)
treebad27782f1b858772017f675ecd6b1d7db2597ea
parentb456ec23e850167d4e6397a56afc01b6379b466c (diff)
parent724f6d77642d7349bc2b8c349b07c8afbbcc9017 (diff)
downloadluaotfload-dc1075ac573d0db0cc748706adb7205528a73635.tar.gz
Merge pull request #148 from phi-gamma/master
[db] omit temporary extraction of names altogether
-rw-r--r--luaotfload-database.lua50
1 files changed, 5 insertions, 45 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index 8f1f34d..5198b16 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -30,7 +30,7 @@ local unpack = table.unpack
local fontloaderinfo = fontloader.info
local fontloaderclose = fontloader.close
local fontloaderopen = fontloader.open
-local fontloaderto_table = fontloader.to_table
+----- fontloaderto_table = fontloader.to_table
local gzipopen = gzip.open
local iolines = io.lines
local ioopen = io.open
@@ -1281,27 +1281,9 @@ end --- find_closest()
--[[doc--
- load_font_file -- Extract relevant information from a font. The
- fields we require for the index are, by category:
-
- -- style:
- .design_size
- .design_range_top
- .design_range_bottom
- .pfminfo (table)
- .italicangle
- .units_per_em
- .fontstyle_name
- -- font names:
- .names (table)
- .fullname
- .fontname
- .familyname
- -- .version
-
- Since we don’t actually require metrics and glyph information we
- can omit calling the very expensive ``fontloader.to_table()``
- altogether.
+ load_font_file -- Safely open a font file. See
+ <http://www.ntg.nl/pipermail/ntg-context/2013/075885.html>
+ regarding the omission of ``fontloader.close()``.
--doc]]--
@@ -1311,29 +1293,7 @@ local load_font_file = function (filename, subfont)
report ("log", 1, "db", "ERROR: failed to open %s", filename)
return
end
-
--- local metadata = fontloaderto_table (rawfont)
- local fontstyle_name = rawfont.fontstyle_name
- local names = rawfont.names
- local pfminfo = rawfont.pfminfo
-
- local metadata = {
- design_size = rawfont.design_size,
- design_range_top = rawfont.design_range_top,
- design_range_bottom = rawfont.design_range_bottom,
- names = names and tablecopy (names) or { },
- fullname = rawfont.fullname,
- fontstyle_name = fontstyle_name and tablecopy (fontstyle_name) or { },
- fontname = rawfont.fontname,
- familyname = rawfont.familyname,
- pfminfo = pfminfo and tablecopy (pfminfo) or { },
- italicangle = rawfont.italicangle,
- units_per_em = rawfont.units_per_em,
- version = rawfont.version,
- }
- fontloaderclose (rawfont)
- collectgarbage "collect"
- return metadata
+ return rawfont
end
--- rawdata -> (int * int * int | bool)