I'm using pdfkit to generate text where syllables are differently colored. I'm having an issue avoiding line breaks in the middle of a word because I call .text() each time I want to change color. Is it possible to make those 2 calls unbreakable?
You can test if you put this code in https://pdfkit.org/examples/browserify/browser.html
var doc = new PDFDocument(); var stream = doc.pipe(blobStream()); doc.fontSize(25) .text("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", {continued: true}) .text("bb", {continued:true}) .fillColor("red") .text("b", {continued: true}) doc.end(); stream.on('finish', function() { iframe.src = stream.toBlobURL('application/pdf'); }); As you can see, I need the multiple b's to be one word but with different colors, and it breaks
Is there a way to avoid the break?