Skip to content

Troubleshooting#

If something goes wrong, you have the following possibilities:

Setting the log level#

The default log level is set to “info”. You can set this to one of “debug”, “info”, “warn” or “error” for more (or less) information. See the logging section.

The debug log level tries to give much more information about loaded languages, fonts and images.

Visual tracing#

Use f.Doc.SetVTrace(document.VTraceHBoxes) for visual tracing

text lines with boxes around

Showing the internal data#

Text data#

para := frontend.NewText()
fmt.Println(frontend.DebugText(para))

gives you an XML representation of the nested Text data structure. In the most simple form:

<text>In olden times when [...] and this ball was her favorite plaything.</text>

Nodes are the most low-level data structure in boxes and glue. To really find out what is placed on the page, you can analyze the node lists by calling:

Node list#

node.Debug(vlist)

which prints to os.Stdout an XML representation of the node structure:

<vlist id="761" wd="125" ht="336" dp="0">
    <hlist id="759" wd="125" ht="9.68" dp="2.32" r="3.6892684189687204" origin="line">
        <glue id="758" wd="0" stretch="0" stretchorder="0" shrink="0" shrinkorder="0" subtype="0"></glue>
        <glyph id="0" components="I" wd="3.63" ht="9.68" dp="2.32" codepoint="81" face="0"></glyph>
        <glyph id="1" components="n" wd="6.44" ht="9.68" dp="2.32" codepoint="351" face="0"></glyph>
        <glue id="2" wd="11.39" stretch="2" stretchorder="0" shrink="1.33" shrinkorder="0" subtype="0"></glue>
        <glyph id="3" components="o" wd="5.95" ht="9.68" dp="2.32" codepoint="362" face="0"></glyph>
        <glyph id="4" components="l" wd="3.15" ht="9.68" dp="2.32" codepoint="340" face="0"></glyph>
        <glyph id="5" components="d" wd="6.31" ht="9.68" dp="2.32" codepoint="273" face="0"></glyph>
        <glyph id="6" components="e" wd="5.27" ht="9.68" dp="2.32" codepoint="280" face="0"></glyph>
        <glyph id="7" components="n" wd="6.44" ht="9.68" dp="2.32" codepoint="351" face="0"></glyph>
        <glue id="8" wd="11.39" stretch="2" stretchorder="0" shrink="1.33" shrinkorder="0" subtype="0"></glue>
        ...
    </hlist>
    <glue id="668" wd="2" stretch="0" stretchorder="0" shrink="0" shrinkorder="0" subtype="0" origin="lineskip"></glue>
    <hlist id="667" wd="125" ht="9.68" dp="2.32" r="35.22781719691768" origin="line">
        [...]
        <glue id="626" wd="4" stretch="2" stretchorder="0" shrink="1.33" shrinkorder="0" subtype="0"></glue>
        <glyph id="627" components="p" wd="6.28" ht="9.68" dp="2.32" codepoint="397" face="0"></glyph>
        <glyph id="628" components="l" wd="3.15" ht="9.68" dp="2.32" codepoint="340" face="0"></glyph>
        <glyph id="629" components="a" wd="5.55" ht="9.68" dp="2.32" codepoint="237" face="0"></glyph>
        <kern id="630" kern="-0.06"></kern>
        <glyph id="631" components="y" wd="5.52" ht="9.68" dp="2.32" codepoint="458" face="0"></glyph>
        <kern id="632" kern="0.05"></kern>
        <glyph id="633" components="t" wd="3.97" ht="9.68" dp="2.32" codepoint="420" face="0"></glyph>
        <glyph id="634" components="h" wd="6.44" ht="9.68" dp="2.32" codepoint="312" face="0"></glyph>
        <glyph id="635" components="i" wd="3.14" ht="9.68" dp="2.32" codepoint="317" face="0"></glyph>
        <glyph id="636" components="n" wd="6.44" ht="9.68" dp="2.32" codepoint="351" face="0"></glyph>
        <glyph id="637" components="g" wd="5.79" ht="9.68" dp="2.32" codepoint="305" face="0"></glyph>
        <kern id="638" kern="-0.18"></kern>
        <glyph id="639" components="." wd="2.74" ht="9.68" dp="2.32" codepoint="577" face="0"></glyph>
        <penalty id="660" penalty="10000" width="0"></penalty>
        <glue id="661" wd="35.23" stretch="1" stretchorder="1" shrink="0" shrinkorder="0" subtype="0"></glue>
        <glue id="665" wd="0" stretch="0" stretchorder="0" shrink="0" shrinkorder="0" subtype="0"></glue>
    </hlist>
    <glue id="760" wd="2" stretch="0" stretchorder="0" shrink="0" shrinkorder="0" subtype="0" origin="last lineskip"></glue>
</vlist>

Asking for help#

You can head to the discussion page of boxes and glue and ask questions there. Don't hesitate: the author is always glad to help!