From c9db00dcb4b97a4c8b08d2171336e09e73587422 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 21 Dec 2010 10:50:00 +0100 Subject: beta 2010.12.21 10:50 --- tex/context/base/cont-new.tex | 2 +- tex/context/base/context.tex | 2 +- tex/context/base/font-mis.lua | 2 +- tex/context/base/font-otf.lua | 35 +++++++------- tex/context/base/lxml-tab.lua | 4 ++ tex/context/base/m-database.lua | 2 +- tex/context/base/mult-de.tex | 1 + tex/context/base/mult-def.lua | 4 ++ tex/context/base/mult-en.tex | 1 + tex/context/base/mult-fr.tex | 1 + tex/context/base/mult-it.tex | 1 + tex/context/base/mult-nl.tex | 1 + tex/context/base/mult-pe.tex | 1 + tex/context/base/mult-ro.tex | 1 + tex/context/base/regi-ini.lua | 12 ++--- tex/context/base/strc-flt.mkiv | 73 ++++++++++++++++++++--------- tex/context/base/syst-ini.tex | 4 ++ tex/context/base/tabl-tsp.mkiv | 33 +++++++------ tex/context/interface/keys-cs.xml | 1 + tex/context/interface/keys-de.xml | 1 + tex/context/interface/keys-en.xml | 1 + tex/context/interface/keys-fr.xml | 1 + tex/context/interface/keys-it.xml | 1 + tex/context/interface/keys-nl.xml | 1 + tex/context/interface/keys-pe.xml | 1 + tex/context/interface/keys-ro.xml | 1 + tex/generic/context/luatex-fonts-merged.lua | 37 ++++++++------- 27 files changed, 140 insertions(+), 85 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 4e4c99cb6..6b002fc4a 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2010.12.18 21:03} +\newcontextversion{2010.12.21 10:50} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 339fa0460..5417ffe44 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2010.12.18 21:03} +\edef\contextversion{2010.12.21 10:50} %D For those who want to use this: diff --git a/tex/context/base/font-mis.lua b/tex/context/base/font-mis.lua index 964378a8a..216af0155 100644 --- a/tex/context/base/font-mis.lua +++ b/tex/context/base/font-mis.lua @@ -11,7 +11,7 @@ local lower, strip = string.lower, string.strip fonts.otf = fonts.otf or { } -fonts.otf.version = fonts.otf.version or 2.706 +fonts.otf.version = fonts.otf.version or 2.707 fonts.otf.cache = containers.define("fonts", "otf", fonts.otf.version, true) function fonts.otf.loadcached(filename,format,sub) diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index ba64b1326..bfd3262ba 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -57,7 +57,7 @@ local definers = fonts.definers otf.glists = { "gsub", "gpos" } -otf.version = 2.706 -- beware: also sync font-mis.lua +otf.version = 2.707 -- beware: also sync font-mis.lua otf.cache = containers.define("fonts", "otf", otf.version, true) local loadmethod = "table" -- table, mixed, sparse @@ -964,23 +964,27 @@ actions["reorganize subtables"] = function(data,filename,raw) end end +-- the next one is still messy but will get better when we have +-- flattened map/enc tables in the font loader + actions["prepare unicodes"] = function(data,filename,raw) local luatex = data.luatex - local indices, unicodes, multiples, internals = { }, { }, { }, { } - local mapmap = data.map or raw.map - local mapenc = nil -- will go away - if not mapmap then - report_otf("no map in %s",filename) + local indices, unicodes, multiples, internals= { }, { }, { }, { } + local mapdata = data.map or raw.map -- map already moved + local mapmap + if not mapdata then + report_otf("no mapdata in '%s'",filename) mapmap = { } - data.map = { map = mapmap } - elseif not mapmap.map then - report_otf("no unicode map in %s",filename) + mapdata = { map = mapmap } + data.map = mapdata + elseif not mapdata.map then + report_otf("no map in mapdata of '%s'",filename) mapmap = { } - data.map.map = mapmap + mapdata.map = mapmap else - mapenc = mapmap.enc -- will go away - mapmap = mapmap.map + mapmap = mapdata.map end + local encname = lower(data.enc_name or raw.enc_name or mapdata.enc_name or "") local criterium = fonts.privateoffset local private = criterium local glyphs = data.glyphs @@ -1026,12 +1030,9 @@ actions["prepare unicodes"] = function(data,filename,raw) end end -- beware: the indices table is used to initialize the tfm table - local encname = lower(data.enc_name or (mapenc and mapenc[1] and mapenc[1].enc_name) or "") -- mapenc will go away - -- will become: local encname = lower(data.enc_name or "") ---~ if encname == "" or encname == "unicodebmp" or encname == "unicodefull" then -- maybe find(encname,"unicode") - if find(encname,"unicode") then + if find(encname,"unicode") then -- unicodebmp, unicodefull, ... if trace_loading then - report_otf("using extra unicode map") + report_otf("using embedded unicode map '%s'",encname) end -- ok -- we can also consider using the altuni for unicode, index in next, mapmap do diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index 0e95fe358..6a1ab85d4 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -24,6 +24,10 @@ The find based parser can be found in l-xml-edu.lua along with other older code.

