private void drawTextWithFont(DocumentData documentData, Font font, Canvas canvas, int parentAlpha) {
    Typeface typeface = getTypeface(font);
    if (typeface == null) {
      return;
    }
    String text = documentData.text;
    TextDelegate textDelegate = lottieDrawable.getTextDelegate();
    if (textDelegate != null) {
      text = textDelegate.getTextInternal(getName(), text);
    }
    fillPaint.setTypeface(typeface);
    float textSize;
    if (textSizeCallbackAnimation != null) {
      textSize = textSizeCallbackAnimation.getValue();
    } else {
      textSize = documentData.size;
    }
    fillPaint.setTextSize(textSize * Utils.dpScale());
    strokePaint.setTypeface(fillPaint.getTypeface());
    strokePaint.setTextSize(fillPaint.getTextSize());

    // Calculate tracking
    float tracking = documentData.tracking / 10f;
    if (trackingCallbackAnimation != null) {
      tracking += trackingCallbackAnimation.getValue();
    } else if (trackingAnimation != null) {
      tracking += trackingAnimation.getValue();
    }
    tracking = tracking * Utils.dpScale() * textSize / 100.0f;

    // Split full text in multiple lines
    List<String> textLines = getTextLines(text);
    int textLineCount = textLines.size();
    int lineIndex = -1;
    int characterIndexAtStartOfLine = 0;
    for (int i = 0; i < textLineCount; i++) {
      String textLine = textLines.get(i);
      float boxWidth = documentData.boxSize == null ? 0f : documentData.boxSize.x;
      List<TextSubLine> lines = splitGlyphTextIntoLines(textLine, boxWidth, font, 0f, tracking, false);
      for (int j = 0; j < lines.size(); j++) {
        TextSubLine line = lines.get(j);
        lineIndex++;

        canvas.save();

        float lineWidth =
            (textAnimation == null &&
                textSizeCallbackAnimation == null &&
                trackingCallbackAnimation == null) ?
                line.width :
                fillPaint.measureText(line.text);
        if (offsetCanvas(canvas, documentData, lineIndex, lineWidth)) {
          drawFontTextLine(line.text, documentData, canvas, tracking, characterIndexAtStartOfLine, parentAlpha);
        }

        characterIndexAtStartOfLine += line.text.length();

        canvas.restore();
      }
    }
  }
Configures the [fillPaint] and [strokePaint] used for drawing based on currently active text ranges.

@param parentAlpha A value from 0 to 255 indicating the alpha of the parented layer.
lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java