File: unicodeengine.py

package info (click to toggle)
pyx3 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: python: 27,656; makefile: 225; ansic: 130; sh: 17
file content (16 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from pyx import *

text.set(text.UnicodeEngine)

c = canvas.canvas()
c.text(0, 2, "Hello, world!")

# We support basic primitives for math typesetting of numbers.
c.text(0, 1, ["a large value: 10", text.Text("100", shift=0.5, scale=0.8)])
c.text(0, 0, ["a fraction: ", text.StackedText([text.Text("1", shift=0.3),
                                                text.Text("42", shift=-0.9)],
                                               frac=True, align=0.5)])

c.writeEPSfile()
c.writePDFfile()
c.writeSVGfile()