Package arc.freetype

Class FreeTypeFontGenerator.FreeTypeFontParameter

java.lang.Object
arc.freetype.FreeTypeFontGenerator.FreeTypeFontParameter
Enclosing class:
FreeTypeFontGenerator

public static class FreeTypeFontGenerator.FreeTypeFontParameter extends Object
Parameter container class that helps configure how FreeTypeFontGenerator.FreeTypeFontData and Font instances are generated.

The packer field is for advanced usage, where it is necessary to pack multiple BitmapFonts (i.e. styles, sizes, families) into a single Texture atlas. If no packer is specified, the generator will use its own PixmapPacker to pack the glyphs into a power-of-two sized texture, and the resulting FreeTypeFontGenerator.FreeTypeFontData will have a valid TextureRegion which can be used to construct a new Font.

  • Field Details

    • size

      public int size
      The size in pixels
    • mono

      public boolean mono
      If true, font smoothing is disabled.
    • hinting

      Strength of hinting
    • color

      public Color color
      Foreground color (required for non-black borders)
    • gamma

      public float gamma
      Glyph gamma. Values > 1 reduce antialiasing.
    • renderCount

      public int renderCount
      Number of times to render the glyph. Useful with a shadow or border, so it doesn't show through the glyph.
    • borderWidth

      public float borderWidth
      Border width in pixels, 0 to disable
    • borderColor

      public Color borderColor
      Border color; only used if borderWidth > 0
    • borderStraight

      public boolean borderStraight
      true for straight (mitered), false for rounded borders
    • borderGamma

      public float borderGamma
      Values < 1 increase the border size.
    • shadowOffsetX

      public int shadowOffsetX
      Offset of text shadow on X axis in pixels, 0 to disable
    • shadowOffsetY

      public int shadowOffsetY
      Offset of text shadow on Y axis in pixels, 0 to disable
    • shadowColor

      public Color shadowColor
      Shadow color; only used if shadowOffset > 0. If alpha component is 0, no shadow is drawn but characters are still offset by shadowOffset.
    • spaceX

      public int spaceX
      Pixels to add to glyph spacing when text is rendered. Can be negative.
    • spaceY

      public int spaceY
      Pixels to add to glyph spacing when text is rendered. Can be negative.
    • padTop

      public int padTop
      Pixels to add to the glyph in the texture. Can be negative.
    • padLeft

      public int padLeft
      Pixels to add to the glyph in the texture. Can be negative.
    • padBottom

      public int padBottom
      Pixels to add to the glyph in the texture. Can be negative.
    • padRight

      public int padRight
      Pixels to add to the glyph in the texture. Can be negative.
    • characters

      public String characters
      The characters the font should contain. If '\0' is not included then Font.FontData.missingGlyph is not set.
    • kerning

      public boolean kerning
      Whether the font should include kerning
    • packer

      public PixmapPacker packer
      The optional PixmapPacker to use for packing multiple fonts into a single texture.
      See Also:
    • flip

      public boolean flip
      Whether to flip the font vertically
    • genMipMaps

      public boolean genMipMaps
      Whether to generate mip maps for the resulting texture
    • minFilter

      public Texture.TextureFilter minFilter
      Minification filter
    • magFilter

      public Texture.TextureFilter magFilter
      Magnification filter
    • incremental

      public boolean incremental
      When true, glyphs are rendered on the fly to the font's glyph page textures as they are needed. The FreeTypeFontGenerator must not be disposed until the font is no longer needed. The FreeTypeBitmapFontData must be disposed (separately from the generator) when the font is no longer needed. The FreeTypeFontParameter should not be modified after creating a font. If a PixmapPacker is not specified, the font glyph page textures will use FreeTypeFontGenerator.getMaxTextureSize().
  • Constructor Details

    • FreeTypeFontParameter

      public FreeTypeFontParameter()