public BitmapFont generateFont (FreeTypeFontParameter parameter, FreeTypeBitmapFontData data) {
        boolean updateTextureRegions = data.regions == null && parameter.packer != null;
        if (updateTextureRegions) data.regions = new Array();
        generateData(parameter, data);
        if (updateTextureRegions)
            parameter.packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps);
        if (data.regions.isEmpty()) throw new GdxRuntimeException("Unable to create a font with no texture regions.");
        BitmapFont font = newBitmapFont(data, data.regions, true);
        font.setOwnsTexture(parameter.packer == null);
        return font;
    }
Generates a new {@link BitmapFont}. The size is expressed in pixels. Throws a GdxRuntimeException if the font could not be
generated. Using big sizes might cause such an exception.
@param parameter configures how the font is generated
core/src/com/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator.java