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')
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)
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°'
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)
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)
def text(): return Text.new(handle="ABBA", owner="0")
def text(): return Text.new(handle='ABBA', owner='0')