diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-01-08 15:15:04 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-01-08 15:15:04 +0100 |
commit | 1bda0d9ea4d65df72ed3382039a6d061c3e1073f (patch) | |
tree | 65b39c384edb595b5b62162bf8b8c1625248d665 /tex | |
parent | 9f639e93850762b4169cbe7db9cfa7a8edb5a856 (diff) | |
download | context-1bda0d9ea4d65df72ed3382039a6d061c3e1073f.tar.gz |
2015-01-08 15:01:00
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/char-ini.lua | 126 | ||||
-rw-r--r-- | tex/context/base/char-utf.lua | 59 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4389 -> 4389 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/font-fbk.lua | 41 | ||||
-rw-r--r-- | tex/context/base/font-mis.lua | 2 | ||||
-rw-r--r-- | tex/context/base/font-otf.lua | 2 | ||||
-rw-r--r-- | tex/context/base/lpdf-epd.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mult-fun.lua | 4 | ||||
-rw-r--r-- | tex/context/base/s-typesetting-kerning.mkiv | 43 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24912 -> 24938 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 356993 -> 333150 bytes | |||
-rw-r--r-- | tex/context/base/tabl-ntb.mkiv | 263 | ||||
-rw-r--r-- | tex/context/base/x-html.mkiv | 369 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 4 |
16 files changed, 770 insertions, 149 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index f7b5f8871..267b51b46 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -891,46 +891,104 @@ lpegpatterns.toshape = toshape -- old ones ... will be overloaded -- function characters.upper (str) return lpegmatch(toupper,str) end -- function characters.shaped(str) return lpegmatch(toshape,str) end -local lhash = { } -local uhash = { } -local shash = { } - -for k, v in next, characters.data do - -- if k < 0x11000 then - local l = v.lccode - if l then - if type(l) == "number" then - lhash[utfchar(k)] = utfchar(l) - elseif #l == 2 then - lhash[utfchar(k)] = utfchar(l[1]) .. utfchar(l[2]) - else - inspect(v) + +-- local superscripts = allocate() characters.superscripts = superscripts +-- local subscripts = allocate() characters.subscripts = subscripts + +-- if storage then +-- storage.register("characters/superscripts", superscripts, "characters.superscripts") +-- storage.register("characters/subscripts", subscripts, "characters.subscripts") +-- end + +-- end + +if not characters.splits then + + local char = allocate() + local compat = allocate() + + local splits = { + char = char, + compat = compat, + } + + characters.splits = splits + + -- [0x013F] = { 0x004C, 0x00B7 } + -- [0x0140] = { 0x006C, 0x00B7 } + + for unicode, data in next, characters.data do + local specials = data.specials + if specials and #specials > 2 then + local kind = specials[1] + if kind == "compat" then + compat[unicode] = { unpack(specials,2) } + elseif kind == "char" then + char [unicode] = { unpack(specials,2) } end - else - local u = v.uccode - if u then - if type(u) == "number" then - uhash[utfchar(k)] = utfchar(u) - elseif #u == 2 then - uhash[utfchar(k)] = utfchar(u[1]) .. utfchar(u[2]) + end + end + + if storage then + storage.register("characters/splits", splits, "characters.splits") + end + +end + +if not characters.lhash then + + local lhash = allocate() characters.lhash = lhash -- nil if no conversion + local uhash = allocate() characters.uhash = uhash -- nil if no conversion + local shash = allocate() characters.shash = shash -- nil if no conversion + + for k, v in next, characters.data do + -- if k < 0x11000 then + local l = v.lccode + if l then + if type(l) == "number" then + lhash[utfchar(k)] = utfchar(l) + elseif #l == 2 then + lhash[utfchar(k)] = utfchar(l[1]) .. utfchar(l[2]) else inspect(v) end - end - end - local s = v.shcode - if s then - if type(s) == "number" then - shash[utfchar(k)] = utfchar(s) - elseif #s == 2 then - shash[utfchar(k)] = utfchar(s[1]) .. utfchar(s[2]) else - inspect(v) + local u = v.uccode + if u then + if type(u) == "number" then + uhash[utfchar(k)] = utfchar(u) + elseif #u == 2 then + uhash[utfchar(k)] = utfchar(u[1]) .. utfchar(u[2]) + else + inspect(v) + end + end end - end - -- end + local s = v.shcode + if s then + if type(s) == "number" then + shash[utfchar(k)] = utfchar(s) + elseif #s == 2 then + shash[utfchar(k)] = utfchar(s[1]) .. utfchar(s[2]) + else + inspect(v) + end + end + -- end + end + + if storage then + storage.register("characters/lhash", lhash, "characters.lhash") + storage.register("characters/uhash", lhash, "characters.uhash") + storage.register("characters/shash", lhash, "characters.shash") + end + end +local lhash = characters.lhash +local uhash = characters.uhash +local shash = characters.shash + local utf8lowercharacter = utfchartabletopattern(lhash) / lhash local utf8uppercharacter = utfchartabletopattern(uhash) / uhash local utf8shapecharacter = utfchartabletopattern(shash) / shash @@ -947,10 +1005,6 @@ lpegpatterns.utf8lower = utf8lower -- string lpegpatterns.utf8upper = utf8upper -- string lpegpatterns.utf8shape = utf8shape -- string -characters.lhash = lhash -- nil if no conversion -characters.uhash = uhash -- nil if no conversion -characters.shash = shash -- nil if no conversion - function characters.lower (str) return lpegmatch(utf8lower,str) end function characters.upper (str) return lpegmatch(utf8upper,str) end function characters.shaped(str) return lpegmatch(utf8shape,str) end diff --git a/tex/context/base/char-utf.lua b/tex/context/base/char-utf.lua index fcd300f6b..e3f7605a8 100644 --- a/tex/context/base/char-utf.lua +++ b/tex/context/base/char-utf.lua @@ -174,40 +174,37 @@ local function initialize() end for unicode, v in next, data do local vs = v.specials - if vs and #vs == 3 then - if vs[1] == "char" then - -- - local one, two = vs[2], vs[3] - local first, second, combination = utfchar(one), utfchar(two), utfchar(unicode) - -- - collapsed[first..second] = combination - backtrack(data[one],second,combination) - -- sort of obsolete: - local cgf = graphemes[first] - if not cgf then - cgf = { [second] = combination } - graphemes[first] = cgf + if vs and #vs == 3 and vs[1] == "char" then + -- + local one, two = vs[2], vs[3] + local first, second, combination = utfchar(one), utfchar(two), utfchar(unicode) + -- + collapsed[first..second] = combination + backtrack(data[one],second,combination) + -- sort of obsolete: + local cgf = graphemes[first] + if not cgf then + cgf = { [second] = combination } + graphemes[first] = cgf + else + cgf[second] = combination + end + -- + if v.mathclass or v.mathspec then + local mps = mathpairs[two] + if not mps then + mps = { [one] = unicode } + mathpairs[two] = mps else - cgf[second] = combination + mps[one] = unicode -- here unicode end - -- - if v.mathclass or v.mathspec then - local mps = mathpairs[two] - if not mps then - mps = { [one] = unicode } - mathpairs[two] = mps - else - mps[one] = unicode -- here unicode - end - local mps = mathpairs[second] - if not mps then - mps = { [first] = combination } - mathpairs[second] = mps - else - mps[first] = combination - end + local mps = mathpairs[second] + if not mps then + mps = { [first] = combination } + mathpairs[second] = mps + else + mps[first] = combination end - -- end end end diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 3fe1d0a44..85a8ed584 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2015.01.07 01:32} +\newcontextversion{2015.01.08 14:59} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex c50e09b5b..76d93028a 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 72b90c8c8..78fc309a7 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.01.07 01:32} +\edef\contextversion{2015.01.08 14:59} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-fbk.lua b/tex/context/base/font-fbk.lua index 48e2167e6..954d73c7c 100644 --- a/tex/context/base/font-fbk.lua +++ b/tex/context/base/font-fbk.lua @@ -19,18 +19,20 @@ local trace_combining_define = false trackers.register("fonts.composing.defi trackers.register("fonts.combining", "fonts.composing.define") -- for old times sake (and manuals) trackers.register("fonts.combining.all", "fonts.composing.*") -- for old times sake (and manuals) -local report_combining = logs.reporter("fonts","combining") +local report_combining = logs.reporter("fonts","combining") -local force_combining = false -- just for demo purposes (see mk) +local force_combining = false -- just for demo purposes (see mk) -local allocate = utilities.storage.allocate +local allocate = utilities.storage.allocate local fonts = fonts local handlers = fonts.handlers local constructors = fonts.constructors -local registerotffeature = handlers.otf.features.register -local registerafmfeature = handlers.afm.features.register +local otf = handlers.otf +local afm = handlers.afm +local registerotffeature = otf.features.register +local registerafmfeature = afm.features.register local unicodecharacters = characters.data local unicodefallbacks = characters.fallbacks @@ -302,3 +304,32 @@ end -- {'special', 'pdf: /Fm\XX\space Do'}, -- {'special', 'pdf: Q'}, -- {'special', 'pdf: Q'}, + +-- new and experimental + +local everywhere = { ["*"] = { ["*"] = true } } -- or: { ["*"] = { "*" } } +local noflags = { } + +local char_specification = { + type = "ligature", + features = everywhere, + data = characters.splits.char, + order = { "char-ligatures" }, + flags = noflags, + prepend = true, +} + +local compat_specification = { + type = "ligature", + features = everywhere, + data = characters.splits.compat, + order = { "compat-ligatures" }, + flags = noflags, + prepend = true, +} + +otf.addfeature("char-ligatures", char_specification) +otf.addfeature("compat-ligatures",compat_specification) + +registerotffeature { name = 'char-ligatures', description = 'unicode char specials to ligatures' } +registerotffeature { name = 'compat-ligatures', description = 'unicode compat specials to ligatures' } diff --git a/tex/context/base/font-mis.lua b/tex/context/base/font-mis.lua index 2f7d12e9a..0ec95ee1b 100644 --- a/tex/context/base/font-mis.lua +++ b/tex/context/base/font-mis.lua @@ -22,7 +22,7 @@ local handlers = fonts.handlers handlers.otf = handlers.otf or { } local otf = handlers.otf -otf.version = otf.version or 2.802 +otf.version = otf.version or 2.803 otf.cache = otf.cache or containers.define("fonts", "otf", otf.version, true) local fontloader = fontloader diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 44ad89325..c7e83a4cb 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -53,7 +53,7 @@ local otf = fonts.handlers.otf otf.glists = { "gsub", "gpos" } -otf.version = 2.802 -- beware: also sync font-mis.lua +otf.version = 2.803 -- beware: also sync font-mis.lua otf.cache = containers.define("fonts", "otf", otf.version, true) local hashes = fonts.hashes diff --git a/tex/context/base/lpdf-epd.lua b/tex/context/base/lpdf-epd.lua index 4d10a26f4..1dc20bc26 100644 --- a/tex/context/base/lpdf-epd.lua +++ b/tex/context/base/lpdf-epd.lua @@ -175,7 +175,7 @@ local function prepare(document,d,t,n,k,mt,flags) else local v, flag = checked_access[kind](v,document) t[key] = v - if flag then + if flag and flags then flags[key] = flag -- flags end end diff --git a/tex/context/base/mult-fun.lua b/tex/context/base/mult-fun.lua index b5d061954..60f087d4c 100644 --- a/tex/context/base/mult-fun.lua +++ b/tex/context/base/mult-fun.lua @@ -99,7 +99,7 @@ return { -- "remapcolors", "normalcolors", "resetcolormap", "remapcolor", "remappedcolor", -- "recolor", "refill", "redraw", "retext", "untext", "restroke", "reprocess", "repathed", "tensecircle", "roundedsquare", - "colortype", "whitecolor", "blackcolor", + "colortype", "whitecolor", "blackcolor", "basiccolors", -- -- "swappointlabels", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", @@ -120,6 +120,6 @@ return { "startpassingvariable", "stoppassingvariable", -- "eofill", "eoclip", - "area" + "area", }, } diff --git a/tex/context/base/s-typesetting-kerning.mkiv b/tex/context/base/s-typesetting-kerning.mkiv index b0c972627..96e17b7c0 100644 --- a/tex/context/base/s-typesetting-kerning.mkiv +++ b/tex/context/base/s-typesetting-kerning.mkiv @@ -115,15 +115,31 @@ \getbuffer[showcharacterkerning:explicits] \stoptexdefinition + +\starttexdefinition showcharacterkerningstepscompared #1 + \definecharacterkerning[crap][factor=\KerningStepFactor]% + \setbox0=\ruledhbox{\color[color-1]{#1}\hss} + \setbox2=\ruledhbox{\setcharacterkerning[crap]\color[color-2]{#1}} + \setbox4=\ruledhbox{\setcharacterkerning[crap]\showfontkerns\showglyphs#1} + \xdef\KerningStepPercentage{\ctxlua{context("\letterpercent 0.2f",(1-\number\wd0/\number\wd2)*100)}} + \scratchwidth\wd0 + \hbox{\box0\hskip-\scratchwidth\box2} + \par + \box4 +\stoptexdefinition + \starttexdefinition showcharacterkerningsteps [#1] \startTEXpage[\c!offset=1ex] - \showfontkerns \showglyphs + \definecolor[color-1][r=1,t=.5,a=1] + \definecolor[color-2][b=1,t=.5,a=1] \getdummyparameters [\s!font=Regular, \c!sample={Wat een bende, rommelen met het font design!}, +% \c!text={een}, + \c!text={rommelen}, #1] \definedfont[\dummyparameter\s!font*default sa 1] @@ -134,16 +150,25 @@ \blank + \starttabulate[|cT|p|cT|p|cT|] + + \NC \tt\bf factor \NC \tt\bf sample \NC \tt\bf \letterpercent \NC \tt\bf text \NC \tt\bf \letterpercent \NC \NR \HL + \dostepwiserecurse {00} {95} {05} { - \definecharacterkerning[crap][factor=.0\twodigits{##1}]% - \begingroup - \tttf .0\twodigits{##1}:\space - \endgroup - \begingroup - \setcharacterkerning[crap]\dummyparameter\c!sample\par - \endgroup + \NC + \xdef\KerningStepFactor{\ctxlua{context("\letterpercent 0.3f",####1/1000)}} + \KerningStepFactor + \NC + \showcharacterkerningstepscompared{\dummyparameter\c!sample} + \NC + \KerningStepPercentage + \NC + \showcharacterkerningstepscompared{\dummyparameter\c!text} + \NC + \KerningStepPercentage + \NC \NR } - \removeunwantedspaces + \stoptabulate \stopTEXpage diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex e40fc5b00..81cade524 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 5ffa09b28..a5c2826d0 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv index f9a1593cf..b5eafacec 100644 --- a/tex/context/base/tabl-ntb.mkiv +++ b/tex/context/base/tabl-ntb.mkiv @@ -20,6 +20,8 @@ %D runtime. % columndistance 'optimized' ... needs checking +% +% we don't need the alignment mechanism .. we can just pack the row in a box \writestatus{loading}{ConTeXt Table Macros / Natural Tables} @@ -584,9 +586,9 @@ % local \ifcsname\m_tabl_ntb_prefix\c!y++\m_tabl_ntb_positive_row\endcsname\csname\m_tabl_ntb_prefix\c!y++\m_tabl_ntb_positive_row\endcsname\fi % done - \xdef\m_tabl_ntb_before_split{\naturaltablelocalparameter\c!before}% to be checked - \xdef\m_tabl_ntb_after_split {\naturaltablelocalparameter\c!after }% to be checked - \xdef\m_tabl_ntb_same_page {\naturaltablelocalparameter\c!samepage}% +% \xdef\m_tabl_ntb_before_split{\naturaltablelocalparameter\c!before}% to be checked +% \xdef\m_tabl_ntb_after_split {\naturaltablelocalparameter\c!after }% to be checked +% \xdef\m_tabl_ntb_same_page {\naturaltablelocalparameter\c!samepage}% \relax} % we cannot use +n (checking on number/last/first would slow down too much) @@ -1103,8 +1105,74 @@ \newcount\c_tabl_prelocated_rows % \prelocateTBLrows{1000} may speed up large tables -\def\tabl_ntb_row_start{\t_tabl_ntb_row\emptytoks} -\def\tabl_ntb_row_stop {\normalexpanded{\t_tabl_ntb{\the\t_tabl_ntb\noexpand\tabl_ntb_row_align_start\the\t_tabl_ntb_row\tabl_ntb_row_align_stop}}} +% \def\tabl_ntb_row_start{\t_tabl_ntb_row\emptytoks} +% \def\tabl_ntb_row_stop {\normalexpanded{\t_tabl_ntb{\the\t_tabl_ntb\noexpand\tabl_ntb_row_align_start\the\t_tabl_ntb_row\tabl_ntb_row_align_stop}}} + +\def\tabl_ntb_row_start + {\t_tabl_ntb_row\emptytoks} + +\def\tabl_ntb_row_stop + {\ifenableTBLbreak + \tabl_ntb_row_stop_split + \else + \tabl_ntb_row_stop_boxed + \fi} + +\def\tabl_ntb_row_stop_boxed + {\normalexpanded + {\t_tabl_ntb + {\the\t_tabl_ntb + % no need for init + \noexpand\tabl_ntb_row_align_start + \the\t_tabl_ntb_row + \noexpand\tabl_ntb_row_align_stop}}} + +\def\tabl_ntb_row_stop_split + {\ifcsname\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_current_row\endcsname + \tabl_ntb_row_stop_split_yes + \else + \tabl_ntb_row_stop_split_nop + \fi} + +\def\tabl_ntb_row_stop_split_nop + {\normalexpanded + {\t_tabl_ntb + {\the\t_tabl_ntb + \noexpand\tabl_ntb_row_align_reset + \noexpand\tabl_ntb_row_align_start + \the\t_tabl_ntb_row + \noexpand\tabl_ntb_row_align_stop}}} + +\def\tabl_ntb_row_stop_split_yes + {\begingroup + \csname\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_current_row\endcsname + \xdef\m_tabl_ntb_before_split{\naturaltablelocalparameter\c!before}% to be checked + \xdef\m_tabl_ntb_after_split {\naturaltablelocalparameter\c!after}% to be checked + \xdef\m_tabl_ntb_same_page {\naturaltablelocalparameter\c!samepage}% + \endgroup + \normalexpanded + {\t_tabl_ntb + {\the\t_tabl_ntb + \noexpand\tabl_ntb_row_align_set{\m_tabl_ntb_before_split}{\m_tabl_ntb_after_split}{\m_tabl_ntb_same_page}% + \noexpand\tabl_ntb_row_align_start + \the\t_tabl_ntb_row + \noexpand\tabl_ntb_row_align_stop}}} + +\def\tabl_ntb_row_align_set#1#2#3% + {\noalign{\tabl_ntb_row_align_set_indeed{#1}{#2}{#3}}} + +\def\tabl_ntb_row_align_reset + {\noalign{\tabl_ntb_row_align_reset_indeed}} + +\unexpanded\def\tabl_ntb_row_align_set_indeed#1#2#3% + {\xdef\m_tabl_ntb_before_split{#1}% + \xdef\m_tabl_ntb_after_split {#2}% + \xdef\m_tabl_ntb_same_page {#3}} + +\unexpanded\def\tabl_ntb_row_align_reset_indeed + {\global\let\m_tabl_ntb_before_split\empty + \global\let\m_tabl_ntb_after_split \empty + \global\let\m_tabl_ntb_same_page \empty} \def\tabl_ntb_prelocate_error {\writestatus\m!system{fatal error: use \string\prelocateTBLrows\space to increase table memory (now: \the\c_tabl_prelocated_rows)}} @@ -1142,66 +1210,143 @@ \let\m_tabl_ntb_saved_row\!!zerocount \let\m_tabl_ntb_saved_col\!!zerocount -\def\tabl_ntb_row_align_start - {\noalign - {\tabl_ntb_row_align_reset - \bgroup % protect local vars - \m_tabl_ntb_before_split - \egroup - \ifx\m_tabl_ntb_same_page\v!before - \unpenalty - \nobreak - \else\ifx\m_tabl_ntb_same_page\v!both - \unpenalty - \nobreak - \fi\fi}% - \tabl_ntb_column_next - \kern\dimexpr - \d_tabl_ntb_leftmargindistance - -\d_tabl_ntb_columndistance - \relax} +% \unexpanded\def\tabl_ntb_row_align_reset +% {\global\advance\c_tabl_ntb_row\plusone +% \global\c_tabl_ntb_col\zerocount +% \global\c_tabl_ntb_spn\zerocount} +% +% \def\tabl_ntb_row_align_start % not \unexpanded +% {\noalign +% {\tabl_ntb_row_align_reset +% \bgroup % protect local vars +% \m_tabl_ntb_before_split +% \egroup +% \ifx\m_tabl_ntb_same_page\v!before +% \unpenalty +% \nobreak +% \else\ifx\m_tabl_ntb_same_page\v!both +% \unpenalty +% \nobreak +% \fi\fi}% +% \tabl_ntb_column_next +% \kern\dimexpr +% \d_tabl_ntb_leftmargindistance +% -\d_tabl_ntb_columndistance +% \relax} +% +% \unexpanded\def\tabl_ntb_row_align_stop +% {\kern\dimexpr +% \d_tabl_ntb_rightmargindistance +% -\d_tabl_ntb_columndistance +% \relax +% \crcr +% \noalign +% {\nointerlineskip +% \ifnum\c_tabl_ntb_row>\c_tabl_ntb_n_of_head_lines +% \ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount +% \unpenalty +% \ifx\m_tabl_ntb_same_page\v!after +% \nobreak +% \else\ifx\m_tabl_ntb_same_page\v!both +% \nobreak +% \else +% \allowbreak +% \fi\fi +% \fi +% \else +% \allowbreak % else no proper head split off +% \fi +% \bgroup % protect local vars +% \m_tabl_ntb_after_split +% \egroup +% \bgroup % protect local vars +% \scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax +% \ifnum\scratchcounter>\c_tabl_ntb_n_of_hdnx_lines\relax +% \ifnum\scratchcounter<\c_tabl_ntb_maximum_row\relax +% \edef\p_spaceinbetween{\naturaltablelocalparameter\c!spaceinbetween}% +% \ifx\p_spaceinbetween\empty\else +% \blank[\p_spaceinbetween]% +% \fi +% \fi +% \fi +% \egroup}} -\unexpanded\def\tabl_ntb_row_align_reset +\unexpanded\def\tabl_ntb_row_initialize {\global\advance\c_tabl_ntb_row\plusone \global\c_tabl_ntb_col\zerocount \global\c_tabl_ntb_spn\zerocount} -\unexpanded\def\tabl_ntb_row_align_stop - {\kern\dimexpr - \d_tabl_ntb_rightmargindistance - -\d_tabl_ntb_columndistance - \relax +\def\tabl_ntb_row_align_start + {\noalign{\tabl_ntb_row_initialize\tabl_ntb_row_align_start_inject}% + \tabl_ntb_column_next + \kern\dimexpr\d_tabl_ntb_leftmargindistance-\d_tabl_ntb_columndistance\relax} + +\def\tabl_ntb_row_align_stop + {\kern\dimexpr\d_tabl_ntb_rightmargindistance-\d_tabl_ntb_columndistance\relax \crcr - \noalign - {\nointerlineskip - \ifnum\c_tabl_ntb_row>\c_tabl_ntb_n_of_head_lines - \ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount - \unpenalty - \ifx\m_tabl_ntb_same_page\v!after - \nobreak - \else\ifx\m_tabl_ntb_same_page\v!both - \nobreak - \else - \allowbreak - \fi\fi - \fi - \else - \allowbreak % else no proper head split off - \fi - \bgroup % protect local vars - \m_tabl_ntb_after_split - \egroup - \bgroup % protect local vars - \scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax - \ifnum\scratchcounter>\c_tabl_ntb_n_of_hdnx_lines\relax - \ifnum\scratchcounter<\c_tabl_ntb_maximum_row\relax - \edef\p_spaceinbetween{\naturaltablelocalparameter\c!spaceinbetween}% - \ifx\p_spaceinbetween\empty\else - \blank[\p_spaceinbetween]% - \fi - \fi - \fi - \egroup}} + \noalign{\tabl_ntb_row_align_stop_inject}} + +\unexpanded\def\tabl_ntb_before_page + {\ifx\m_tabl_ntb_same_page\v!before + % \blank[\v!samepage,\v!strong]% + \unpenalty + \nobreak + \else\ifx\m_tabl_ntb_same_page\v!both + % \blank[\v!samepage,\v!strong]% + \unpenalty + \nobreak + \fi\fi} + +\unexpanded\def\tabl_ntb_after_page + {\ifnum\c_tabl_ntb_row>\c_tabl_ntb_n_of_head_lines + \ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount + \unpenalty + \ifx\m_tabl_ntb_same_page\v!after + % \blank[\v!samepage,\v!strong]% + \nobreak + \else\ifx\m_tabl_ntb_same_page\v!both + % \blank[\v!samepage,\v!strong]% + \nobreak + \else + % \blank[\v!preference,\v!weak]% + \allowbreak + \fi\fi + \fi + \else + % \blank[\v!preference,\v!weak]% + \allowbreak % else no proper head split off + \fi} + +\unexpanded\def\tabl_ntb_inbetween + {\scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax + \ifnum\scratchcounter>\c_tabl_ntb_n_of_hdnx_lines\relax + \ifnum\scratchcounter<\c_tabl_ntb_maximum_row\relax + \edef\p_spaceinbetween{\naturaltablelocalparameter\c!spaceinbetween}% + \ifx\p_spaceinbetween\empty\else + \blank[\p_spaceinbetween]% + \fi + \fi + \fi} + +\unexpanded\def\tabl_ntb_row_align_start_inject + {\bgroup % protect local vars + \m_tabl_ntb_before_split + \egroup + \ifenableTBLbreak + \tabl_ntb_before_page + \fi} + +\unexpanded\def\tabl_ntb_row_align_stop_inject + {\nointerlineskip + \ifenableTBLbreak + \tabl_ntb_after_page + \fi + \bgroup % protect local vars + \m_tabl_ntb_after_split + \egroup + \bgroup % protect local vars + \tabl_ntb_inbetween + \egroup} \def\tabl_ntb_flush_content {\the\everyTABLEpass diff --git a/tex/context/base/x-html.mkiv b/tex/context/base/x-html.mkiv new file mode 100644 index 000000000..bcb36a7d6 --- /dev/null +++ b/tex/context/base/x-html.mkiv @@ -0,0 +1,369 @@ +%D \module +%D [ file=x-html, +%D version=2011.02.03, % adapted 2014.11.08 +%D title=\CONTEXT\ Modules, +%D subtitle=HTML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startmodule[html] + +%D Usage: +%D +%D \starttyping +%D \xmlregistersetup{xml:html:basics} +%D \xmlregistersetup{xml:html:tables} +%D \stoptyping + +% \xmlsetsetup{#1}{(p|span)[@lang]}{xml:html:lang} +% +% \startxmlsetups xml:html:lang +% \begingroup +% \language[\xmlatt{#1}{lang}] +% \xmlsetup{#1}{xml:html:\xmltag{#1}} +% \endgroup +% \stopxmlsetups + +\unprotect + +\definehighlight[b] [\c!command=\v!no,\c!style=\v!bold] +\definehighlight[i] [\c!command=\v!no,\c!style=\v!italic] +\definehighlight[bi] [\c!command=\v!no,\c!style=\v!bolditalic] +\definehighlight[em] [\c!command=\v!no,\c!style=\em] +\definehighlight[tt] [\c!command=\v!no,\c!style=\v!mono] +\definehighlight[strong][\c!command=\v!no,\c!style=\v!bold] +\definehighlight[u] [\c!command=\v!no,\c!style=\directsetbar{\v!underbar}] + +\protect + +% todo: pre + +\startxmlsetups xml:html:basics + \xmlsetsetup{#1}{p|br|b|i|u|em|tt|strong|ul|ol|li|table|thead|tbody|tfoot|tr|td|th|span|img}{xml:html:*} + \xmlsetsetup{#1}{b/i}{xml:html:bi} + \xmlsetsetup{#1}{i/b}{xml:html:bi} + \xmlstripanywhere{#1}{!pre} +\stopxmlsetups + +\startxmlsetups xml:html:tables + \xmlsetsetup{#1}{table|thead|tbody|tfoot|tr|td|th}{xml:html:*} +\stopxmlsetups + +\startxmlsetups xml:html:p + \xmldoifnotselfempty {#1} { + \dontleavehmode + \ignorespaces + \xmlflush{#1} + \removeunwantedspaces + } + \par +\stopxmlsetups + +\startxmlsetups xml:html:br + \crlf +\stopxmlsetups + +\startxmlsetups xml:html:b + \directhighlight{b}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:i + \directhighlight{i}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:bi + \directhighlight{bi}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:em + \directhighlight{em}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:tt + \directhighlight{tt}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:strong + \directhighlight{strong}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:u + \directhighlight{u}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:html:ul + \startitemize[packed] + \xmlflush{#1} + \stopitemize +\stopxmlsetups + +\startxmlsetups xml:html:ol + \startitemize[packed,n] + \xmlflush{#1} + \stopitemize +\stopxmlsetups + +\startxmlsetups xml:html:li + \startitem + \xmlflush{#1} + \stopitem +\stopxmlsetups + +\startxmlsetups xml:html:span + \xmlflush{#1} +\stopxmlsetups + +\startxmlsetups xml:html:img + \ifhmode + \dontleavehmode + \externalfigure[\xmlatt{#1}{src}] + \else + \startlinecorrection + \externalfigure[\xmlatt{#1}{src}] + \stoplinecorrection + \fi +\stopxmlsetups + +% tables, maybe we need a generic html table module +% +% todo: align + +% beware, the padding code is somewhat experimental, eventually the +% table will be done in cdl code +% +% we can also use \xmlmap for border etc + +\starttexdefinition cssgetsinglepadding #1 + \ctxlua { + context((moduledata.css.padding( + "#1", + \number\dimexpr0.1ex, + \number\dimexpr0.01\hsize, + \number\dimexpr1ex, + \number\dimexpr1em + ))) % returns 4 values therefore () + }sp +\stoptexdefinition + +\startxmlsetups xml:html:table + \edef\CellPadding{\xmlatt{#1}{cellpadding}} + \ifx\CellPadding\empty + \edef\CellPadding{.25ex} + \else + \edef\CellPadding{\cssgetsinglepadding\CellPadding} + \fi + \startlinecorrection[blank] + \doifelse {\xmlatt{#1}{border}} {0} { + \bTABLE[frame=off,offset=\CellPadding] + \xmlflush{#1} + \eTABLE + } { + \bTABLE[offset=\CellPadding] + \xmlflush{#1} + \eTABLE + } + \stoplinecorrection +\stopxmlsetups + +\startxmlsetups xml:html:thead + \bTABLEhead + \xmlflush{#1} + \eTABLEhead +\stopxmlsetups + +\startxmlsetups xml:html:tbody + \bTABLEbody + \xmlflush{#1} + \eTABLEbody +\stopxmlsetups + +\startxmlsetups xml:html:tfoot + \bTABLEfoot + \xmlflush{#1} + \eTABLEfoot +\stopxmlsetups + +\startxmlsetups xml:html:tr + \bTR[ny=\xmlattdef{#1}{rowspan}{1}] + \xmlflush{#1} + \eTR +\stopxmlsetups + +\startxmlsetups xml:html:td + \bTD[nx=\xmlattdef{#1}{colspan}{1}] + \xmlflush{#1} + \eTD +\stopxmlsetups + +\startxmlsetups xml:html:th + \bTH[nx=\xmlattdef{#1}{colspan}{1}] + \xmlflush{#1} + \eTH +\stopxmlsetups + +% \xmlregistersetup{xml:html:basics} + +%D For old times sake: + +\startxmlsetups xml:setups:common + \xmlsetup{#1}{xml:html:basics} + \xmlsetup{#1}{xml:html:tables} +% \ifconditional\qmlcleanuptwo +% \xmlsetsetup{#1}{html/br[index() == 1]}{xml:noppes:1} +% \xmlsetsetup{#1}{html/p[index() == lastindex()]/br[index() == lastindex()]}{xml:noppes:2} +% \xmlsetsetup{#1}{html/br[index() == lastindex()]}{xml:noppes:3} +% \xmlsetsetup{#1}{br[name(1) == 'img']}{xml:noppes} +% \xmlsetsetup{#1}{br[name(1) == 'br' and name(2) == 'img']}{xml:noppes} +% % \xmlsetsetup{#1}{br/following-sibling::img[position()==1]}{xml:noppes} +% \fi +\stopxmlsetups + +\stopmodule + +\continueifinputfile{x-html.mkiv} + +\xmlregistersetup{xml:html:basics} +\xmlregistersetup{xml:html:tables} + +\startxmlsetups xml:whatever + \xmlsetsetup {#1} { + html|body + } {xml:html:*} +\stopxmlsetups + +\xmlregisterdocumentsetup{main}{xml:whatever} + +\startxmlsetups xml:html:html + \xmlflush{#1} +\stopxmlsetups + +\startxmlsetups xml:html:body + \xmlflush{#1} +\stopxmlsetups + +\setuphead[subject][page=yes,style=\bfa] + +\starttexdefinition ShowExample#1 + \startsubject[title=#1] + \typebuffer[#1] + \starttextrule{result} + \xmlprocessbuffer{main}{#1}{} + \stoptextrule + \stopsubject +\stoptexdefinition + +\starttext + +\startbuffer[test 1] +<html><body> +<p>test</p> +<p/> +<p>test</p> +</body></html> +\stopbuffer + +\startbuffer[test 2] +<html><body> +<p>test (hierna een lf) +test</p> +</body></html> +\stopbuffer + +\startbuffer[test 3] +<html><body> +<p>test (hierna een lf met lege regel) + +test</p> +</body></html> +\stopbuffer + +\startbuffer[test 4] +<html><body> +<p>test (hierna een lf met twee lege regels) + + +test</p> +</body></html> +\stopbuffer + +\startbuffer[test 5] +<html><body> +<p>test (hierna br geen lf)<br/> test</p> +</body></html> +\stopbuffer + +\startbuffer[test 6] +<html><body> +<p>test (hierna br met lf)<br/> +test</p> +</body></html> +\stopbuffer + +\startbuffer[test 7] +<html><body> +<p>test (hierna br met lf en lege regel)<br/> + +test</p> +</body></html> +\stopbuffer + +\startbuffer[test 8] +<html><body> +<p>test (hierna br met lf en twee lege regels)<br/> + + +test</p> +</body></html> +\stopbuffer + +\startbuffer[test 9] +<html><body> +<p>test (hierna bold) <b>bold</b> test</p> +</body></html> +\stopbuffer + +\startbuffer[test 10] +<html><body> +<p>test (hierna lf met bold) +<b>bold <u>underlined</u></b> test</p> +</body></html> +\stopbuffer + +\startbuffer[test 11] +<html><body> +<p>test (hierna lf met lege regel en bold) + +<b>bold</b> test</p> +</body></html> +\stopbuffer + +\startbuffer[test 12] +<html><body> +<p>test (hierna lf met lege regel en lf in bold) + +<b> +bold +</b> test</p> +</body></html> +\stopbuffer + +\startbuffer[test 13] +<html><body> +<p>test (hierna lf met lege regel en lf en lege regel in bold) + +<b> + +bold + +</b> test</p> +</body></html> +\stopbuffer + +\dorecurse{13}{\ShowExample{test #1}} + +\stoptext diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 3d6b849b6..3091572fb 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/07/15 01:32:37 +-- merge date : 01/08/15 14:59:21 do -- begin closure to overcome local limits and interference @@ -7057,7 +7057,7 @@ local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf otf.glists={ "gsub","gpos" } -otf.version=2.802 +otf.version=2.803 otf.cache=containers.define("fonts","otf",otf.version,true) local hashes=fonts.hashes local definers=fonts.definers |