summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-04-21 12:17:27 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-04-21 12:17:27 +0200
commitc60565b07187f629fa06009b2a0be8f4cac28e08 (patch)
tree2fd8df1b58aa9c43d9c7503eeb9e3f2dd9f12105
parent4cfc73bd1bab8a51da618119e1e24dae3d7ccf1a (diff)
parentd44fc0f4c351e3301d1573888faae922a94cb3e4 (diff)
downloadluaotfload-c60565b07187f629fa06009b2a0be8f4cac28e08.tar.gz
Merge pull request #213 from phi-gamma/texlive2014
syncs and some non-functionality related changes
-rw-r--r--NEWS1
-rw-r--r--misc/valgrind-kpse-suppression.sup39
-rw-r--r--src/luaotfload-database.lua65
-rw-r--r--src/luaotfload-fontloader.lua29
4 files changed, 81 insertions, 53 deletions
diff --git a/NEWS b/NEWS
index 1966c03..2aa319e 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Change History
* Move logging routines from luaotfload-override in to luaotfload-log.
* Scan local font files (``--local`` flag to luaotfload-tool, flag
``scan_local`` during TeX run).
+ * Add bisection mode (``--bisect``) to luaotfload-tool.
2013/12/31, luaotfload v2.4
* Additional self-tests, now in separate file (luaotfload-diagnostics.lua)
diff --git a/misc/valgrind-kpse-suppression.sup b/misc/valgrind-kpse-suppression.sup
index e1cc5f5..dc32586 100644
--- a/misc/valgrind-kpse-suppression.sup
+++ b/misc/valgrind-kpse-suppression.sup
@@ -1,7 +1,7 @@
{
kpathsea-garbage-1
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpathsea_cnf_get
}
@@ -9,7 +9,7 @@
{
kpathsea-garbage-2
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpse_program_basename
}
@@ -18,7 +18,7 @@
{
kpathsea-garbage-3
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpse_find_file
}
@@ -27,7 +27,7 @@
{
kpathsea-garbage-4
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:find_file
}
@@ -35,7 +35,7 @@
{
kpathsea-garbage-5
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:lua_kpse_lookup
}
@@ -43,7 +43,7 @@
{
kpathsea-garbage-6
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:find_file
}
@@ -52,7 +52,7 @@
{
kpathsea-garbage-7
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:expand_path
}
@@ -60,7 +60,7 @@
{
kpathsea-garbage-8
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:do_lua_kpathsea_lookup
}
@@ -69,7 +69,7 @@
{
kpathsea-garbage-9
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpathsea_find_file
}
@@ -78,7 +78,7 @@
{
kpathsea-garbage-10
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpathsea_init_db
}
@@ -87,7 +87,7 @@
{
kpathsea-garbage-11
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpathsea_find_file_generic
}
@@ -96,7 +96,7 @@
{
kpathsea-garbage-12
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:expand_var
}
@@ -105,7 +105,7 @@
{
kpathsea-garbage-13
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:init_path
}
@@ -114,7 +114,7 @@
{
kpathsea-garbage-14
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpse_in_name_ok
}
@@ -123,9 +123,18 @@
{
kpathsea-garbage-15
Memcheck:Leak
- match-leak-kinds: definite
+ match-leak-kinds: all
...
fun:kpathsea_var_value
}
+{
+ kpathsea-garbage-16
+ Memcheck:Leak
+ match-leak-kinds: all
+ ...
+ fun:kpse_set_program_name
+}
+
+
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 936e380..dc783d8 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -338,7 +338,6 @@ This is a sketch of the luaotfload db:
status : filestatus;
mappings : fontentry list;
meta : metadata;
- names : namedata; // TODO: check for relevance after db is finalized
}
and familytable = {
local : (format, familyentry) hash; // specified with include dir
@@ -346,10 +345,10 @@ This is a sketch of the luaotfload db:
system : (format, familyentry) hash;
}
and familyentry = {
- regular : sizes;
- italic : sizes;
- bold : sizes;
- bolditalic : sizes;
+ r : sizes; // regular
+ i : sizes; // italic
+ b : sizes; // bold
+ bi : sizes; // bold italic
}
and sizes = {
default : int; // points into mappings or names
@@ -358,10 +357,10 @@ This is a sketch of the luaotfload db:
and metadata = {
local : bool; (* set if local fonts were added to the db *)
formats : string list; // { "otf", "ttf", "ttc", "dfont" }
- statistics : TODO;
- version : float;
+ statistics : TODO; // created when built with "--stats"
+ version : float; // index version
}
- and filemap = {
+ and filemap = { // created by generate_filedata()
base : {
local : (string, int) hash; // basename -> idx
system : (string, int) hash;
@@ -374,36 +373,36 @@ This is a sketch of the luaotfload db:
};
full : (int, string) hash; // idx -> full path
}
- and fontentry = {
- barename : string;
- familyname : string;
- filename : string;
- fontname : string; // <- metadata
- fullname : string; // <- metadata
- sanitized : {
- family : string;
- fontstyle_name : string; // <- new in 2.4
- fontname : string; // <- metadata
- fullname : string; // <- namedata.names
- metafamily : string;
- pfullname : string;
- prefmodifiers : string;
- psname : string;
- subfamily : string;
- };
- size : int list;
- slant : int;
- subfont : int;
- location : local | system | texmf;
- weight : int;
- width : int;
- units_per_em : int; // mainly 1000, but also 2048 or 256
+ and fontentry = { // finalized by collect_families()
+ basename : string; // file name without path "foo.otf"
+ conflicts : { barename : int; basename : int }; // filename conflict with font at index; happens with subfonts
+ familyname : string; // sanitized name of the font family the font belongs to, usually from the names table
+ fontname : string; // sanitized name of the font
+ fontstyle_name : string; // the fontstyle_name field returned by fontloader.info()
+ format : string; // "otf" | "ttf" | "dfont" | "pfa" | "pfb" | "afm"
+ fullname : string; // sanitized full name of the font including style modifiers
+ fullpath : string; // path to font in filesystem
+ index : int; // index in the mappings table
+ italicangle : float; // italic angle; non-zero with oblique faces
+ location : string; // "texmf" | "system" | "local"
+ metafamily : string; // alternative family identifier if appropriate, sanitized
+ plainname : string; // unsanitized font name
+ prefmodifiers : string; // sanitized preferred subfamily (names table 14)
+ psname : string; // PostScript name
+ size : (false | float * float * float); // if available, size info from the size table converted from decipoints
+ splainname : string; // sanitized version of the “plainname” field
+ splitstyle : string; // style information obtained by splitting the full name at the last dash
+ subfamily : string; // sanitized subfamily (names table 2)
+ subfont : (int | bool); // integer if font is part of a TrueType collection ("ttc")
+ version : string; // font version string
+ weight : int; // usWeightClass
}
and filestatus = (string, // fullname
{ index : int list; // pointer into mappings
timestamp : int; }) dict
-beware that this is a reconstruction and may be incomplete.
+beware that this is a reconstruction and may be incomplete or out of
+date. Last update: 2014-04-06, describing version 2.51.
mtx-fonts has in names.tma:
diff --git a/src/luaotfload-fontloader.lua b/src/luaotfload-fontloader.lua
index ca538df..d4311b2 100644
--- a/src/luaotfload-fontloader.lua
+++ b/src/luaotfload-fontloader.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 03/25/14 02:17:04
+-- merge date : 04/15/14 09:51:32
do -- begin closure to overcome local limits and interference
@@ -3394,6 +3394,17 @@ function caches.loaddata(paths,name)
for i=1,#paths do
local data=false
local luaname,lucname=makefullname(paths[i],name)
+ if lucname and not lfs.isfile(lucname) and type(caches.compile)=="function" then
+ texio.write(string.format("(compiling luc: %s)",lucname))
+ data=loadfile(luaname)
+ if data then
+ data=data()
+ end
+ if data then
+ caches.compile(data,luaname,lucname)
+ return data
+ end
+ end
if lucname and lfs.isfile(lucname) then
texio.write(string.format("(load luc: %s)",lucname))
data=loadfile(lucname)
@@ -3617,9 +3628,17 @@ local free_node=node.free
local remove_node=node.remove
local new_node=node.new
local traverse_id=node.traverse_id
-local math_code=nodecodes.math
nodes.handlers.protectglyphs=node.protect_glyphs
nodes.handlers.unprotectglyphs=node.unprotect_glyphs
+local math_code=nodecodes.math
+local end_of_math=node.end_of_math
+function node.end_of_math(n)
+ if n.id==math_code and n.subtype==1 then
+ return n
+ else
+ return end_of_math(n)
+ end
+end
function nodes.remove(head,current,free_too)
local t=current
head,current=remove_node(head,current)
@@ -3913,14 +3932,15 @@ constructors.sharefonts=false
constructors.nofsharedfonts=0
local sharednames={}
function constructors.trytosharefont(target,tfmdata)
- if constructors.sharefonts then
+ if constructors.sharefonts then
local characters=target.characters
local n=1
local t={ target.psname }
local u=sortedkeys(characters)
for i=1,#u do
+ local k=u[i]
n=n+1;t[n]=k
- n=n+1;t[n]=characters[u[i]].index or k
+ n=n+1;t[n]=characters[k].index or k
end
local h=md5.HEX(concat(t," "))
local s=sharednames[h]
@@ -5764,7 +5784,6 @@ unify=function(data,filename)
if unicode then
krn[unicode]=kern
else
- print(unicode,name)
end
end
description.kerns=krn