Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/luaotfload-multiscript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ local script_extensions do
* entry^0
, multirawset)

local f = io.open(kpse.find_file"ScriptExtensions.txt")
local script_extensions_file = kpse.find_file"ScriptExtensions.txt"
if not script_extensions_file then
error("luaotfload: Cannot find ScriptExtensions.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(script_extensions_file)
script_extensions = file:match(f:read'*a')
f:close()
for cp,t in next, script_extensions do
Expand Down Expand Up @@ -131,7 +136,12 @@ local script_mapping do
* entry^0
, multirawset)

local f = io.open(kpse.find_file"Scripts.txt")
local scripts_file = kpse.find_file"Scripts.txt"
if not scripts_file then
error("luaotfload: Cannot find Scripts.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(scripts_file)
script_mapping = file:match(f:read'*a')
f:close()

Expand Down
14 changes: 12 additions & 2 deletions src/luaotfload-notdef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ local ignorable_codepoints do
lpeg.Ct''
* entry^0
, rawset)
local f = io.open(kpse.find_file"UnicodeData.txt")
local unicode_data_file = kpse.find_file"UnicodeData.txt"
if not unicode_data_file then
error("luaotfload: Cannot find UnicodeData.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(unicode_data_file)
ignorable_codepoints = file:match(f:read'*a')
f:close()
entry = lpeg.Cg(codepoint_range * sep * ('Other_Default_Ignorable_Code_Point' * lpeg.Cc(true)
Expand All @@ -77,7 +82,12 @@ local ignorable_codepoints do
lpeg.Carg(1)
* entry^0
, multirawset)
f = io.open(kpse.find_file"PropList.txt")
local proplist_file = kpse.find_file"PropList.txt"
if not proplist_file then
error("luaotfload: Cannot find PropList.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
f = io.open(proplist_file)
ignorable_codepoints = file:match(f:read'*a', 1, ignorable_codepoints)
f:close()
for i = 0xFFF9,0xFFFB do
Expand Down
35 changes: 30 additions & 5 deletions src/luaotfload-unicode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ local alphnum_only do
* entry^0
, rawset)

local f = io.open(kpse.find_file"UnicodeData.txt")
local unicode_data_file = kpse.find_file"UnicodeData.txt"
if not unicode_data_file then
error("luaotfload: Cannot find UnicodeData.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(unicode_data_file)
local data = file:match(f:read'*a')
f:close()
function alphnum_only(s)
Expand Down Expand Up @@ -104,7 +109,12 @@ local uppercase, lowercase, ccc, cased, case_ignorable, titlecase = {}, {}, {},
end
local file = entry^0 * -1

local f = io.open(kpse.find_file"UnicodeData.txt")
local unicode_data_file2 = kpse.find_file"UnicodeData.txt"
if not unicode_data_file2 then
error("luaotfload: Cannot find UnicodeData.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(unicode_data_file2)
assert(file:match(f:read'*a'))
f:close()
end
Expand All @@ -129,7 +139,12 @@ local props do
return t
end) * -1

local f = io.open(kpse.find_file"PropList.txt")
local proplist_file = kpse.find_file"PropList.txt"
if not proplist_file then
error("luaotfload: Cannot find PropList.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(proplist_file)
props = file:match(f:read'*a')
f:close()
end
Expand All @@ -143,7 +158,12 @@ do
end
end + (1-lpeg.P'\n')^0 * '\n')^0 * -1

local f = io.open(kpse.find_file"WordBreakProperty.txt")
local wbp_file = kpse.find_file"WordBreakProperty.txt"
if not wbp_file then
error("luaotfload: Cannot find WordBreakProperty.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(wbp_file)
assert(file:match(f:read'*a'))
f:close()
end
Expand Down Expand Up @@ -187,7 +207,12 @@ do
end
local file = (entry + nl)^0 * -1

local f = io.open(kpse.find_file"SpecialCasing.txt")
local special_casing_file = kpse.find_file"SpecialCasing.txt"
if not special_casing_file then
error("luaotfload: Cannot find SpecialCasing.txt. "
.. "Install the 'unicode-data' TeX package (tlmgr install unicode-data).")
end
local f = io.open(special_casing_file)
assert(file:match(f:read'*a'))
f:close()
end
Expand Down