Exemplo n.º 1
0
def numbered_list(msp, location):
    attribs = dict(ATTRIBS)
    attribs["char_height"] = 0.25
    attribs["width"] = 7.5
    # There are no special commands to build numbered list, the list is build of
    # indentation and a tabulator stop. There is no automatic numbering,
    # but therefore the absolute freedom for using any string as list marker:
    editor = MTextEditor("Numbered List:" + NP)
    editor.bullet_list(indent=1,
                       bullets=["1.", "2.", "3."],
                       content=[
                           "First item",
                           "Second item",
                           " ".join(lorem_ipsum(30)),
                       ])
    # Indentation and tab stops are multiples of the default text height (MTEXT
    # char_height)!
    msp.add_mtext(str(editor), attribs).set_location(insert=location)
Exemplo n.º 2
0
def bullet_list(msp, location):
    attribs = dict(ATTRIBS)
    attribs["char_height"] = 0.25
    attribs["width"] = 7.5
    # There are no special commands to build bullet list, the list is build of
    # indentation and a tabulator stop. Each list item needs a marker as an
    # arbitrary string.
    bullet = "•"  # alt + numpad 7
    editor = MTextEditor("Bullet List:" + NP)
    editor.bullet_list(
        indent=1,
        bullets=[bullet] * 3,  # each list item needs a marker
        content=[
            "First item",
            "Second item",
            " ".join(lorem_ipsum(30)),
        ])
    msp.add_mtext(str(editor), attribs).set_location(insert=location)