Class FontFactory

java.lang.Object
com.jogamp.graph.font.FontFactory

public class FontFactory extends Object
The optional property jogamp.graph.font.ctor allows user to specify the FontConstructor implementation.

Default FontConstructor is TypecastFontConstructor, i.e. using our internal typecast branch.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Java fonts are optional, 1
    static final int
    Ubuntu is the default font family, 0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final FontSet
    get(int font)
     
    static final Font
    get(File file)
    Creates a Font instance.
    static final Font
    get(InputStream stream, boolean closeStream)
    Creates a Font instance based on an undeterminated font stream length.
    static final Font
    get(InputStream stream, int streamLen, boolean closeStream)
    Creates a Font instance based on a determinated font stream with its given length of the font segment.
    static final Font
    get(Class<?> context, String fname, boolean useTempJarCache)
     
    static final FontSet
     
    static boolean
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • FontFactory

      public FontFactory()
  • Method Details

    • getDefault

      public static final FontSet getDefault()
    • get

      public static final FontSet get(int font)
    • get

      public static final Font get(File file) throws IOException
      Creates a Font instance.
      Parameters:
      file - font file
      Returns:
      the new Font instance
      Throws:
      IOException
    • get

      public static final Font get(InputStream stream, int streamLen, boolean closeStream) throws IOException
      Creates a Font instance based on a determinated font stream with its given length of the font segment.

      No explicit stream copy is performed as in get(InputStream, boolean) due to the known streamLen.

      Parameters:
      stream - font stream
      streamLen - length of the font segment within this font stream
      closeStream - true to close the stream
      Returns:
      the new Font instance
      Throws:
      IOException
    • get

      public static final Font get(InputStream stream, boolean closeStream) throws IOException
      Creates a Font instance based on an undeterminated font stream length.

      The font stream is temporarily copied into a temp file to gather it's size and to gain random access. The temporary file will be deleted at exit.

      Parameters:
      stream - dedicated font stream
      closeStream - true to close the stream
      Returns:
      the new Font instance
      Throws:
      IOException
    • get

      public static final Font get(Class<?> context, String fname, boolean useTempJarCache) throws IOException
      Throws:
      IOException
    • isPrintableChar

      public static boolean isPrintableChar(char c)