Draws text on the image using a TrueType font.
text(string, x:, y:, size:, color:, font:)
string: UTF-8 text to renderx, y: Baseline position (y is the text baseline, not the top)size: Font size in pointscolor: Color allocated via image.color / GD.rgbafont: Path to a .ttf font fileimg = GD::Image.new(400,200)
black = img.color(0,0,0)
img.text(
"Hello Ruby",
x: 20, y: 100,
size: 24,
color: black,
font: "./fonts/DejaVuSans.ttf"
)
img.save("text.png")
y (baseline) and/or add padding around the canvas.