0
votes

I am trying to figure out a way to create canvas element with variable width but min-width: 500px; that renders a list of strings of unknown length containing long strings that can be at most 300 pixels wide. I have seen a way to break up long strings and a way to determine the size of text, but I am looking for a way to combine these two into a function that takes as input the width of the canvas and the list of strings and returns a canvas element containing a left justified list of the strings that are word-break: break-word;. My research shows there is no easier way to get such a canvas element, but I would be delighted to be wrong.