Ejemplo n.º 1
0
def drawCode(canvas, code):
    """Draws a block of text at current point, indented and in Courier"""
    canvas.addLiteral("36 0 Td")
    canvas.setFillColor(colors.blue)
    canvas.setFont("Courier", 10)

    t = canvas.beginText()
    t.textLines(code)
    c.drawText(t)

    canvas.setFillColor(colors.black)
    canvas.addLiteral("-36 0 Td")
    canvas.setFont("Times-Roman", 10)
Ejemplo n.º 2
0
def drawCode(canvas, code):
    """Draws a block of text at current point, indented and in Courier"""
    canvas.addLiteral('36 0 Td')
    canvas.setFillColor(colors.blue)
    canvas.setFont('Courier', 10)

    t = canvas.beginText()
    t.textLines(code)
    c.drawText(t)

    canvas.setFillColor(colors.black)
    canvas.addLiteral('-36 0 Td')
    canvas.setFont('Times-Roman', 10)