Beware, the interface may change. For instance at, ns, tg, dt may get more verbose names. Once the code is stable we will also remove some tracing and optimize the code.

+ +

I might even decide to reimplement the parser using the latest trickery +as the current variant was written when showed up and it's easier now to +build tables in one go.

--ldx]]-- xml = xml or { } diff --git a/tex/context/base/m-database.lua b/tex/context/base/m-database.lua index 66bc89649..59e875ee4 100644 --- a/tex/context/base/m-database.lua +++ b/tex/context/base/m-database.lua @@ -39,7 +39,7 @@ function buffers.database.process(settings) data = filename ~= "" and io.loaddata(filename) data = data and string.splitlines(data) else - data = buffers.getcontent(settings.database) + data = buffers.getlines(settings.database) end if data and #data > 0 then local separatorchar, quotechar, commentchar = settings.separator, settings.quotechar, settings.commentchar diff --git a/tex/context/base/mult-de.tex b/tex/context/base/mult-de.tex index fa3ed479b..a7aaf52f9 100644 --- a/tex/context/base/mult-de.tex +++ b/tex/context/base/mult-de.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{unter} \setinterfaceconstant{subtitle}{untertitel} \setinterfaceconstant{suffix}{suffix} +\setinterfaceconstant{suffixseparator}{suffixseparator} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index 6fced681d..d503215b4 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -10234,6 +10234,10 @@ return { ["pe"]="پسوند", ["ro"]="suffix", }, + ["suffixseparator"]={ + ["en"]="suffixseparator", + ["nl"]="suffixscheider", + }, ["sx"]={ ["cs"]="sx", ["de"]="sx", diff --git a/tex/context/base/mult-en.tex b/tex/context/base/mult-en.tex index c6765ce3f..3da09fdbf 100644 --- a/tex/context/base/mult-en.tex +++ b/tex/context/base/mult-en.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{sub} \setinterfaceconstant{subtitle}{subtitle} \setinterfaceconstant{suffix}{suffix} +\setinterfaceconstant{suffixseparator}{suffixseparator} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/mult-fr.tex b/tex/context/base/mult-fr.tex index 84974bb43..e8ed2ce99 100644 --- a/tex/context/base/mult-fr.tex +++ b/tex/context/base/mult-fr.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{sous} \setinterfaceconstant{subtitle}{soustitre} \setinterfaceconstant{suffix}{suffix} +\setinterfaceconstant{suffixseparator}{suffixseparator} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/mult-it.tex b/tex/context/base/mult-it.tex index bae816c40..97f3675cd 100644 --- a/tex/context/base/mult-it.tex +++ b/tex/context/base/mult-it.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{sotto} \setinterfaceconstant{subtitle}{sottotitolo} \setinterfaceconstant{suffix}{suffix} +\setinterfaceconstant{suffixseparator}{suffixseparator} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/mult-nl.tex b/tex/context/base/mult-nl.tex index d0acd81eb..2036b9cb7 100644 --- a/tex/context/base/mult-nl.tex +++ b/tex/context/base/mult-nl.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{sub} \setinterfaceconstant{subtitle}{subtitel} \setinterfaceconstant{suffix}{suffix} +\setinterfaceconstant{suffixseparator}{suffixscheider} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/mult-pe.tex b/tex/context/base/mult-pe.tex index 7ea06050c..94a6c1c11 100644 --- a/tex/context/base/mult-pe.tex +++ b/tex/context/base/mult-pe.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{زیر} \setinterfaceconstant{subtitle}{زیرعنوان} \setinterfaceconstant{suffix}{پسوند} +\setinterfaceconstant{suffixseparator}{suffixseparator} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/mult-ro.tex b/tex/context/base/mult-ro.tex index 8c852215f..d420db837 100644 --- a/tex/context/base/mult-ro.tex +++ b/tex/context/base/mult-ro.tex @@ -953,6 +953,7 @@ \setinterfaceconstant{sub}{sub} \setinterfaceconstant{subtitle}{subtitlu} \setinterfaceconstant{suffix}{suffix} +\setinterfaceconstant{suffixseparator}{suffixseparator} \setinterfaceconstant{surnamesep}{surnamesep} \setinterfaceconstant{sx}{sx} \setinterfaceconstant{sy}{sy} diff --git a/tex/context/base/regi-ini.lua b/tex/context/base/regi-ini.lua index 979a39994..d3444e6f4 100644 --- a/tex/context/base/regi-ini.lua +++ b/tex/context/base/regi-ini.lua @@ -127,7 +127,7 @@ function regimes.translate(line,regime) end local sequencers = utilities.sequencers -local textfileactions = resolvers.openers.helpers.textfileactions +local textlineactions = resolvers.openers.helpers.textlineactions function regimes.process(s) return regimes.translate(s,regimes.currentregime) @@ -137,16 +137,16 @@ function regimes.enable(regime) regime = synonyms[regime] or regime if data[regime] then regimes.currentregime = regime - sequencers.enableaction(textfileactions,"regimes.process") + sequencers.enableaction(textlineactions,"regimes.process") else - sequencers.disableaction(textfileactions,"regimes.process") + sequencers.disableaction(textlineactions,"regimes.process") end end function regimes.disable() regimes.currentregime = "utf" - sequencers.disableaction(textfileactions,"regimes.process") + sequencers.disableaction(textlineactions,"regimes.process") end -utilities.sequencers.prependaction(textfileactions,"system","regimes.process") -utilities.sequencers.disableaction(textfileactions,"regimes.process") +utilities.sequencers.prependaction(textlineactions,"system","regimes.process") +utilities.sequencers.disableaction(textlineactions,"regimes.process") diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index ce101c870..6e8c0b5dd 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -21,9 +21,9 @@ %D strc-flt.tex and page-flt.mkiv cq. page-flt.mkii. \ifdefined\addlocalbackgroundtobox\else \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi - + \unexpanded\def\placefloats{\doflushfloats} % keep this one - + \let\currentfloat\empty \def\letfloatparameter #1{\expandafter\let\csname\??fl\currentfloat#1\endcsname} @@ -120,7 +120,8 @@ % \c!separator=\@@koseparator, % \c!starter=\@@kostarter, % \c!stopper=\@@kostopper, - % \c!suffix=\floatcaptionsuffix, % hook + \c!suffixseparator=, % currently rather hard coded + \c!suffix=\floatcaptionsuffix, \c!distance=1em, \c!conversion=\v!numbers, \c!command=] @@ -301,11 +302,27 @@ \installstructurelistprocessor{float}{\usestructurelistprocessor{number+title}} +% \def\thecurrentfloatnumber +% {\ifnofloatcaption \else \ifnofloatnumber \else +% \ifx\currentfloatnumber\relax\else +% \dostarttagged\t!floattag\empty +% \labeltexts\currentfloat{\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}}% +% \dostoptagged +% \fi +% \fi \fi} + +\unexpanded\def\thecurrentfloatnumbersuffix + {\doifsomething{\floatcaptionparameter\c!suffix} + {\floatcaptionparameter\c!suffixseparator + \floatcaptionparameter\c!suffix}} + \def\thecurrentfloatnumber {\ifnofloatcaption \else \ifnofloatnumber \else \ifx\currentfloatnumber\relax\else \dostarttagged\t!floattag\empty - \labeltexts\currentfloat{\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}}% + \labeltexts\currentfloat + {\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}% + \thecurrentfloatnumbersuffix}% \dostoptagged \fi \fi \fi} @@ -506,7 +523,7 @@ \newconditional\retainfloatnumber -\def\preparefloatnumber#1% +\def\preparefloatnumber#1% use in special case see below {\xdef\floatcaptionnumber{#1}% \doifelsenodelocation{\v!float\@@thenumber{#1}} \donothing {\nodelocationmode\zerocount}% @@ -755,6 +772,8 @@ attr \destinationattribute \currentfloatattribute \fi \fi \fi} +\newconditional\usesamefloatnumber + \long\def\docompletefloat#1#2#3#4#5% #1:floatclass #2:reference #3:optionlist #4:caption #5:box number {\presetfloatvariables{#1}{#3}{#2}{#5}% check this one \bgroup @@ -762,24 +781,32 @@ % % \dofloatcomponent[\c!name=#1,\c!reference=#2,\c!bookmark=,\c!title={#4}][]% ifnofloatnumber ifnofloatcaption \tracefloatnumber{#1}% % - \dostructurecountercomponent - {float}% - \getcaptionparameters - \floatcaptionparameter - \detokenizedcaptionparameter - \relax - \relax - \relax - [\c!name=\currentfloat,\s!counter=\@@thestructurecounter\currentfloat,% - \s!hascaption=\ifnofloatcaption \v!no\else\v!yes\fi,% - \s!hasnumber=\ifnofloatnumber \v!no\else\v!yes\fi,% - \s!hastitle=\ifemptyfloatcaption\v!no\else\v!yes\fi,% - \c!reference=#2,\c!title={#4},\c!bookmark=]% - []% - \globallet\currentfloatnumber \laststructurecounternumber - \globallet\currentfloatattribute \laststructurecounterattribute - \globallet\currentfloatsynchronize\laststructurecountersynchronize + \ifconditional\usesamefloatnumber + \globallet\currentfloatnumber \previousfloatnumber + \globallet\currentfloatattribute \empty + \globallet\currentfloatsynchronize\relax + \else + \dostructurecountercomponent + {float}% + \getcaptionparameters + \floatcaptionparameter + \detokenizedcaptionparameter + \relax + \relax + \relax + [\c!name=\currentfloat,\s!counter=\@@thestructurecounter\currentfloat,% + \s!hascaption=\ifnofloatcaption \v!no\else\v!yes\fi,% + \s!hasnumber=\ifnofloatnumber \v!no\else\v!yes\fi,% + \s!hastitle=\ifemptyfloatcaption\v!no\else\v!yes\fi,% + \c!reference=#2,\c!title={#4},\c!bookmark=]% + []% + \globallet\previousfloatnumber \laststructurecounternumber + \globallet\currentfloatnumber \laststructurecounternumber + \globallet\currentfloatattribute \laststructurecounterattribute + \globallet\currentfloatsynchronize\laststructurecountersynchronize + \fi % + \global\setfalse\usesamefloatnumber % one shot % check float box \setnaturalfloatdimensions#5% \global\setbox\floatbox\vbox{\floatparameter\c!command{\box#5}}% @@ -833,7 +860,7 @@ \fi} \appendtoks - \let\rightorleftpageaction\doifrightpagefloatelse + \let\rightorleftpageaction\doifrightpagefloatelse \to \everyinsidefloat \newif\ifextrafloatactions \extrafloatactionstrue diff --git a/tex/context/base/syst-ini.tex b/tex/context/base/syst-ini.tex index fb3732074..c37f6850e 100644 --- a/tex/context/base/syst-ini.tex +++ b/tex/context/base/syst-ini.tex @@ -441,6 +441,10 @@ \newif\ifdone +%D Potential primitive in \LUATEX: + +\ifdefined\htdp \else \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi + %D \macros %D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment, %D @@endofline,@@parameter,@@superscript,@@subscript, diff --git a/tex/context/base/tabl-tsp.mkiv b/tex/context/base/tabl-tsp.mkiv index af14e00f6..d274df6cb 100644 --- a/tex/context/base/tabl-tsp.mkiv +++ b/tex/context/base/tabl-tsp.mkiv @@ -13,14 +13,11 @@ \writestatus{loading}{ConTeXt Table Macros / Splitting} -%D The code in this file is move here from other places. +%D The code in this file is move here from other places and needs +%D a mkiv cleanup. \unprotect -% only to be used with single tokens (will be prim) - -\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi - %D Although the name resembles floats, and therefore this should be %D a page module, we decided to make it core functionality because the %D table code depends on it. Othrwise there would be too much @@ -29,12 +26,9 @@ % \splitfloat [settings] {\placetable[optional args]{test}} {content} -% \def\s!noftablesplits{nofsplittables} +% there is no need for a tracked structure number here -\definenumber % we need a nicer name like nofsplittables, we then also need to set \s!parent - [\??si] - [\c!way=\v!by\v!text, - \c!conversion=\@@siconversion] +\newcount\noffloatssplits \unexpanded\def\setupfloatsplitting {\dodoubleargument\getparameters[\??si]} @@ -59,8 +53,8 @@ \insidefloattrue \insidesplitfloattrue \getparameters[\??si][#1]% - \resetnumber[\??si]% - \def\floatcaptionsuffix{\convertednumber[\??si]}% + \global\noffloatssplits\zerocount + \def\floatcaptionsuffix{\convertnumber\@@siconversion\noffloatssplits}% \let\extrasplitfloatlines\@@silines \the\everysplitfloatsetup \def\splitfloatcommand{#2}% @@ -114,14 +108,19 @@ \dontcomplain \global\settrue\splitfloatdone \nodelocationmode\zerocount % bypass auto-renumbering - \incrementnumber[\??si]% - \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat - \let\floatcaptionsuffix\empty - \fi \fi + \global\advance\noffloatssplits\plusone + \ifcase\noffloatssplits\relax + \or + \ifconditional\onlyonesplitofffloat + \let\floatcaptionsuffix\empty + \fi + \else + \global\settrue\usesamefloatnumber % one shot + \fi \bgroup \ifconditional\somenextplitofffloat \settrue\retainfloatnumber -\notesenabledfalse % best here, experimental, brrr; test with note in caption + \notesenabledfalse % best here, experimental, brrr; test with note in caption \else \setfalse\retainfloatnumber \fi diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index a16abecfe..9038deb62 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 355b11feb..bb53fecb6 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 43a4fcfd7..bc30b0790 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 87a189e5d..2cb38889b 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index b6f56e964..9dafa4972 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 843d0db37..d4072b8bf 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index 78fd96d27..a5417f655 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -959,6 +959,7 @@ + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 6a311ec3d..b8ca16483 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -959,6 +959,7 @@ + diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index e95f2980a..2a496e9cd 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 12/18/10 21:03:48 +-- merge date : 12/21/10 10:50:53 do -- begin closure to overcome local limits and interference @@ -5646,7 +5646,7 @@ local definers = fonts.definers otf.glists = { "gsub", "gpos" } -otf.version = 2.706 -- beware: also sync font-mis.lua +otf.version = 2.707 -- beware: also sync font-mis.lua otf.cache = containers.define("fonts", "otf", otf.version, true) local loadmethod = "table" -- table, mixed, sparse @@ -6553,23 +6553,27 @@ actions["reorganize subtables"] = function(data,filename,raw) end end +-- the next one is still messy but will get better when we have +-- flattened map/enc tables in the font loader + actions["prepare unicodes"] = function(data,filename,raw) local luatex = data.luatex - local indices, unicodes, multiples, internals = { }, { }, { }, { } - local mapmap = data.map or raw.map - local mapenc = nil -- will go away - if not mapmap then - report_otf("no map in %s",filename) + local indices, unicodes, multiples, internals= { }, { }, { }, { } + local mapdata = data.map or raw.map -- map already moved + local mapmap + if not mapdata then + report_otf("no mapdata in '%s'",filename) mapmap = { } - data.map = { map = mapmap } - elseif not mapmap.map then - report_otf("no unicode map in %s",filename) + mapdata = { map = mapmap } + data.map = mapdata + elseif not mapdata.map then + report_otf("no map in mapdata of '%s'",filename) mapmap = { } - data.map.map = mapmap + mapdata.map = mapmap else - mapenc = mapmap.enc -- will go away - mapmap = mapmap.map + mapmap = mapdata.map end + local encname = lower(data.enc_name or raw.enc_name or mapdata.enc_name or "") local criterium = fonts.privateoffset local private = criterium local glyphs = data.glyphs @@ -6615,12 +6619,9 @@ actions["prepare unicodes"] = function(data,filename,raw) end end -- beware: the indices table is used to initialize the tfm table - local encname = lower(data.enc_name or (mapenc and mapenc[1] and mapenc[1].enc_name) or "") -- mapenc will go away - -- will become: local encname = lower(data.enc_name or "") ---~ if encname == "" or encname == "unicodebmp" or encname == "unicodefull" then -- maybe find(encname,"unicode") - if find(encname,"unicode") then + if find(encname,"unicode") then -- unicodebmp, unicodefull, ... if trace_loading then - report_otf("using extra unicode map") + report_otf("using embedded unicode map '%s'",encname) end -- ok -- we can also consider using the altuni for unicode, index in next, mapmap do -- cgit v1.2.3