getLineWidth method

double getLineWidth(
  1. String line,
  2. int charCount
)

Implementation

double getLineWidth(String line, int charCount) {
  return textRenderer
      .getLineMetrics(
        line.substring(0, math.min(charCount, line.length)),
      )
      .width;
}