Hi, gdad-s-river!
First off, huge kudos to you for starting something really awesome. I am really excited to see where you take it! :)
getBoundingClientRect() is a method which you can apply on a DOM element; to get a corresponding DOMRect object (representing that particular DOM element) with eight properties: left, top, right, bottom, x, y, width, height. You can read the documentation on MDN for more info.
Coming to your question; assuming each line is a content block; you can use the getBoundingClientRect() method on the DOM elements which respectively represent the content blocks in the DraftJS editor instance; information from the corresponding DOMRect objects can be compared to find the content block (DOM element) with the longest width.
More information on how to calculate the bounding rect of the DOM element which represents a particular DraftJS content block, as mentioned above, can be found in the following post 👇
Once you zero in on the content block with the longest width, you can use DraftJS' getText() method (draftjs.org/docs/api-reference-content-block.html) on that particular content block, and find the length of the string to calculate the desired result.
Let me know if that helps! :)