title: How do you tell whether text fits within its bounding shape?
body: <p>I am doing a merge of data from a google spreadsheet to a slides presentation using placeholder shapes and apps script, something along the lines of <a href="https://developers.google.com/slides/how-tos/merge" rel="noreferrer">this example</a>.</p>
  <p>I have the merge working well. The first issue I am having though is that the text is not bound by the shape that contains it. If the text does not fit within the bounding shape it simply overflows:</p>
  <p><img src="https://i.stack.imgur.com/tks7s.png" alt="text overflowing boundaries of textbox" /></p>
  <p>That wouldn't be such a problem if I could then somehow tell programmatically that the text has overflowed. As far as I can tell though I can only get the <a href="https://developers.google.com/apps-script/reference/slides/shape#getHeight()" rel="noreferrer">height of the bounding shape</a>. Which doesn't change even though it now &quot;contains&quot; text that covers a much greater height on the slide. I don't seem to be able to get the height of the actual text.</p>
  <p>Is there any way to tell what the height of the <a href="https://developers.google.com/apps-script/reference/slides/text-range" rel="noreferrer">textrange</a> is, or that it has overflowed, so that I can then either adjust some feature of the text (the font size, or the length of the actual text, etc) so that the text is bound by the textbox? Or at least alert the user that the text has overflowed.</p>
  <p>The PowerPoint equivalent of this would be <a href="https://docs.microsoft.com/en-us/office/vba/api/powerpoint.textrange.boundheight" rel="noreferrer">textrange.boundheight</a> if that helps describe the property I am looking for, with a similar property I would then hopefully be able to implement something similar to the <a href="https://docs.microsoft.com/en-us/office/vba/api/powerpoint.textframe2.autosize" rel="noreferrer">AutoSize</a> feature.</p>
  <p>The merge of text to a slide without some way to fit the text to the placeholder shapes doesn't seem that useful to me.</p>