public static int getContentLeft(Layout layout) {
    if (layout == null || layout.getLineCount() == 0) {
      return 0;
    }

    int left = Integer.MAX_VALUE;
    for (int i = 0; i < layout.getLineCount(); i++) {
      left = Math.min(left, (int) layout.getLineLeft(i));
    }

    return left;
  }
Returns the leftmost position of the layout. This is helpful when there's space between the
layout's left bound and its content's (lines) leftmost bound, e.g. StaticLayout when the text
alignment is not ALIGN_NORMAL.
library/src/main/java/com/facebook/fbui/textlayoutbuilder/util/LayoutMeasureUtil.java