This page is work-in-progress. You can reach me on twitter or mail to


Fill word-wrapped text

.wrappedText(text, x, y, maxWidth, lineHeight);
var layer = cq(800, 300).appendTo(document.body);

layer.font("32px Arial");
layer.fillStyle("#fff").wrappedText("Wrapping text and splitting very long words like PSEUDOPSEUDOHYPOPARATHYROIDISM", 32, 32, 200)

lineHeight is fontHeight by default

Have any questions? Don't hesitate to ask:

Post issues on github, support my work on gratipay author rezoner