From f4ff686750ca9405662c7615e9c4b04685b5be5c Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 22 Nov 2016 20:44:35 +0100 Subject: 2016-11-22 20:10:00 --- tex/generic/context/luatex/luatex-fonts-merged.lua | 33 +++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 18ed3da02..28f6848ae 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 11/18/16 22:20:13 +-- merge date : 11/22/16 20:03:56 do -- begin closure to overcome local limits and interference @@ -13540,7 +13540,11 @@ local f_unicode=formatters["U%05X"] local f_index=formatters["I%05X"] local f_character_y=formatters["%C"] local f_character_n=formatters["[ %C ]"] -local doduplicates=true +local check_duplicates=true +local check_soft_hyphen=false +directives.register("otf.checksofthyphen",function(v) + check_soft_hyphen=v +end) local function replaced(list,index,replacement) if type(list)=="number" then return replacement @@ -13608,7 +13612,7 @@ local function unifyresources(fontdata,indices) end end local done={} - local duplicates=doduplicates and resources.duplicates + local duplicates=check_duplicates and resources.duplicates if duplicates and not next(duplicates) then duplicates=false end @@ -13845,10 +13849,31 @@ local function unifyresources(fontdata,indices) unifythem(resources.sublookups) end local function copyduplicates(fontdata) - if doduplicates then + if check_duplicates then local descriptions=fontdata.descriptions local resources=fontdata.resources local duplicates=resources.duplicates + if check_soft_hyphen then + local ds=descriptions[0xAD] + if not ds or ds.width==0 then + if ds then + descriptions[0xAD]=nil + report("patching soft hyphen") + else + report("adding soft hyphen") + end + if not duplicates then + duplicates={} + resources.duplicates=duplicates + end + local dh=duplicates[0x2D] + if dh then + dh[#dh+1]={ [0xAD]=true } + else + duplicates[0x2D]={ [0xAD]=true } + end + end + end if duplicates then for u,d in next,duplicates do local du=descriptions[u] -- cgit v1.2.3