q5play
    Preparing search index...

    Function textDescent

    • 📘 Calculates and returns the descent (the distance from the baseline to the bottom of the lowest character) of the current font.

      Parameters

      • str: string

        string to measure

      Returns number

      descent of the text in pixels

      await Canvas(200);
      background(0.8);
      textSize(64);

      rect(-100, 0, 200, textDescent('q5'));
      text('q5', -90, 0);