< prev index next >

modules/graphics/src/main/java/com/sun/javafx/font/FontFactory.java

Print this page




  72      * with the FX graphics system for creation by available constructors
  73      * and factory methods, and the application should use it in this
  74      * manner rather than calling this method again, which would
  75      * repeat the overhead of re-reading and installing the font.
  76      * <p>
  77      * When the font is registered, an alternative <code>name</code> can be
  78      * supplied. This name can be used for creation by available constructors
  79      * and factory methods.
  80      * <p>
  81      * The font <code>size</code> parameter is a convenience so that in
  82      * typical usage the application can directly use the returned (non-null)
  83      * font rather than needing to create one via a constructor. Invalid sizes
  84      * are those <=0 and will result in a default size.
  85      * <p>
  86      * This method does not close the input stream.
  87      *
  88      * @param name the name for font, it can be <code>null</code>.
  89      * @param stream the stream from which to load the font.
  90      * @param size the size for the font.
  91      * @param register whether the font should be register.

  92      * @return the Font, or null if the font cannot be created.
  93      */
  94     public PGFont loadEmbeddedFont(String name, InputStream stream,
  95                                    float size, boolean register);
  96 
  97     /**
  98      * Loads a font from the specified path. If the load is successful
  99      * such that the location is readable, and it represents a supported
 100      * font format then a <code>PGFont</code> object will be returned.
 101      * <p>
 102      * Any failure such as a file being unable to locate or read
 103      * from the resource, or if it doesn't represent a font, will result in
 104      * a <code>null</code> return. It is the application's responsibility
 105      * to check this before use.
 106      * <p>
 107      * If the <code>register</code> flag is true, and the loading operation
 108      * completes successfully, then the returned font is registered
 109      * with the FX graphics system for creation by available constructors
 110      * and factory methods, and the application should use it in this
 111      * manner rather than calling this method again, which would
 112      * repeat the overhead of re-reading and installing the font.
 113      * <p>
 114      * When the font is registered, an alternative <code>name</code> can be
 115      * supplied. This name can be used for creation by available constructors
 116      * and factory methods.
 117      * <p>
 118      * The font <code>size</code> parameter is a convenience so that in
 119      * typical usage the application can directly use the returned (non-null)
 120      * font rather than needing to create one via a constructor. Invalid sizes
 121      * are those <=0 and will result in a default size.
 122      *
 123      * @param name the name for font, it can be <code>null</code>.
 124      * @param path the path from which to load the font.
 125      * @param size the size for the font.
 126      * @param register whether the font should be register.

 127      * @return the Font, or null if the font cannot be created.
 128      */
 129     public PGFont loadEmbeddedFont(String name, String path,
 130                                    float size, boolean register);
 131 
 132     public boolean isPlatformFont(String name);
 133 }


  72      * with the FX graphics system for creation by available constructors
  73      * and factory methods, and the application should use it in this
  74      * manner rather than calling this method again, which would
  75      * repeat the overhead of re-reading and installing the font.
  76      * <p>
  77      * When the font is registered, an alternative <code>name</code> can be
  78      * supplied. This name can be used for creation by available constructors
  79      * and factory methods.
  80      * <p>
  81      * The font <code>size</code> parameter is a convenience so that in
  82      * typical usage the application can directly use the returned (non-null)
  83      * font rather than needing to create one via a constructor. Invalid sizes
  84      * are those <=0 and will result in a default size.
  85      * <p>
  86      * This method does not close the input stream.
  87      *
  88      * @param name the name for font, it can be <code>null</code>.
  89      * @param stream the stream from which to load the font.
  90      * @param size the size for the font.
  91      * @param register whether the font should be register.
  92      * @param all whether to load all fonts from a TTC
  93      * @return the Font, or null if the font cannot be created.
  94      */
  95     public PGFont[] loadEmbeddedFont(String name, InputStream stream,
  96                                    float size, boolean register, boolean all);
  97 
  98     /**
  99      * Loads a font from the specified path. If the load is successful
 100      * such that the location is readable, and it represents a supported
 101      * font format then a <code>PGFont</code> object will be returned.
 102      * <p>
 103      * Any failure such as a file being unable to locate or read
 104      * from the resource, or if it doesn't represent a font, will result in
 105      * a <code>null</code> return. It is the application's responsibility
 106      * to check this before use.
 107      * <p>
 108      * If the <code>register</code> flag is true, and the loading operation
 109      * completes successfully, then the returned font is registered
 110      * with the FX graphics system for creation by available constructors
 111      * and factory methods, and the application should use it in this
 112      * manner rather than calling this method again, which would
 113      * repeat the overhead of re-reading and installing the font.
 114      * <p>
 115      * When the font is registered, an alternative <code>name</code> can be
 116      * supplied. This name can be used for creation by available constructors
 117      * and factory methods.
 118      * <p>
 119      * The font <code>size</code> parameter is a convenience so that in
 120      * typical usage the application can directly use the returned (non-null)
 121      * font rather than needing to create one via a constructor. Invalid sizes
 122      * are those <=0 and will result in a default size.
 123      *
 124      * @param name the name for font, it can be <code>null</code>.
 125      * @param path the path from which to load the font.
 126      * @param size the size for the font.
 127      * @param register whether the font should be register.
 128      * @param all whether to load all fonts from a TTC
 129      * @return the Font, or null if the font cannot be created.
 130      */
 131     public PGFont[] loadEmbeddedFont(String name, String path,
 132                                    float size, boolean register, boolean all);
 133 
 134     public boolean isPlatformFont(String name);
 135 }
< prev index next >