1local canvas
2
3function sk_scrape_startcanvas(c, fileName)
4    canvas = c
5end
6
7function sk_scrape_endcanvas(c, fileName)
8    canvas = nil
9end
10
11local glyph_calls = 0
12local unichar_calls = 0
13
14local isTextVerbs = {
15    drawPosText = true,
16    drawPosTextH = true,
17    drawText = true,
18    drawTextOnPath = true,
19}
20
21function sk_scrape_accumulate(t)
22    if isTextVerbs[t.verb] then
23        if t.glyphs then
24            glyph_calls = glyph_calls + 1
25        else
26            unichar_calls = unichar_calls + 1
27        end
28    end
29end
30
31function sk_scrape_summarize()
32    io.write("glyph calls = ", glyph_calls,
33             ", unichar calls = ", unichar_calls, "\n");
34end
35
36