File: create_caret_encoding.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (26 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#  Copyright (c) 2020, Manfred Moitzi
#  License: MIT License

import ezdxf

doc = ezdxf.new()
msp = doc.modelspace()

width = 40
height = 4

for i in range(26):
    c = chr(ord("a") + i)
    msp.add_mtext(f"{c}: abc^{c}def", {"insert": (0, -i * height, 0)})

for i in range(26):
    c = chr(ord("A") + i)
    msp.add_mtext(f"{c}: abc^{c}def", {"insert": (width, -i * height, 0)})

for i, c in enumerate(["?", "@", "[", "]", "\\", "_", " "]):
    msp.add_mtext(f"{c}: abc^{c}def", {"insert": (2 * width, -i * height, 0)})

msp.add_mtext(f"^ : abc^^def", {"insert": (2 * width, -(i + 1) * height, 0)})
msp.add_mtext("^", {"insert": (2 * width, -(i + 2) * height, 0)})

doc.saveas("caret_encoding.dxf")