1 /*
2 * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
1994 * Returns a map of font attributes available in this
1995 * {@code Font}. Attributes include things like ligatures and
1996 * glyph substitution.
1997 * @return the attributes map of this {@code Font}.
1998 */
1999 public Map<TextAttribute,?> getAttributes(){
2000 return new AttributeMap(getAttributeValues());
2001 }
2002
2003 /**
2004 * Returns the keys of all the attributes supported by this
2005 * {@code Font}. These attributes can be used to derive other
2006 * fonts.
2007 * @return an array containing the keys of all the attributes
2008 * supported by this {@code Font}.
2009 * @since 1.2
2010 */
2011 public Attribute[] getAvailableAttributes() {
2012 // FONT is not supported by Font
2013
2014 Attribute attributes[] = {
2015 TextAttribute.FAMILY,
2016 TextAttribute.WEIGHT,
2017 TextAttribute.WIDTH,
2018 TextAttribute.POSTURE,
2019 TextAttribute.SIZE,
2020 TextAttribute.TRANSFORM,
2021 TextAttribute.SUPERSCRIPT,
2022 TextAttribute.CHAR_REPLACEMENT,
2023 TextAttribute.FOREGROUND,
2024 TextAttribute.BACKGROUND,
2025 TextAttribute.UNDERLINE,
2026 TextAttribute.STRIKETHROUGH,
2027 TextAttribute.RUN_DIRECTION,
2028 TextAttribute.BIDI_EMBEDDING,
2029 TextAttribute.JUSTIFICATION,
2030 TextAttribute.INPUT_METHOD_HIGHLIGHT,
2031 TextAttribute.INPUT_METHOD_UNDERLINE,
2032 TextAttribute.SWAP_COLORS,
2033 TextAttribute.NUMERIC_SHAPING,
2034 TextAttribute.KERNING,
|
1 /*
2 * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
1994 * Returns a map of font attributes available in this
1995 * {@code Font}. Attributes include things like ligatures and
1996 * glyph substitution.
1997 * @return the attributes map of this {@code Font}.
1998 */
1999 public Map<TextAttribute,?> getAttributes(){
2000 return new AttributeMap(getAttributeValues());
2001 }
2002
2003 /**
2004 * Returns the keys of all the attributes supported by this
2005 * {@code Font}. These attributes can be used to derive other
2006 * fonts.
2007 * @return an array containing the keys of all the attributes
2008 * supported by this {@code Font}.
2009 * @since 1.2
2010 */
2011 public Attribute[] getAvailableAttributes() {
2012 // FONT is not supported by Font
2013
2014 Attribute[] attributes = {
2015 TextAttribute.FAMILY,
2016 TextAttribute.WEIGHT,
2017 TextAttribute.WIDTH,
2018 TextAttribute.POSTURE,
2019 TextAttribute.SIZE,
2020 TextAttribute.TRANSFORM,
2021 TextAttribute.SUPERSCRIPT,
2022 TextAttribute.CHAR_REPLACEMENT,
2023 TextAttribute.FOREGROUND,
2024 TextAttribute.BACKGROUND,
2025 TextAttribute.UNDERLINE,
2026 TextAttribute.STRIKETHROUGH,
2027 TextAttribute.RUN_DIRECTION,
2028 TextAttribute.BIDI_EMBEDDING,
2029 TextAttribute.JUSTIFICATION,
2030 TextAttribute.INPUT_METHOD_HIGHLIGHT,
2031 TextAttribute.INPUT_METHOD_UNDERLINE,
2032 TextAttribute.SWAP_COLORS,
2033 TextAttribute.NUMERIC_SHAPING,
2034 TextAttribute.KERNING,
|