[NTG-context] Font expansion enabled by default with the latest upload

Max Chernoff mseven at telus.net
Mon Nov 21 23:46:32 CET 2022


Hi Hans,

> what you observe is likely a side effect of an increase in accuracy 
> which gives a bit less drift in the pdf; expansion is turned off (it 
> would increase runtime if turned on)

It's not just in the PDF though, I can also see the change from Lua.

Using this document:

   \showframe
   
   % \definefontfeature[default][default][expansion=quality]
   % \usetypescript[modern-base]
   % \setupbodyfont[reset,modern]
   % \setupalign[hz]
   
   \startluacode
       function userdata.test(head)
           local last_line = node.tail(head)
           local i = 1
           for n in node.traverse(node.tail(last_line.list), true) do
               print(n)
               if n.id == node.id("glue") then
                   print(node.effectiveglue(n, last_line) / 65536)
               elseif n.width then
                   print(n.width / 65536)
               end
   
               if i >= 6 then
                   break
               else
                   i = i + 1
               end
           end
   
           return head
       end
   
       nodes.tasks.appendaction("finalizers", "after", "userdata.test")
       nodes.tasks.enableaction("finalizers", "userdata.test")
   \stopluacode
   
   \starttext
       Hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello hello hello hello hello hello hello hello hello hello
       hello hello hello.%
       \ctxlua{nodes.tasks.enableaction("finalizers", "userdata.test")}
   
       \ctxlua{nodes.tasks.disableaction("finalizers", "userdata.test")}
   \stoptext

(A) With the expansion lines commented/default on ConTeXt "2022.11.18
13:22" I get:

   <node :  13263 <=  13299 =>    nil : glue righthangskip>
   0.0
   <node :  12877 <=  13263 =>  13299 : glue rightskip>
   0.0
   <node :   1687 <=  12877 =>  13263 : glue parfillskip>
   0.0
   <node :  12850 <=   1687 =>  12877 : penalty linepenalty>
   <node :  12837 <=  12850 =>   1687 : glyph unset>
   3.3341674804688
   <node :  12824 <=  12837 =>  12850 : glyph unset>
   5.9967041015625
   
(B) With the expansion lines uncommented/enabled on ConTeXt "2022.11.18
13:22" I get:

   <node :  13956 <=  13992 =>    nil : glue righthangskip>
   0.0
   <node :  12877 <=  13956 =>  13992 : glue rightskip>
   0.0
   <node :   1687 <=  12877 =>  13956 : glue parfillskip>
   0.046096801757812
   <node :  12850 <=   1687 =>  12877 : penalty linepenalty>
   <node :  12837 <=  12850 =>   1687 : glyph unset>
   3.3341674804688
   <node :  12824 <=  12837 =>  12850 : glyph unset>
   5.9967041015625
   
(C) With the expansion lines commented/default live.contextgarden.net I
get:

   <node :  10909 <=  10943 =>    nil : glue righthangskip>
   0.0
   <node :  10138 <=  10909 =>  10943 : glue rightskip>
   0.0
   <node :    524 <=  10138 =>  10909 : glue parfillskip>
   6.6463470458984
   <node :  10119 <=    524 =>  10138 : penalty linepenalty>
   <node :  10107 <=  10119 =>    524 : glyph 32768>
   3.26220703125
   <node :  10095 <=  10107 =>  10119 : glyph 32768>
   5.8767700195312

(D) And with the expansion lines uncommented/enabled on
live.contextgarden.net I get:

   <node :  11161 <=  11195 =>    nil : glue righthangskip>
   0.0
   <node :  10138 <=  11161 =>  11195 : glue rightskip>
   0.0
   <node :    524 <=  10138 =>  11161 : glue parfillskip>
   0.046096801757812
   <node :  10119 <=    524 =>  10138 : penalty linepenalty>
   <node :  10107 <=  10119 =>    524 : glyph 32768>
   3.3341674804688
   <node :  10095 <=  10107 =>  10119 : glyph 32768>
   5.9967041015625

A, B, and D all have almost the same \parfillskip widths, and the exact
same "." and "o" widths. But comparing A/B/D to C, there's a 6.6pt
difference in the \parfillskip values and a 0.12pt difference between
the "o" widths.

Maybe it's just a coincidence, but it seems odd that enabling expansion
makes no difference with the latest version (A/B) and that latest with
no expansion (A) gives identical results to the old version with
expansion (D). Plus, a 6.6pt difference in glue lengths seems like a lot
for an accuracy change.

I could very easily be wrong here, but something seems off to me.

Thanks,
-- Max


More information about the ntg-context mailing list