You are dealing with an array operation here:
Code:
FontFamily fontFamily[] = FontFamily.getFontFamilies();
Font font = fontFamily[3].getFont(FontFamily.SCALABLE_FONT, 12);
Font textFont = fontFamily[3].getFont(FontFamily.SCALABLE_FONT, 16);
Did you check whether FontFamily.getFontFamilies() method is returning more than 4 values.
As you are getting some values from the fontFamily[3].
Please check this case and let me know.