2021-05-11 21:35:44 +00:00
|
|
|
import pixie
|
|
|
|
|
|
|
|
let image = newImage(200, 200)
|
|
|
|
image.fill(rgba(255, 255, 255, 255))
|
|
|
|
|
2021-09-07 23:46:55 +00:00
|
|
|
var font = readFont("examples/data/Roboto-Regular_1.ttf")
|
2021-05-11 21:35:44 +00:00
|
|
|
font.size = 20
|
2023-10-03 00:56:49 +00:00
|
|
|
font.paint.color = color(1, 0, 0)
|
2021-05-11 21:35:44 +00:00
|
|
|
|
|
|
|
let text = "Typesetting is the arrangement and composition of text in graphic design and publishing in both digital and traditional medias."
|
|
|
|
|
2021-08-17 20:23:01 +00:00
|
|
|
image.fillText(font.typeset(text, vec2(180, 180)), translate(vec2(10, 10)))
|
2021-05-11 21:35:44 +00:00
|
|
|
image.writeFile("examples/text.png")
|