From 2f5da31926b15ba663a65335fd17e8970eb7b49d Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 11 Apr 2013 14:26:39 +0200 Subject: Compatibility with LuaTeX 0.75 --- otfl-font-nms.lua | 4 ++-- otfl-font-otf.lua | 2 +- otfl-luat-dum.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index a8b3100..f6d6a6e 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -493,8 +493,8 @@ local function scan_texmf_fonts(fontnames, newfontnames) else logs.info("Scanning TEXMF and OS fonts...") end - local fontdirs = expandpath("$OPENTYPEFONTS"):gsub("^\.", "") - fontdirs = fontdirs .. expandpath("$TTFONTS"):gsub("^\.", "") + 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) diff --git a/otfl-font-otf.lua b/otfl-font-otf.lua index b46bc91..ce54086 100644 --- a/otfl-font-otf.lua +++ b/otfl-font-otf.lua @@ -1100,7 +1100,7 @@ otf.enhancers["reorganize kerns"] = function(data,filename) if type(lookups) ~= "table" then lookups = { lookups } end - local maxfirsts, maxseconds = getn(firsts), getn(seconds) + local maxfirsts, maxseconds = #firsts, #seconds -- here we could convert split into a list of unicodes which is a bit -- faster but as this is only done when caching it does not save us much for _, s in next, firsts do diff --git a/otfl-luat-dum.lua b/otfl-luat-dum.lua index 2f6627f..13b73b1 100644 --- a/otfl-luat-dum.lua +++ b/otfl-luat-dum.lua @@ -62,7 +62,7 @@ local remapper = { } function resolvers.find_file(name,kind) - name = string.gsub(name,"\\","\/") + name = string.gsub(name,"\\","/") kind = string.lower(kind) return kpse.find_file(name,(kind and kind ~= "" and (remapper[kind] or kind)) or file.extname(name,"tex")) end -- cgit v1.2.3 From 28a03ec49374e58c5538c07069f2f780a0ec7965 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 11 Apr 2013 14:28:21 +0200 Subject: Fixing issues #49 and #52 --- mkluatexfontdb.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkluatexfontdb.lua b/mkluatexfontdb.lua index 553332d..62e15f3 100755 --- a/mkluatexfontdb.lua +++ b/mkluatexfontdb.lua @@ -33,9 +33,9 @@ Valid options: -V --version print version and exit -h --help print this message -The output database file is named otfl-fonts.lua and is placed under: +The output database file is named otfl-names.lua and is placed under: - %s" + %s ]], name, names.path.localdir)) end -- cgit v1.2.3 From 6494f00817db21f1884d3d500404ed19c66f953a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 11 Apr 2013 14:33:26 +0200 Subject: Bumping version --- luaotfload.dtx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 4521590..1afcd6e 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2009-2010 by Elie Roux +% Copyright (C) 2009-2013 by Elie Roux % and Khaled Hosny % (Support: .) % @@ -36,7 +36,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload v1.27 OpenType layout system} +\Msg{* Package: luaotfload v1.28 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -47,7 +47,7 @@ \preamble This is a generated file. -Copyright (C) 2009-2010 by by Elie Roux +Copyright (C) 2009-2013 by by Elie Roux and Khaled Hosny (Support: .) @@ -104,7 +104,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2012/05/28 v1.27 OpenType layout system]% + [2013/04/11 v1.28 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} \usepackage[ @@ -166,7 +166,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2012/05/28 v1.27} +% \date{2013/04/11 v1.28} % \author{Elie Roux and Khaled Hosny\\ % Support: \email{lualatex-dev@tug.org}} % @@ -453,8 +453,8 @@ module("luaotfload", package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.27, - date = "2012/05/28", + version = 1.28, + date = "2013/04/11", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", -- cgit v1.2.3 From 431f4094833c4d24259d655815a492976602b0df Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 11 Apr 2013 14:33:45 +0200 Subject: Bumping version in NEWS too --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index ceff36a..fdd9646 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ Change History -------------- +2012/05/28, luaotfload v1.28: + * Adapting to LuaTeX 0.75 + * Fix small documentation issues in mkluatexfontdb + 2012/05/28, luaotfload v1.27: * Fix "endless loop in charlist" with some OpenType math fonts -- cgit v1.2.3 From df8d8a5e5ec4a3e885a6b15087fc283ee69ecf06 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 09:40:52 +0200 Subject: Better error handling for font config reading The code is still quite experimental and sometimes generate errors while it could still continue. --- otfl-font-nms.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index f6d6a6e..4271b3c 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -522,7 +522,7 @@ local function read_fonts_conf(path, results) ]] local f = io.open(path) if not f then - error("Cannot open the file "..path) + return results end local incomments = false for line in f:lines() do @@ -571,7 +571,7 @@ local function read_fonts_conf(path, results) elseif not lfs.isfile(include) and not lfs.isdir(include) then include = file.join(file.dirname(path), include) end - if lfs.isfile(include) then + if lfs.isfile(include) and kpse.readable_file(include) then -- maybe we should prevent loops here? -- we exclude path with texmf in them, as they should -- be found otherwise -- cgit v1.2.3 From 9e597b20c304c3dd1f2a49277e5c4bbbbb5ac9a1 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 09:44:51 +0200 Subject: Warning if a file cannot be read in font conf --- otfl-font-nms.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 4271b3c..02ae859 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -522,6 +522,7 @@ local function read_fonts_conf(path, results) ]] local f = io.open(path) if not f then + logs.info("Warning: unable to read "..path.. ", skipping...") return results end local incomments = false -- cgit v1.2.3 From ca2e2bdcdbe78131ff1766e527ca0a9f5b01afa4 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 09:54:04 +0200 Subject: Adding semibold as a synonym for bold, not sure it's useful... --- otfl-font-nms.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 02ae859..e6faeab 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -76,9 +76,12 @@ end local synonyms = { regular = { "normal", "roman", "plain", "book", "medium" }, - bold = { "boldregular", "demi", "demibold" }, + -- 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" }, + bolditalic = { "boldoblique", "boldslanted", "demiitalic", "demioblique", "demislanted", "demibolditalic", "semibolditalic" }, } local loaded = false -- cgit v1.2.3 From dcf9b9ed2a5b03a5313642adf4e801520d917895 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 11:41:14 +0200 Subject: Updating NEWS file --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fdd9646..0c46f5c 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,12 @@ Change History -------------- -2012/05/28, luaotfload v1.28: +2013/04/11, luaotfload v1.28: * Adapting to LuaTeX 0.75 * Fix small documentation issues in mkluatexfontdb + * Skipping instead of error on unreadable font config files + * Adding semibold synonym for bold + 2012/05/28, luaotfload v1.27: * Fix "endless loop in charlist" with some OpenType math fonts -- cgit v1.2.3 From 3771bb1479430718ef650f2194a34758ededc132 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 15:05:40 +0200 Subject: Adapting math test for LuaTeX > 0.74 --- tests/math.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/math.tex b/tests/math.tex index 0e07b2c..b216c30 100644 --- a/tests/math.tex +++ b/tests/math.tex @@ -19,7 +19,6 @@ $$ $$ \Umathaccent "0 "4 "23DE {a+b} -+ \Umathbotaccent "0 "4 "23DF {a+b} = C $$ $$ -- cgit v1.2.3 From dc4b739a33f3f5f4932945649a11e42fc1d6e957 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 15:06:56 +0200 Subject: Make \font\foo=file:xxx more reliable We use the same function (fonts.names.resolve) for both name and file specification, as the database search is much better than a simple filename resolving (it might contain more entries), it's also easier to spot a problem. --- luaotfload.dtx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 1afcd6e..fa6d709 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -636,7 +636,13 @@ end % % \subsection{\context override} % -% Here we override some defaults set in \context code. +% We have a unified function for both file and name resolver. +% +% \begin{macrocode} +fonts.define.resolvers.file = fonts.define.resolvers.name +% \end{macrocode} +% +% Overriding some defaults set in \context code. % % \begin{macrocode} fonts.mode = "node" -- cgit v1.2.3 From 246ef30f958ee3f9a957703a385fcc65607f07a1 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 18:47:44 +0200 Subject: Preventing loop-references in fontconfig files I just had this case on a recent Ubuntu... --- otfl-font-nms.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index e6faeab..0f44eb4 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -518,12 +518,13 @@ end in OSFONTDIR. ]] -local function read_fonts_conf(path, results) +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 @@ -575,14 +576,14 @@ local function read_fonts_conf(path, results) elseif not lfs.isfile(include) and not lfs.isdir(include) then include = file.join(file.dirname(path), include) end - if lfs.isfile(include) and kpse.readable_file(include) then + if lfs.isfile(include) and kpse.readable_file(include) and not table.contains(passed_paths, include) then -- maybe we should prevent loops here? -- we exclude path with texmf in them, as they should -- be found otherwise - read_fonts_conf(include, results) + read_fonts_conf(include, results, passed_paths) elseif lfs.isdir(include) then for _,f in next, glob(file.join(include, "*.conf")) do - read_fonts_conf(f, results) + read_fonts_conf(f, results, passed_paths) end end end @@ -608,7 +609,7 @@ local function get_os_dirs() local windir = os.getenv("WINDIR") return { file.join(windir, 'Fonts') } else - return read_fonts_conf("/etc/fonts/fonts.conf", {}) + return read_fonts_conf("/etc/fonts/fonts.conf", {}, {}) end end -- cgit v1.2.3 From 0b5a6761f55ed9fa03c7ba0564764ad89ee9a925 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 18:50:41 +0200 Subject: Removing the todo of previous commit --- otfl-font-nms.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 0f44eb4..5cca490 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -577,7 +577,6 @@ local function read_fonts_conf(path, results, passed_paths) include = file.join(file.dirname(path), include) end if lfs.isfile(include) and kpse.readable_file(include) and not table.contains(passed_paths, include) then - -- maybe we should prevent loops here? -- we exclude path with texmf in them, as they should -- be found otherwise read_fonts_conf(include, results, passed_paths) -- cgit v1.2.3 From 253c770b6b32ed335c5f88ab5c7007a4e6b1cb95 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 18 Apr 2013 14:30:59 +0200 Subject: Making tests useable by non-ConTeXt users --- tests/color.tex | 6 +++--- tests/opbd.tex | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/tests/color.tex b/tests/color.tex index 1be8896..d410bf0 100644 --- a/tests/color.tex +++ b/tests/color.tex @@ -4,7 +4,7 @@ \font\testb=file:lmroman10-regular.otf:color=FFFF0099;+trep at 10pt \font\testc=file:lmroman10-regular.otf:color=559922;+trep at 12pt -\testa \input knuth \par -\testb \input knuth \par -\testc \input knuth \par +\testa test \par +\testb test \par +\testc test \par \bye diff --git a/tests/opbd.tex b/tests/opbd.tex index 50c4dfd..a934902 100644 --- a/tests/opbd.tex +++ b/tests/opbd.tex @@ -4,6 +4,40 @@ \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 \input tufte \par -\testb \input tufte \par +\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 -- cgit v1.2.3 From a198740f4f6f5016d4961854efaebbcb66dbe55b Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 18 Apr 2013 14:32:34 +0200 Subject: More tests availability --- tests/microtypography.tex | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/tests/microtypography.tex b/tests/microtypography.tex index 7d032e3..001d0a1 100644 --- a/tests/microtypography.tex +++ b/tests/microtypography.tex @@ -2,8 +2,42 @@ \pdfprotrudechars2 \pdfadjustspacing2 -\font\testa=file:texgyretermes-regular:script=latn at 12pt -\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt -\testa \input tufte \par -\testb \input tufte \par +\font\testa ={tex gyre termes:script=latn} at 10pt +\font\testb ={tex gyre termes:+liga;protrusion=default} at 10pt + +% a long file should be input here... +\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 -- cgit v1.2.3 From 64b8916cca621917b4fcd971e7921ec44f1f3352 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 18 Apr 2013 14:32:54 +0200 Subject: I had forgotten this check for reference-looping --- otfl-font-nms.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 5cca490..50febab 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -582,7 +582,9 @@ local function read_fonts_conf(path, results, passed_paths) read_fonts_conf(include, results, passed_paths) elseif lfs.isdir(include) then for _,f in next, glob(file.join(include, "*.conf")) do - read_fonts_conf(f, results, passed_paths) + if not table.contains(passed_paths, f) then + read_fonts_conf(f, results, passed_paths) + end end end end -- cgit v1.2.3 From 6859514d34678f900d0806777aaf59e8055afcbe Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Thu, 18 Apr 2013 15:12:15 +0200 Subject: Updating NEWS --- NEWS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 0c46f5c..0f7184a 100644 --- a/NEWS +++ b/NEWS @@ -4,9 +4,10 @@ Change History 2013/04/11, luaotfload v1.28: * Adapting to LuaTeX 0.75 * Fix small documentation issues in mkluatexfontdb - * Skipping instead of error on unreadable font config files + * Fix possibility of infite loop fontconfig config files references * Adding semibold synonym for bold - + * file:xxx syntax now uses the same search function as name: which + make more fonts recognized 2012/05/28, luaotfload v1.27: * Fix "endless loop in charlist" with some OpenType math fonts -- cgit v1.2.3