コード例 #1
0
def text2():
    return Text.new(dxfattribs={
        'text': 'TEXT',
        'height': 1.0,
        'width': 1.0,
        'rotation': 0,
        'layer': 'text',
    }).set_pos((0, 0, 0), align='LEFT')
コード例 #2
0
def text2():
    return Text.new(
        dxfattribs={
            "text": "TEXT",
            "height": 1.0,
            "width": 1.0,
            "rotation": 0,
            "layer": "text",
        }).set_placement((0, 0, 0), align=TextEntityAlignment.LEFT)
コード例 #3
0
def test_plain_text():
    assert plain_text('%%d') == '°'
    # underline
    assert plain_text('%%u') == ''
    assert plain_text('%%utext%%u') == 'text'
    # single %
    assert plain_text('%u%d%') == '%u%d%'
    t = Text.new(dxfattribs={'text': '45%%d'})
    assert t.plain_text() == '45°'
コード例 #4
0
def test_text_to_code():
    from ezdxf.entities.text import Text
    entity = Text.new(handle='ABBA', owner='0', dxfattribs={
        'color': '7',
        'text': 'xyz',
        'insert': (2, 3, 4),
    })
    new_entity = translate_to_code_and_execute(entity)
    for name in ('color', 'text', 'insert'):
        assert new_entity.get_dxf_attrib(name) == entity.get_dxf_attrib(name)
コード例 #5
0
def test_text_to_code():
    from ezdxf.entities.text import Text

    entity = Text.new(
        handle="ABBA",
        owner="0",
        dxfattribs={
            "color": "7",
            "text": "xyz",
            "insert": (2, 3, 4),
        },
    )
    new_entity = translate_to_code_and_execute(entity)
    for name in ("color", "text", "insert"):
        assert new_entity.get_dxf_attrib(name) == entity.get_dxf_attrib(name)
コード例 #6
0
def text():
    return Text.new(handle="ABBA", owner="0")
コード例 #7
0
def text():
    return Text.new(handle='ABBA', owner='0')