Java Code Examples for sun.font.FontManager#registerFont()

The following examples show how to use sun.font.FontManager#registerFont() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 2
Source File: GraphicsEnvironment.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 3
Source File: GraphicsEnvironment.java    From jdk-1.7-annotated with Apache License 2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 4
Source File: GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 5
Source File: GraphicsEnvironment.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 6
Source File: GraphicsEnvironment.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 7
Source File: GraphicsEnvironment.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 8
Source File: GraphicsEnvironment.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 9
Source File: GraphicsEnvironment.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 10
Source File: GraphicsEnvironment.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 11
Source File: GraphicsEnvironment.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> {@code Font} in this
 * {@code GraphicsEnvironment}.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new {@code Font}s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return {@code false} are:
 * <ul>
 * <li>The font is not a <i>created</i> {@code Font}.
 * <li>The font conflicts with a non-created {@code Font} already
 * in this {@code GraphicsEnvironment}. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 *
 * @param  font the font to be registered
 * @return true if the {@code font} is successfully
 * registered in this {@code GraphicsEnvironment}.
 * @throws NullPointerException if {@code font} is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 12
Source File: GraphicsEnvironment.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> {@code Font} in this
 * {@code GraphicsEnvironment}.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new {@code Font}s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return {@code false} are:
 * <ul>
 * <li>The font is not a <i>created</i> {@code Font}.
 * <li>The font conflicts with a non-created {@code Font} already
 * in this {@code GraphicsEnvironment}. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 *
 * @param  font the font to be registered
 * @return true if the {@code font} is successfully
 * registered in this {@code GraphicsEnvironment}.
 * @throws NullPointerException if {@code font} is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 13
Source File: GraphicsEnvironment.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 14
Source File: GraphicsEnvironment.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 15
Source File: GraphicsEnvironment.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 16
Source File: GraphicsEnvironment.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 17
Source File: GraphicsEnvironment.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}
 
Example 18
Source File: GraphicsEnvironment.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Registers a <i>created</i> <code>Font</code>in this
 * <code>GraphicsEnvironment</code>.
 * A created font is one that was returned from calling
 * {@link Font#createFont}, or derived from a created font by
 * calling {@link Font#deriveFont}.
 * After calling this method for such a font, it is available to
 * be used in constructing new <code>Font</code>s by name or family name,
 * and is enumerated by {@link #getAvailableFontFamilyNames} and
 * {@link #getAllFonts} within the execution context of this
 * application or applet. This means applets cannot register fonts in
 * a way that they are visible to other applets.
 * <p>
 * Reasons that this method might not register the font and therefore
 * return <code>false</code> are:
 * <ul>
 * <li>The font is not a <i>created</i> <code>Font</code>.
 * <li>The font conflicts with a non-created <code>Font</code> already
 * in this <code>GraphicsEnvironment</code>. For example if the name
 * is that of a system font, or a logical font as described in the
 * documentation of the {@link Font} class. It is implementation dependent
 * whether a font may also conflict if it has the same family name
 * as a system font.
 * <p>Notice that an application can supersede the registration
 * of an earlier created font with a new one.
 * </ul>
 * @return true if the <code>font</code> is successfully
 * registered in this <code>GraphicsEnvironment</code>.
 * @throws NullPointerException if <code>font</code> is null
 * @since 1.6
 */
public boolean registerFont(Font font) {
    if (font == null) {
        throw new NullPointerException("font cannot be null.");
    }
    FontManager fm = FontManagerFactory.getInstance();
    return fm.registerFont(font);
}