public void setFont(final int position, final int length, final Font font) {
    Preconditions.checkNotNull(font, "Error: Font argument can't be null");

    if (!isEmpty()) {
      final int realLength = calculateRealLength(position, length);

      validatePartialLineArguments(position, realLength);

      Preconditions.checkNotNull(font, "Error: Font argument can't be null");

      m_atext.addAttribute(TextAttribute.FONT, font, position, position + realLength);

      m_textLayout = new TextLayout(m_atext.getIterator(), m_fontContext);

      updateCharBounds(font);
    }
  }
Changes the font that is used to display part of the line.

<p>Note that the font must be a monospaced font.

@param position The index of the first character that gets the new font.
@param length Number of characters that get the new font.
@param font The new font to be used.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/realizers/ZyLineContent.java