2128 * @param attributes a map of attributes enabled for the new
2129 * {@code Font}
2130 * @return a new {@code Font} object.
2131 * @since 1.2
2132 */
2133 public Font deriveFont(Map<? extends Attribute, ?> attributes) {
2134 if (attributes == null) {
2135 return this;
2136 }
2137 AttributeValues newValues = getAttributeValues().clone();
2138 newValues.merge(attributes, RECOGNIZED_MASK);
2139
2140 return new Font(newValues, name, style, createdFont, font2DHandle);
2141 }
2142
2143 /**
2144 * Checks if this {@code Font} has a glyph for the specified
2145 * character.
2146 *
2147 * <p> <b>Note:</b> This method cannot handle <a
2148 * href="../../java/lang/Character.html#supplementary"> supplementary
2149 * characters</a>. To support all Unicode characters, including
2150 * supplementary characters, use the {@link #canDisplay(int)}
2151 * method or {@code canDisplayUpTo} methods.
2152 *
2153 * @param c the character for which a glyph is needed
2154 * @return {@code true} if this {@code Font} has a glyph for this
2155 * character; {@code false} otherwise.
2156 * @since 1.2
2157 */
2158 public boolean canDisplay(char c){
2159 return getFont2D().canDisplay(c);
2160 }
2161
2162 /**
2163 * Checks if this {@code Font} has a glyph for the specified
2164 * character.
2165 *
2166 * @param codePoint the character (Unicode code point) for which a glyph
2167 * is needed.
2168 * @return {@code true} if this {@code Font} has a glyph for the
|
2128 * @param attributes a map of attributes enabled for the new
2129 * {@code Font}
2130 * @return a new {@code Font} object.
2131 * @since 1.2
2132 */
2133 public Font deriveFont(Map<? extends Attribute, ?> attributes) {
2134 if (attributes == null) {
2135 return this;
2136 }
2137 AttributeValues newValues = getAttributeValues().clone();
2138 newValues.merge(attributes, RECOGNIZED_MASK);
2139
2140 return new Font(newValues, name, style, createdFont, font2DHandle);
2141 }
2142
2143 /**
2144 * Checks if this {@code Font} has a glyph for the specified
2145 * character.
2146 *
2147 * <p> <b>Note:</b> This method cannot handle <a
2148 * href="../../../java.base/java/lang/Character.html#supplementary"> supplementary
2149 * characters</a>. To support all Unicode characters, including
2150 * supplementary characters, use the {@link #canDisplay(int)}
2151 * method or {@code canDisplayUpTo} methods.
2152 *
2153 * @param c the character for which a glyph is needed
2154 * @return {@code true} if this {@code Font} has a glyph for this
2155 * character; {@code false} otherwise.
2156 * @since 1.2
2157 */
2158 public boolean canDisplay(char c){
2159 return getFont2D().canDisplay(c);
2160 }
2161
2162 /**
2163 * Checks if this {@code Font} has a glyph for the specified
2164 * character.
2165 *
2166 * @param codePoint the character (Unicode code point) for which a glyph
2167 * is needed.
2168 * @return {@code true} if this {@code Font} has a glyph for the
|