title: Jetpack Compose: Use different layout if text does not fit?
body: <p>Say I have a fixed size rectangle with some text inside. Since the user can change the font size from the System - Accessibility settings on the device, the font might not fit inside the fixed sized rectangle. If this happen, we would like to render the text outside the rectangle instead.</p>
  <p>AFAIK I should somehow measure the text's width (for example) and see if it fits inside the rectangle and if not, layout the components in a different manner.</p>
  <p>How would I do this in Jetpack Compose?</p>
  <p>So with this pseudo code, if <code>text</code> does not fit inside the <code>Box</code> I would like to lay out the text below it, thus introducing a <code>Column</code> etc instead.</p>
  <pre><code>@Composable
  fun myView() {
    val text = Text(&quot;Some text&quot;)
    Box(modifier = Modifier.size(40.dp)) {
        text
    }
  }
  </code></pre>