protected void updateFontHeight(
      Paint.FontMetricsInt fontMetrics, final int offsetAbove, final int offsetBelow) {
    if (offsetAbove < fontMetrics.ascent) {
      fontMetrics.ascent = offsetAbove;
    }

    if (offsetAbove < fontMetrics.top) {
      fontMetrics.top = offsetAbove;
    }

    if (offsetBelow > fontMetrics.descent) {
      fontMetrics.descent = offsetBelow;
    }

    if (offsetBelow > fontMetrics.bottom) {
      fontMetrics.bottom = offsetBelow;
    }
  }
Returns the width of the image span and increases the height if font metrics are available.
fbcore/src/main/java/com/facebook/widget/text/span/BetterImageSpan.java