diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-13 18:16:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-13 18:16:16 +0200 |
commit | 9db0c39e07509226287ef0075dfda8d2386416ed (patch) | |
tree | 6daf69803dd8c7cc1eadfeebe65653de6c4a23c1 /tex | |
parent | 5baf21b979124606cb6503be4e16d403f233ecd4 (diff) | |
download | context-9db0c39e07509226287ef0075dfda8d2386416ed.tar.gz |
2016-06-13 17:04:00
Diffstat (limited to 'tex')
22 files changed, 223 insertions, 96 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 5017b348e..2f0286ca8 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 0b726b5f7..18eaa405b 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.06.10 23:51} +\newcontextversion{2016.06.13 17:00} %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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 1aeafe0cf..7abb268ff 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.06.10 23:51} +\edef\contextversion{2016.06.13 17:00} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua index 9726c51d8..a1ae17f9b 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -2214,9 +2214,9 @@ function readers.math(f,fontdata,specification) end function readers.colr(f,fontdata,specification) - if specification.details then - local datatable = fontdata.tables.colr - if datatable then + local datatable = fontdata.tables.colr + if datatable then + if specification.glyphs then local tableoffset = datatable.offset setposition(f,tableoffset) local version = readushort(f) @@ -2266,11 +2266,12 @@ function readers.colr(f,fontdata,specification) glyphs[glyphindex].colors = t end end + fontdata.hascolor = true end end function readers.cpal(f,fontdata,specification) - if specification.details then + if specification.glyphs then local datatable = fontdata.tables.cpal if datatable then local tableoffset = datatable.offset @@ -2316,9 +2317,9 @@ function readers.cpal(f,fontdata,specification) end function readers.svg(f,fontdata,specification) - if specification.details then - local datatable = fontdata.tables.svg - if datatable then + local datatable = fontdata.tables.svg + if datatable then + if specification.glyphs then local tableoffset = datatable.offset setposition(f,tableoffset) local version = readushort(f) @@ -2351,5 +2352,6 @@ function readers.svg(f,fontdata,specification) end fontdata.svgshapes = entries end + fontdata.hascolor = true end end diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua index e09e87d4a..7d0bf046c 100644 --- a/tex/context/base/mkiv/font-otr.lua +++ b/tex/context/base/mkiv/font-otr.lua @@ -1659,19 +1659,19 @@ end -- Experimental (we need fonts). function readers.colr(f,fontdata,specification) - if specification.details then + if specification.glyphs then reportskippedtable("colr") end end function readers.cpal(f,fontdata,specification) - if specification.details then + if specification.glyphs then reportskippedtable("cpal") end end function readers.svg(f,fontdata,specification) - if specification.details then + if specification.glyphs then reportskippedtable("svg") end end @@ -2189,6 +2189,7 @@ function readers.loadfont(filename,n) properties = { hasitalics = fontdata.hasitalics or false, maxcolorclass = fontdata.maxcolorclass, + hascolor = fontdata.hascolor or false, }, resources = { -- filename = fontdata.filename, diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index be7b02747..07d6ce70b 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -133,6 +133,8 @@ return { "optionalspace", "asciispacechar", -- "Ux", "eUx", "Umathaccents", + -- + "parfillleftskip", "parfillrightskip", }, ["helpers"] = { -- diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index d9c432f7c..8efa0031d 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -268,6 +268,7 @@ return { "leftmarginkern", "letcharcode", "letterspacefont", + "linedir", "localbrokenpenalty", "localinterlinepenalty", "localleftbox", @@ -887,6 +888,7 @@ return { "letcharcode", "letterspacefont", "limits", + "linedir", "linepenalty", "lineskip", "lineskiplimit", diff --git a/tex/context/base/mkiv/node-aux.lua b/tex/context/base/mkiv/node-aux.lua index 5ac096f7c..4115530d4 100644 --- a/tex/context/base/mkiv/node-aux.lua +++ b/tex/context/base/mkiv/node-aux.lua @@ -445,6 +445,25 @@ function nodes.locate(start,wantedid,wantedsubtype) return found and tonode(found) end +local function rehpack(n,width) + local head = getlist(n) + local size = width or getfield(n,"width") + local temp = hpack_nodes(head,size,"exactly") + setfield(n,"width", size) + setfield(n,"glue_set", getfield(temp,"glue_set")) + setfield(n,"glue_sign", getfield(temp,"glue_sign")) + setfield(n,"glue_order",getfield(temp,"glue_order")) + setlist(temp) + free_node(temp) + return n +end + +nuts.rehpack = rehpack + +function nodes.rehpack(n,...) + rehpack(tonut(n),...) +end + -- I have no use for this yet: -- -- \skip0=10pt plus 2pt minus 2pt diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua index c6a246b96..885bbf45a 100644 --- a/tex/context/base/mkiv/node-met.lua +++ b/tex/context/base/mkiv/node-met.lua @@ -115,11 +115,21 @@ nodes.kerning = node.kerning nodes.ligaturing = node.ligaturing nodes.mlist_to_hlist = node.mlist_to_hlist -nodes.effective_glue = node.effective_glue +if LUATEXVERSION < 0.97 then -nodes.is_zero_glue = node.is_zero_glue -nodes.getglue = node.getglue + local getglue = node.getglue + + function node.is_zero_glue(n) + local width, stretch, shrink = getglue(n) + return width == 0 and stretch == 0 and shrink == 0 + end + +end + +nodes.effective_glue = node.effective_glue nodes.getglue = node.getglue +nodes.setglue = node.setglue +nodes.is_zero_glue = node.is_zero_glue -- if not gonuts or not node.getfield then -- node.getfield = metatable.__index diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index 0e63247ea..245367c0a 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -201,7 +201,6 @@ nuts.protect_glyph = direct.protect_glyph nuts.unprotect_glyphs = direct.unprotect_glyphs nuts.ligaturing = direct.ligaturing nuts.kerning = direct.kerning -nuts.effective_glue = direct.effective_glue if not direct.mlist_to_hlist then -- needed @@ -213,50 +212,25 @@ if not direct.mlist_to_hlist then -- needed end -local is_zero_glue = direct.is_zero_glue -local setglue = direct.setglue -local getglue = direct.getglue +if LUATEXVERSION < 0.97 then -if not is_zero_glue then - is_zero_glue = function(n) - return not n or ( - getfield(n,"width") == 0 and - getfield(n,"stretch") == 0 and - getfield(n,"shrink") == 0 - ) - end - setglue = function(n,width,stretch,shrink,stretch_order,shrink_order) - setfield(n,"width", width or 0) - setfield(n,"stretch", stretch or 0) - setfield(n,"shrink", shrink or 0) - setfield(n,"stretch_order",stretch_order or 0) - setfield(n,"shrink_order", shrink_order or 0) - end - getglue = function(n) - return - getfield(n,"width"), getfield(n,"stretch"), getfield(n,"shrink"), - getfield(n,"stretch_order"), getfield(n,"shrink_order") - end -end + local getglue = direct.getglue -nuts.is_zero_glue = is_zero_glue -nuts.setglue = setglue -nuts.getglue = getglue + function direct.is_zero_glue(n) + local width, stretch, shrink = getglue(n) + return width == 0 and stretch == 0 and shrink == 0 + end +end --- if not direct.getpre then --- --- local getfield = nuts.getfield --- --- function direct.getpre (n) local h, _, _, t = getdisc(n,true) return h, t end --- function direct.getpost (n) local _, h, _, _, t = getdisc(n,true) return h, t end --- function direct.getreplace(n) local _, _, h, _, _, t = getdisc(n,true) return h, t end --- --- end +local getglue = direct.getglue +local setglue = direct.setglue +local is_zero_glue = direct.is_zero_glue -----.getpre = direct.getpre -----.getpost = direct.getpost -----.getreplace = direct.getreplace +nuts.effective_glue = direct.effective_glue +nuts.getglue = getglue +nuts.setglue = setglue +nuts.is_zero_glue = is_zero_glue nuts.getdisc = direct.getdisc nuts.setdisc = direct.setdisc diff --git a/tex/context/base/mkiv/spac-ali.mkiv b/tex/context/base/mkiv/spac-ali.mkiv index 21714f07c..fef4c0f19 100644 --- a/tex/context/base/mkiv/spac-ali.mkiv +++ b/tex/context/base/mkiv/spac-ali.mkiv @@ -86,16 +86,6 @@ \spac_directions_lefttoright_hmode \fi} -\unexpanded\def\spac_directions_lefttoright_vmode - {\settrue\displaylefttoright - \settrue\inlinelefttoright - \textdir TLT\relax - \pardir TLT\relax} - -\unexpanded\def\spac_directions_lefttoright_hmode - {\settrue\inlinelefttoright - \textdir TLT\relax} - \unexpanded\def\righttoleft {\ifvmode \spac_directions_righttoleft_vmode @@ -103,15 +93,71 @@ \spac_directions_righttoleft_hmode \fi} +\unexpanded\def\spac_directions_lefttoright_vmode + {\settrue\displaylefttoright + \settrue\inlinelefttoright + \textdir TLT\relax + \pardir TLT\relax} + \unexpanded\def\spac_directions_righttoleft_vmode {\setfalse\displaylefttoright \setfalse\inlinelefttoright \textdir TRT\relax \pardir TRT\relax} -\unexpanded\def\spac_directions_righttoleft_hmode - {\textdir TRT\relax - \setfalse\inlinelefttoright} +\newconditional\c_spac_auto_line_dir \settrue\c_spac_auto_line_dir + +\ifdefined\linedir + + \unexpanded\def\spac_directions_lefttoright_hmode + {\ifconditional\c_spac_auto_line_dir\linedir\else\textdir\fi TLT\relax % linedir keeps subtype + \setfalse\inlinerighttoleft} + + \unexpanded\def\spac_directions_righttoleft_hmode + {\ifconditional\c_spac_auto_line_dir\linedir\else\textdir\fi TRT\relax % linedir keeps subtype + \setfalse\inlinelefttoright} + +\else % keep this as reference + + \unexpanded\def\spac_directions_lefttoright_hmode + {\settrue\inlinelefttoright + \textdir TLT\relax} + + \unexpanded\def\spac_directions_righttoleft_hmode + {\textdir TRT\relax + \setfalse\inlinelefttoright} + + \unexpanded\def\spac_directions_lefttoright_hmode + {\ifconditional\c_spac_auto_line_dir + \ifzeropt\lastskip + \linedir TLT\relax + \else + \scratchskip\lastskip + \unskip + \linedir TLT\relax + \hskip\scratchskip + \fi + \else + \textdir TLT\relax + \fi + \setfalse\inlinerighttoleft} + + \unexpanded\def\spac_directions_righttoleft_hmode + {\ifconditional\c_spac_auto_line_dir + \ifzeropt\lastskip + \linedir TRT\relax + \else + \scratchskip\lastskip + \unskip + \linedir TRT\relax + \hskip\scratchskip + \fi + \else + \textdir TRT\relax + \fi + \setfalse\inlinelefttoright} + +\fi % \def\currentdirectionparameters % {\ifconditional\inlinelefttoright \else @@ -291,6 +337,7 @@ \newconstant\c_spac_align_state_par_fill \def\v_spac_align_fill_amount {\plusone fil} +\def\v_spac_align_fill_amount_hard {\plusone fill} \def\v_spac_align_fill_amount_negative {\minusone fil} \def\v_spac_align_fill_amount_double {\plustwo fil} \def\v_spac_align_fill_amount_space {\plustwo fil} % can be added to xspace if we have a key @@ -406,6 +453,18 @@ \parindent \zeropoint \relax} +\unexpanded\def\spac_align_set_horizontal_flushedright_last_line + {\raggedstatus\zerocount + \attribute\alignstateattribute\attributeunsetvalue + \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax + \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax + \spaceskip \zeropoint\relax + \xspaceskip \zeropoint\relax + \parfillskip \zeropoint + \parfillleftskip\zeropoint\s!plus\v_spac_align_fill_amount_hard\relax + \parindent \zeropoint + \relax} + \unexpanded\def\spac_align_set_horizontal_right_tt % a plain command {\tttf % brrr \raggedstatus\plusthree @@ -472,6 +531,10 @@ % 7 centered last line \spac_align_set_horizontal_centered_last_line \or + % 8 right aligned last line + \spac_align_set_horizontal_flushedright_last_line + \or + % 9 paragraph \parfillskip\zeropoint \fi \relax} @@ -694,7 +757,8 @@ \c_spac_align_state_broad \plustwo } \setvalue{\??aligncommand\v!disable }{\c_spac_align_state_horizontal\plussix } \setvalue{\??aligncommand\v!last }{\c_spac_align_state_horizontal\plusseven} -\setvalue{\??aligncommand\v!paragraph }{\c_spac_align_state_horizontal\pluseight} +\setvalue{\??aligncommand\v!end }{\c_spac_align_state_horizontal\pluseight} +\setvalue{\??aligncommand\v!paragraph }{\c_spac_align_state_horizontal\plusnine} \setvalue{\??aligncommand\v!lefttoright }{\c_spac_align_state_direction \plusone } @@ -758,18 +822,19 @@ % Visible commands: -\let\notragged \spac_align_set_horizontal_none -\let\raggedleft \spac_align_set_horizontal_left -\let\raggedcenter \spac_align_set_horizontal_center -\let\raggedright \spac_align_set_horizontal_right -\let\veryraggedleft \spac_align_set_horizontal_very_left -\let\veryraggedcenter\spac_align_set_horizontal_very_center -\let\veryraggedright \spac_align_set_horizontal_very_right -\let\raggedwidecenter\spac_align_set_horizontal_wide_center -\let\centeredlastline\spac_align_set_horizontal_centered_last_line -\let\ttraggedright \spac_align_set_horizontal_right_tt % a plain command - -\let\forgetragged \spac_align_set_horizontal_none +\let\notragged \spac_align_set_horizontal_none +\let\raggedleft \spac_align_set_horizontal_left +\let\raggedcenter \spac_align_set_horizontal_center +\let\raggedright \spac_align_set_horizontal_right +\let\veryraggedleft \spac_align_set_horizontal_very_left +\let\veryraggedcenter \spac_align_set_horizontal_very_center +\let\veryraggedright \spac_align_set_horizontal_very_right +\let\raggedwidecenter \spac_align_set_horizontal_wide_center +\let\centeredlastline \spac_align_set_horizontal_centered_last_line +\let\flushedrightlastline\spac_align_set_horizontal_flushedright_last_line +\let\ttraggedright \spac_align_set_horizontal_right_tt % a plain command + +\let\forgetragged \spac_align_set_horizontal_none \appendtoks \spac_align_set_horizontal_none diff --git a/tex/context/base/mkiv/spac-hor.mkiv b/tex/context/base/mkiv/spac-hor.mkiv index 38ba7281e..7a275989a 100644 --- a/tex/context/base/mkiv/spac-hor.mkiv +++ b/tex/context/base/mkiv/spac-hor.mkiv @@ -17,6 +17,9 @@ \registerctxluafile{spac-hor}{1.001} +\let \parfillrightskip \parfillskip +\newskip\parfillleftskip + \let\v_spac_indentation_current\empty % amount/keyword \newdimen \d_spac_indentation_par diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex a80440c2f..f2ccf0e16 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex aaf80482e..6dcc8bb8b 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-mat.mkiv b/tex/context/base/mkiv/strc-mat.mkiv index c1b5c5824..0fb609e45 100644 --- a/tex/context/base/mkiv/strc-mat.mkiv +++ b/tex/context/base/mkiv/strc-mat.mkiv @@ -735,7 +735,9 @@ \d_strc_formulas_display_margin_left \formulaparameter\c!leftmargin \relax \d_strc_formulas_display_margin_right\formulaparameter\c!rightmargin\relax \edef\p_option{\formulaparameter\c!option}% - \edef\p_option{\ifx\p_option\empty\else\p_option,\fi#2}% + \ifsecondargument + \edef\p_option{\ifx\p_option\empty\else\p_option,\fi#2}% + \fi \ifx\p_option\empty \else \rawprocesscommacommand[\p_option]\strc_formulas_option \fi diff --git a/tex/context/base/mkiv/typo-bld.lua b/tex/context/base/mkiv/typo-bld.lua index ce6a65baf..3f9d4429a 100644 --- a/tex/context/base/mkiv/typo-bld.lua +++ b/tex/context/base/mkiv/typo-bld.lua @@ -183,8 +183,6 @@ end) nodes.builders = nodes.builder or { } local builders = nodes.builders -local normalize = typesetters.paragraphs.normalize - local vboxactions = nodes.tasks.actions("vboxbuilders") function builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction) diff --git a/tex/context/base/mkiv/typo-lin.lua b/tex/context/base/mkiv/typo-lin.lua index 37fff48f7..10d83661e 100644 --- a/tex/context/base/mkiv/typo-lin.lua +++ b/tex/context/base/mkiv/typo-lin.lua @@ -77,6 +77,7 @@ local traverse_id = nuts.traverse_id local insert_before = nuts.insert_before local insert_after = nuts.insert_after local find_tail = nuts.tail +local rehpack = nuts.rehpack ----- remove_node = nuts.remove local getsubtype = nuts.getsubtype @@ -93,6 +94,8 @@ local setprop = nuts.setprop local getprop = nuts.rawprop -- getprop local effectiveglue = nuts.effective_glue +local n_is_zero_glue = nodes.is_zero_glue +local n_getglue = nodes.getglue local nodepool = nuts.pool local new_kern = nodepool.kern @@ -100,8 +103,10 @@ local new_leftskip = nodepool.leftskip local new_rightskip = nodepool.rightskip local new_hlist = nodepool.hlist local new_rule = nodepool.rule +local new_glue = nodepool.glue local texgetcount = tex.getcount +local texgetskip = tex.getskip local setmetatableindex = table.setmetatableindex local formatters = string.formatters @@ -238,9 +243,47 @@ function paragraphs.normalize(head,islocal) -- can be an option, maybe we need a proper state in lua itself ... is this check still needed? return head, false end + -- this can become a separate handler but it makes sense to integrate it here + local parfillleftskip = texgetskip("parfillleftskip") + if not n_is_zero_glue(parfillleftskip) then + local last = nil -- a nut + local done = false + for line in traverse_id(hlist_code,tonut(head)) do + if getsubtype(line) == line_code and not getprop(line,"line") then + if done then + last = line + else + done = true + end + end + end + if last then -- only if we have more than one line + local head = getlist(last) + local current = head + if current then + if getid(current) == glue_code and getsubtype(current,leftskip_code) then + current = getnext(current) + end + if current then + head, current = insert_before(head,current,new_glue(n_getglue(parfillleftskip))) + if head == current then + setlist(last,head) + end + -- can be a 'rehpack(h )' + rehpack(last) + end + end + end + end + -- normalizer for line in traverse_id(hlist_code,tonut(head)) do if getsubtype(line) == line_code and not getprop(line,"line") then normalize(line) + if done then + last = line + else + done = true + end end end return head, true diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua index fb03b23ea..9089c8212 100644 --- a/tex/context/base/mkiv/typo-mar.lua +++ b/tex/context/base/mkiv/typo-mar.lua @@ -521,7 +521,7 @@ local function inject(parent,head,candidate) stackname = validstacknames[stackname] or location end local isstacked = stack == v_continue or stack == v_yes - local offset = stack and stack ~= "" and stacked[stack][stackname] + local offset = isstacked and stacked[stack][stackname] local firstonstack = offset == false or offset == nil nofinjected = nofinjected + 1 nofdelayed = nofdelayed + 1 diff --git a/tex/context/interface/mkiv/i-align.xml b/tex/context/interface/mkiv/i-align.xml index 07a66d2dd..d8b75a463 100644 --- a/tex/context/interface/mkiv/i-align.xml +++ b/tex/context/interface/mkiv/i-align.xml @@ -32,6 +32,7 @@ <cd:constant type="center"/> <cd:constant type="disable"/> <cd:constant type="last"/> + <cd:constant type="end"/> <cd:constant type="paragraph"/> <cd:constant type="lefttoright"/> <cd:constant type="righttoleft"/> @@ -242,6 +243,8 @@ <cd:command name="centeredlastline" file="spac-ali.mkiv"/> + <cd:command name="flushedrightlastline" file="spac-ali.mkiv"/> + <cd:command name="ttraggedright" file="spac-ali.mkiv"/> <cd:command name="forgetragged" file="spac-ali.mkiv"/> diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 983426585..98c62a2bf 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 01be29580..624380cec 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 350d3cf9b..6f96d9740 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 : 06/10/16 23:51:36 +-- merge date : 06/13/16 17:00:29 do -- begin closure to overcome local limits and interference @@ -8802,17 +8802,17 @@ function readers.glyf(f,fontdata,specification) end end function readers.colr(f,fontdata,specification) - if specification.details then + if specification.glyphs then reportskippedtable("colr") end end function readers.cpal(f,fontdata,specification) - if specification.details then + if specification.glyphs then reportskippedtable("cpal") end end function readers.svg(f,fontdata,specification) - if specification.details then + if specification.glyphs then reportskippedtable("svg") end end @@ -9283,6 +9283,7 @@ function readers.loadfont(filename,n) properties={ hasitalics=fontdata.hasitalics or false, maxcolorclass=fontdata.maxcolorclass, + hascolor=fontdata.hascolor or false, }, resources={ filename=filename, @@ -13169,9 +13170,9 @@ function readers.math(f,fontdata,specification) end end function readers.colr(f,fontdata,specification) - if specification.details then - local datatable=fontdata.tables.colr - if datatable then + local datatable=fontdata.tables.colr + if datatable then + if specification.glyphs then local tableoffset=datatable.offset setposition(f,tableoffset) local version=readushort(f) @@ -13218,10 +13219,11 @@ function readers.colr(f,fontdata,specification) glyphs[glyphindex].colors=t end end + fontdata.hascolor=true end end function readers.cpal(f,fontdata,specification) - if specification.details then + if specification.glyphs then local datatable=fontdata.tables.cpal if datatable then local tableoffset=datatable.offset @@ -13265,9 +13267,9 @@ function readers.cpal(f,fontdata,specification) end end function readers.svg(f,fontdata,specification) - if specification.details then - local datatable=fontdata.tables.svg - if datatable then + local datatable=fontdata.tables.svg + if datatable then + if specification.glyphs then local tableoffset=datatable.offset setposition(f,tableoffset) local version=readushort(f) @@ -13300,6 +13302,7 @@ function readers.svg(f,fontdata,specification) end fontdata.svgshapes=entries end + fontdata.hascolor=true end end |