A quick way to layout & render HTML rich text to canvas
As we know, the canvas fillText API can only draw a single line of text. If we want to draw multiple lines of text, or we want to draw a line of text with different kinds of styles and font sizes, we’ll need to find a way to layout all the text blocks. That is, try to figure out where to put the text and get the x and y parameters for the fillText API....