Class 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.

    • Constructor Detail

      • FontFactory

        public FontFactory()
    • Method Detail

      • 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
      • isPrintableChar

        public static boolean isPrintableChar​(char c)