src/java.desktop/share/classes/java/awt/font/TextAttribute.java
author mchung
Tue, 06 Nov 2018 10:01:16 -0800
changeset 52427 3c6aa484536c
parent 47498 aa0344e6f39b
child 54397 65030bbf5ac1
permissions -rw-r--r--
8211122: Reduce the number of internal classes made accessible to jdk.unsupported Reviewed-by: alanb, dfuchs, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
52427
3c6aa484536c 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
mchung
parents: 47498
diff changeset
     2
 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * (C) Copyright Taligent, Inc. 1996 - 1997, All Rights Reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * (C) Copyright IBM Corp. 1996 - 1998, All Rights Reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * The original version of this source code and documentation is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * copyrighted and owned by Taligent, Inc., a wholly-owned subsidiary
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * of IBM. These materials are provided under terms of a License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * Agreement between Taligent and Sun. This technology is protected
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * by multiple US and International patents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * This notice and attribution to Taligent may not be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * Taligent is a registered trademark of Taligent, Inc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
package java.awt.font;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.io.InvalidObjectException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.text.AttributedCharacterIterator.Attribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import java.util.HashMap;
52427
3c6aa484536c 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
mchung
parents: 47498
diff changeset
    47
import jdk.internal.access.SharedSecrets;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
/**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    50
 * The {@code TextAttribute} class defines attribute keys and
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * attribute values used for text rendering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * <p>
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    53
 * {@code TextAttribute} instances are used as attribute keys to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * identify attributes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * {@link java.awt.Font Font},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * {@link java.awt.font.TextLayout TextLayout},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * {@link java.text.AttributedCharacterIterator AttributedCharacterIterator},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * and other classes handling text attributes. Other constants defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * in this class can be used as attribute values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * For each text attribute, the documentation provides:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *   <LI>the type of its value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *   <LI>the relevant predefined constants, if any
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 *   <LI>the default effect if the attribute is absent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *   <LI>the valid values if there are limitations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *   <LI>a description of the effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * </UL>
22260
c9185e010e03 8031082: Fix non-missing doclint problems in client libraries
darcy
parents: 21777
diff changeset
    69
 *
21777
c0a423e43b0d 8025235: [javadoc] fix some errors in 2D
yan
parents: 20451
diff changeset
    70
 * <H3>Values</H3>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *   <LI>The values of attributes must always be immutable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *   <LI>Where value limitations are given, any value outside of that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *   set is reserved for future use; the value will be treated as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 *   the default.
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    76
 *   <LI>The value {@code null} is treated the same as the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *   default value and results in the default behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 *   <li>If the value is not of the proper type, the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 *   will be ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 *   <li>The identity of the value does not matter, only the actual
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    81
 *   value.  For example, {@code TextAttribute.WEIGHT_BOLD} and
37714
7a0b1c7e7054 8154213: clean up uses of boxed primitive constructors in the java.desktop module
prr
parents: 35667
diff changeset
    82
 *   {@code Float.valueOf(2.0f)}
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    83
 *   indicate the same {@code WEIGHT}.
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    84
 *   <li>Attribute values of type {@code Number} (used for
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    85
 *   {@code WEIGHT}, {@code WIDTH}, {@code POSTURE},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    86
 *   {@code SIZE}, {@code JUSTIFICATION}, and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    87
 *   {@code TRACKING}) can vary along their natural range and are
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *   not restricted to the predefined constants.
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    89
 *   {@code Number.floatValue()} is used to get the actual value
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    90
 *   from the {@code Number}.
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    91
 *   <li>The values for {@code WEIGHT}, {@code WIDTH}, and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
    92
 *   {@code POSTURE} are interpolated by the system, which
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 *   can select the 'nearest available' font or use other techniques to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 *   approximate the user's request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * <h4>Summary of attributes</h4>
47498
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
    99
 *
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   100
 * <table style="width:95%;margin: 0px auto" class="striped">
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   101
 * <caption>Key, value type, principal constants, and default value behavior of
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   102
 * all TextAttributes</caption>
45648
87c997b74bb8 8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents: 45025
diff changeset
   103
 * <thead>
47498
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   104
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   105
 *     <th scope="col">Key
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   106
 *     <th scope="col">Value Type
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   107
 *     <th scope="col">Principal Constants
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   108
 *     <th scope="col">Default Value
45648
87c997b74bb8 8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents: 45025
diff changeset
   109
 * </thead>
87c997b74bb8 8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents: 45025
diff changeset
   110
 * <tbody>
47498
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   111
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   112
 *     <th scope="row">{@link #FAMILY}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   113
 *     <td>String
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   114
 *     <td>See Font {@link java.awt.Font#DIALOG DIALOG},
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   115
 *     {@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT},
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   116
 *     <br>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   117
 *     {@link java.awt.Font#SERIF SERIF},
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   118
 *     {@link java.awt.Font#SANS_SERIF SANS_SERIF}, and
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   119
 *     {@link java.awt.Font#MONOSPACED MONOSPACED}.
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   120
 *     <td>"Default" (use platform default)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   121
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   122
 *     <th scope="row">{@link #WEIGHT}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   123
 *     <td>Number
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   124
 *     <td>WEIGHT_REGULAR, WEIGHT_BOLD
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   125
 *     <td>WEIGHT_REGULAR
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   126
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   127
 *     <th scope="row">{@link #WIDTH}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   128
 *     <td>Number
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   129
 *     <td>WIDTH_CONDENSED, WIDTH_REGULAR,<br>WIDTH_EXTENDED
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   130
 *     <td>WIDTH_REGULAR
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   131
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   132
 *     <th scope="row">{@link #POSTURE}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   133
 *     <td>Number
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   134
 *     <td>POSTURE_REGULAR, POSTURE_OBLIQUE
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   135
 *     <td>POSTURE_REGULAR
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   136
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   137
 *     <th scope="row">{@link #SIZE}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   138
 *     <td>Number
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   139
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   140
 *     <td>12.0
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   141
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   142
 *     <th scope="row">{@link #TRANSFORM}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   143
 *     <td>{@link TransformAttribute}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   144
 *     <td>See TransformAttribute {@link TransformAttribute#IDENTITY IDENTITY}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   145
 *     <td>TransformAttribute.IDENTITY
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   146
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   147
 *     <th scope="row">{@link #SUPERSCRIPT}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   148
 *     <td>Integer
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   149
 *     <td>SUPERSCRIPT_SUPER, SUPERSCRIPT_SUB
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   150
 *     <td>0 (use the standard glyphs and metrics)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   151
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   152
 *     <th scope="row">{@link #FONT}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   153
 *     <td>{@link java.awt.Font}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   154
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   155
 *     <td>null (do not override font resolution)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   156
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   157
 *     <th scope="row">{@link #CHAR_REPLACEMENT}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   158
 *     <td>{@link GraphicAttribute}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   159
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   160
 *     <td>null (draw text using font glyphs)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   161
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   162
 *     <th scope="row">{@link #FOREGROUND}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   163
 *     <td>{@link java.awt.Paint}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   164
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   165
 *     <td>null (use current graphics paint)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   166
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   167
 *     <th scope="row">{@link #BACKGROUND}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   168
 *     <td>{@link java.awt.Paint}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   169
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   170
 *     <td>null (do not render background)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   171
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   172
 *     <th scope="row">{@link #UNDERLINE}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   173
 *     <td>Integer
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   174
 *     <td>UNDERLINE_ON
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   175
 *     <td>-1 (do not render underline)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   176
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   177
 *     <th scope="row">{@link #STRIKETHROUGH}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   178
 *     <td>Boolean
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   179
 *     <td>STRIKETHROUGH_ON
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   180
 *     <td>false (do not render strikethrough)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   181
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   182
 *     <th scope="row">{@link #RUN_DIRECTION}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   183
 *     <td>Boolean
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   184
 *     <td>RUN_DIRECTION_LTR<br>RUN_DIRECTION_RTL
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   185
 *     <td>null (use {@link java.text.Bidi} standard default)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   186
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   187
 *     <th scope="row">{@link #BIDI_EMBEDDING}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   188
 *     <td>Integer
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   189
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   190
 *     <td>0 (use base line direction)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   191
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   192
 *     <th scope="row">{@link #JUSTIFICATION}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   193
 *     <td>Number
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   194
 *     <td>JUSTIFICATION_FULL
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   195
 *     <td>JUSTIFICATION_FULL
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   196
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   197
 *     <th scope="row">{@link #INPUT_METHOD_HIGHLIGHT}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   198
 *     <td>{@link java.awt.im.InputMethodHighlight},
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   199
 *     <br>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   200
 *     {@link java.text.Annotation}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   201
 *     <td>(see class)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   202
 *     <td>null (do not apply input highlighting)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   203
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   204
 *     <th scope="row">{@link #INPUT_METHOD_UNDERLINE}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   205
 *     <td>Integer
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   206
 *     <td>UNDERLINE_LOW_ONE_PIXEL,<br>UNDERLINE_LOW_TWO_PIXEL
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   207
 *     <td>-1 (do not render underline)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   208
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   209
 *     <th scope="row">{@link #SWAP_COLORS}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   210
 *     <td>Boolean
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   211
 *     <td>SWAP_COLORS_ON
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   212
 *     <td>false (do not swap colors)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   213
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   214
 *     <th scope="row">{@link #NUMERIC_SHAPING}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   215
 *     <td>{@link java.awt.font.NumericShaper}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   216
 *     <td>none
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   217
 *     <td>null (do not shape digits)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   218
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   219
 *     <th scope="row">{@link #KERNING}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   220
 *     <td>Integer
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   221
 *     <td>KERNING_ON
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   222
 *     <td>0 (do not request kerning)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   223
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   224
 *     <th scope="row">{@link #LIGATURES}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   225
 *     <td>Integer
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   226
 *     <td>LIGATURES_ON
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   227
 *     <td>0 (do not form optional ligatures)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   228
 *   <tr>
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   229
 *     <th scope="row">{@link #TRACKING}
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   230
 *     <td>Number
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   231
 *     <td>TRACKING_LOOSE, TRACKING_TIGHT
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   232
 *     <td>0 (do not add tracking)
aa0344e6f39b 8184219: Fix accessibility of tables in the java.desktop module
serb
parents: 47216
diff changeset
   233
 *   </tr>
45648
87c997b74bb8 8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents: 45025
diff changeset
   234
 * </tbody>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 * </table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 * @see java.awt.Font
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
 * @see java.awt.font.TextLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
 * @see java.text.AttributedCharacterIterator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
public final class TextAttribute extends Attribute {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    // table of all instances in this class, used by readResolve
11081
4a18889223e4 7117199: Fix javac warnings in src/share/classes/java/awt/font
prr
parents: 5506
diff changeset
   244
    private static final Map<String, TextAttribute>
4a18889223e4 7117199: Fix javac warnings in src/share/classes/java/awt/font
prr
parents: 5506
diff changeset
   245
            instanceMap = new HashMap<String, TextAttribute>(29);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
25385
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   247
    // For access from java.text.Bidi
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   248
    static {
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   249
        if (SharedSecrets.getJavaAWTFontAccess() == null) {
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   250
            SharedSecrets.setJavaAWTFontAccess(new JavaAWTFontAccessImpl());
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   251
        }
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   252
    }
2c53e38b77aa 8038092: Re-examine Bidi reflective dependency on java.awt.font
naoto
parents: 22260
diff changeset
   253
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   255
     * Constructs a {@code TextAttribute} with the specified name.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @param name the attribute name to assign to this
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   257
     * {@code TextAttribute}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    protected TextAttribute(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        super(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        if (this.getClass() == TextAttribute.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
            instanceMap.put(name, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * Resolves instances being deserialized to the predefined constants.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    protected Object readResolve() throws InvalidObjectException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        if (this.getClass() != TextAttribute.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
            throw new InvalidObjectException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
                "subclass didn't correctly implement readResolve");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
11081
4a18889223e4 7117199: Fix javac warnings in src/share/classes/java/awt/font
prr
parents: 5506
diff changeset
   275
        TextAttribute instance = instanceMap.get(getName());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        if (instance != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
            return instance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
            throw new InvalidObjectException("unknown attribute name");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    // Serialization compatibility with Java 2 platform v1.2.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    // 1.2 will throw an InvalidObjectException if ever asked to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    // deserialize INPUT_METHOD_UNDERLINE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    // This shouldn't happen in real life.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    static final long serialVersionUID = 7744112784117861702L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    // For use with Font.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * Attribute key for the font name.  Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   295
     * <b>{@code String}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   296
     * {@code "Default"}, which causes the platform default font
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * family to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   299
     * <p> The {@code Font} class defines constants for the logical
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * font names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * {@link java.awt.Font#DIALOG DIALOG},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * {@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * {@link java.awt.Font#SANS_SERIF SANS_SERIF},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * {@link java.awt.Font#SERIF SERIF}, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * {@link java.awt.Font#MONOSPACED MONOSPACED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   307
     * <p>This defines the value passed as {@code name} to the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   308
     * {@code Font} constructor.  Both logical and physical
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * font names are allowed. If a font with the requested name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * is not found, the default font is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * <p><em>Note:</em> This attribute is unfortunately misnamed, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * it specifies the face name and not just the family.  Thus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * values such as "Lucida Sans Bold" will select that face if it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * exists.  Note, though, that if the requested face does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * exist, the default will be used with <em>regular</em> weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * The "Bold" in the name is part of the face name, not a separate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * request that the font's weight be bold.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    public static final TextAttribute FAMILY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
        new TextAttribute("family");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * Attribute key for the weight of a font.  Values are instances
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   325
     * of <b>{@code Number}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   326
     * {@code WEIGHT_REGULAR}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * <p>Several constant values are provided, see {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * #WEIGHT_EXTRA_LIGHT}, {@link #WEIGHT_LIGHT}, {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * #WEIGHT_DEMILIGHT}, {@link #WEIGHT_REGULAR}, {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * #WEIGHT_SEMIBOLD}, {@link #WEIGHT_MEDIUM}, {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * #WEIGHT_DEMIBOLD}, {@link #WEIGHT_BOLD}, {@link #WEIGHT_HEAVY},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * {@link #WEIGHT_EXTRABOLD}, and {@link #WEIGHT_ULTRABOLD}.  The
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   334
     * value {@code WEIGHT_BOLD} corresponds to the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   335
     * style value {@code Font.BOLD} as passed to the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   336
     * {@code Font} constructor.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * <p>The value is roughly the ratio of the stem width to that of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * the regular weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * <p>The system can interpolate the provided value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    public static final TextAttribute WEIGHT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        new TextAttribute("weight");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * The lightest predefined weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    public static final Float WEIGHT_EXTRA_LIGHT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        Float.valueOf(0.5f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * The standard light weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    public static final Float WEIGHT_LIGHT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        Float.valueOf(0.75f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   361
     * An intermediate weight between {@code WEIGHT_LIGHT} and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   362
     * {@code WEIGHT_STANDARD}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    public static final Float WEIGHT_DEMILIGHT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
        Float.valueOf(0.875f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   369
     * The standard weight. This is the default value for {@code WEIGHT}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    public static final Float WEIGHT_REGULAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        Float.valueOf(1.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   376
     * A moderately heavier weight than {@code WEIGHT_REGULAR}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    public static final Float WEIGHT_SEMIBOLD =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        Float.valueOf(1.25f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   383
     * An intermediate weight between {@code WEIGHT_REGULAR} and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   384
     * {@code WEIGHT_BOLD}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    public static final Float WEIGHT_MEDIUM =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        Float.valueOf(1.5f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   391
     * A moderately lighter weight than {@code WEIGHT_BOLD}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    public static final Float WEIGHT_DEMIBOLD =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
        Float.valueOf(1.75f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * The standard bold weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    public static final Float WEIGHT_BOLD =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        Float.valueOf(2.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   405
     * A moderately heavier weight than {@code WEIGHT_BOLD}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    public static final Float WEIGHT_HEAVY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        Float.valueOf(2.25f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * An extra heavy weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    public static final Float WEIGHT_EXTRABOLD =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        Float.valueOf(2.5f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * The heaviest predefined weight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * @see #WEIGHT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    public static final Float WEIGHT_ULTRABOLD =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
        Float.valueOf(2.75f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * Attribute key for the width of a font.  Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   427
     * <b>{@code Number}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   428
     * {@code WIDTH_REGULAR}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * <p>Several constant values are provided, see {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * #WIDTH_CONDENSED}, {@link #WIDTH_SEMI_CONDENSED}, {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * #WIDTH_REGULAR}, {@link #WIDTH_SEMI_EXTENDED}, {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * #WIDTH_EXTENDED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * <p>The value is roughly the ratio of the advance width to that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * of the regular width.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * <p>The system can interpolate the provided value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    public static final TextAttribute WIDTH =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        new TextAttribute("width");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * The most condensed predefined width.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * @see #WIDTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    public static final Float WIDTH_CONDENSED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        Float.valueOf(0.75f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * A moderately condensed width.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * @see #WIDTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    public static final Float WIDTH_SEMI_CONDENSED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
        Float.valueOf(0.875f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * The standard width. This is the default value for
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   459
     * {@code WIDTH}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * @see #WIDTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
    public static final Float WIDTH_REGULAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
        Float.valueOf(1.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * A moderately extended width.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * @see #WIDTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    public static final Float WIDTH_SEMI_EXTENDED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
        Float.valueOf(1.25f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * The most extended predefined width.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @see #WIDTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
    public static final Float WIDTH_EXTENDED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        Float.valueOf(1.5f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * Attribute key for the posture of a font.  Values are instances
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   481
     * of <b>{@code Number}</b>. The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   482
     * {@code POSTURE_REGULAR}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * <p>Two constant values are provided, {@link #POSTURE_REGULAR}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * and {@link #POSTURE_OBLIQUE}. The value
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   486
     * {@code POSTURE_OBLIQUE} corresponds to the style value
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   487
     * {@code Font.ITALIC} as passed to the {@code Font}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * <p>The value is roughly the slope of the stems of the font,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * expressed as the run over the rise.  Positive values lean right.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * <p>The system can interpolate the provided value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * <p>This will affect the font's italic angle as returned by
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   496
     * {@code Font.getItalicAngle}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * @see java.awt.Font#getItalicAngle()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
    public static final TextAttribute POSTURE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
        new TextAttribute("posture");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * The standard posture, upright.  This is the default value for
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   505
     * {@code POSTURE}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * @see #POSTURE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
    public static final Float POSTURE_REGULAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
        Float.valueOf(0.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * The standard italic posture.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @see #POSTURE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
    public static final Float POSTURE_OBLIQUE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
        Float.valueOf(0.20f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * Attribute key for the font size.  Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   520
     * <b>{@code Number}</b>.  The default value is 12pt.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   522
     * <p>This corresponds to the {@code size} parameter to the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   523
     * {@code Font} constructor.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * <p>Very large or small sizes will impact rendering performance,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * and the rendering system might not render text at these sizes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * Negative sizes are illegal and result in the default size.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * <p>Note that the appearance and metrics of a 12pt font with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * 2x transform might be different than that of a 24 point font
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * with no transform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
    public static final TextAttribute SIZE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
        new TextAttribute("size");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * Attribute key for the transform of a font.  Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   538
     * instances of <b>{@code TransformAttribute}</b>.  The
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   539
     * default value is {@code TransformAttribute.IDENTITY}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   541
     * <p>The {@code TransformAttribute} class defines the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * constant {@link TransformAttribute#IDENTITY IDENTITY}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * <p>This corresponds to the transform passed to
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   545
     * {@code Font.deriveFont(AffineTransform)}.  Since that
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   546
     * transform is mutable and {@code TextAttribute} values must
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   547
     * not be, the {@code TransformAttribute} wrapper class is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * <p>The primary intent is to support scaling and skewing, though
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * other effects are possible.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * <p>Some transforms will cause the baseline to be rotated and/or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * shifted.  The text and the baseline are transformed together so
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * that the text follows the new baseline.  For example, with text
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * on a horizontal baseline, the new baseline follows the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * direction of the unit x vector passed through the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * transform. Text metrics are measured against this new baseline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * So, for example, with other things being equal, text rendered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * with a rotated TRANSFORM and an unrotated TRANSFORM will measure as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * having the same ascent, descent, and advance.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * <p>In styled text, the baselines for each such run are aligned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * one after the other to potentially create a non-linear baseline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * for the entire run of text. For more information, see {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * TextLayout#getLayoutPath}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * @see TransformAttribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * @see java.awt.geom.AffineTransform
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     public static final TextAttribute TRANSFORM =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
        new TextAttribute("transform");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * Attribute key for superscripting and subscripting.  Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   576
     * instances of <b>{@code Integer}</b>.  The default value is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * 0, which means that no superscript or subscript is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * <p>Two constant values are provided, see {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * #SUPERSCRIPT_SUPER} and {@link #SUPERSCRIPT_SUB}.  These have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * the values 1 and -1 respectively.  Values of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * greater magnitude define greater levels of superscript or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * subscripting, for example, 2 corresponds to super-superscript,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * 3 to super-super-superscript, and similarly for negative values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * and subscript, up to a level of 7 (or -7).  Values beyond this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * range are reserved; behavior is platform-dependent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   588
     * <p>{@code SUPERSCRIPT} can
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * impact the ascent and descent of a font.  The ascent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * and descent can never become negative, however.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    public static final TextAttribute SUPERSCRIPT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
        new TextAttribute("superscript");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * Standard superscript.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * @see #SUPERSCRIPT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
    public static final Integer SUPERSCRIPT_SUPER =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
        Integer.valueOf(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * Standard subscript.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * @see #SUPERSCRIPT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
    public static final Integer SUPERSCRIPT_SUB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
        Integer.valueOf(-1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * Attribute key used to provide the font to use to render text.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * Values are instances of {@link java.awt.Font}.  The default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * value is null, indicating that normal resolution of a
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   613
     * {@code Font} from attributes should be performed.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   615
     * <p>{@code TextLayout} and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   616
     * {@code AttributedCharacterIterator} work in terms of
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   617
     * {@code Maps} of {@code TextAttributes}.  Normally,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * all the attributes are examined and used to select and
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   619
     * configure a {@code Font} instance.  If a {@code FONT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   620
     * attribute is present, though, its associated {@code Font}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * will be used.  This provides a way for users to override the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   622
     * resolution of font attributes into a {@code Font}, or
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   623
     * force use of a particular {@code Font} instance.  This
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   624
     * also allows users to specify subclasses of {@code Font} in
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   625
     * cases where a {@code Font} can be subclassed.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   627
     * <p>{@code FONT} is used for special situations where
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   628
     * clients already have a {@code Font} instance but still
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   629
     * need to use {@code Map}-based APIs.  Typically, there will
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   630
     * be no other attributes in the {@code Map} except the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   631
     * {@code FONT} attribute.  With {@code Map}-based APIs
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     * the common case is to specify all attributes individually, so
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   633
     * {@code FONT} is not needed or desirable.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   635
     * <p>However, if both {@code FONT} and other attributes are
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   636
     * present in the {@code Map}, the rendering system will
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   637
     * merge the attributes defined in the {@code Font} with the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * additional attributes.  This merging process classifies
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   639
     * {@code TextAttributes} into two groups.  One group, the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * 'primary' group, is considered fundamental to the selection and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * metric behavior of a font.  These attributes are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   642
     * {@code FAMILY}, {@code WEIGHT}, {@code WIDTH},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   643
     * {@code POSTURE}, {@code SIZE},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   644
     * {@code TRANSFORM}, {@code SUPERSCRIPT}, and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   645
     * {@code TRACKING}. The other group, the 'secondary' group,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * consists of all other defined attributes, with the exception of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   647
     * {@code FONT} itself.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   649
     * <p>To generate the new {@code Map}, first the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   650
     * {@code Font} is obtained from the {@code FONT}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * attribute, and <em>all</em> of its attributes extracted into a
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   652
     * new {@code Map}.  Then only the <em>secondary</em>
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   653
     * attributes from the original {@code Map} are added to
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   654
     * those in the new {@code Map}.  Thus the values of primary
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   655
     * attributes come solely from the {@code Font}, and the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * values of secondary attributes originate with the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   657
     * {@code Font} but can be overridden by other values in the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   658
     * {@code Map}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     *
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   660
     * <p><em>Note:</em>{@code Font's Map}-based
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   661
     * constructor and {@code deriveFont} methods do not process
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   662
     * the {@code FONT} attribute, as these are used to create
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   663
     * new {@code Font} objects.  Instead, {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * java.awt.Font#getFont(Map) Font.getFont(Map)} should be used to
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   665
     * handle the {@code FONT} attribute.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * @see java.awt.Font
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
    public static final TextAttribute FONT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
        new TextAttribute("font");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     * Attribute key for a user-defined glyph to display in lieu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * of the font's standard glyph for a character.  Values are
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
   675
     * instances of GraphicAttribute.  The default value is null,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     * indicating that the standard glyphs provided by the font
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     * should be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * <p>This attribute is used to reserve space for a graphic or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * other component embedded in a line of text.  It is required for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * correct positioning of 'inline' components within a line when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * bidirectional reordering (see {@link java.text.Bidi}) is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * performed.  Each character (Unicode code point) will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * rendered using the provided GraphicAttribute. Typically, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * characters to which this attribute is applied should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * <code>&#92;uFFFC</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * <p>The GraphicAttribute determines the logical and visual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * bounds of the text; the actual Font values are ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * @see GraphicAttribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
    public static final TextAttribute CHAR_REPLACEMENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
        new TextAttribute("char_replacement");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
    // Adornments added to text.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * Attribute key for the paint used to render the text.  Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   702
     * instances of <b>{@code Paint}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   703
     * null, indicating that the {@code Paint} set on the
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   704
     * {@code Graphics2D} at the time of rendering is used.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * <p>Glyphs will be rendered using this
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   707
     * {@code Paint} regardless of the {@code Paint} value
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   708
     * set on the {@code Graphics} (but see {@link #SWAP_COLORS}).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * @see java.awt.Paint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * @see #SWAP_COLORS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
    public static final TextAttribute FOREGROUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
        new TextAttribute("foreground");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     * Attribute key for the paint used to render the background of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   718
     * the text.  Values are instances of <b>{@code Paint}</b>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * The default value is null, indicating that the background
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * should not be rendered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * <p>The logical bounds of the text will be filled using this
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   723
     * {@code Paint}, and then the text will be rendered on top
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * of it (but see {@link #SWAP_COLORS}).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * <p>The visual bounds of the text is extended to include the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * logical bounds, if necessary.  The outline is not affected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * @see java.awt.Paint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * @see #SWAP_COLORS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
    public static final TextAttribute BACKGROUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
        new TextAttribute("background");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * Attribute key for underline.  Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   737
     * <b>{@code Integer}</b>.  The default value is -1, which
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * means no underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     * <p>The constant value {@link #UNDERLINE_ON} is provided.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     * <p>The underline affects both the visual bounds and the outline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * of the text.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
    public static final TextAttribute UNDERLINE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
        new TextAttribute("underline");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * Standard underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * @see #UNDERLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
    public static final Integer UNDERLINE_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
        Integer.valueOf(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * Attribute key for strikethrough.  Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   758
     * <b>{@code Boolean}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   759
     * {@code false}, which means no strikethrough.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * <p>The constant value {@link #STRIKETHROUGH_ON} is provided.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * <p>The strikethrough affects both the visual bounds and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     * outline of the text.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
    public static final TextAttribute STRIKETHROUGH =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
        new TextAttribute("strikethrough");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * A single strikethrough.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * @see #STRIKETHROUGH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
    public static final Boolean STRIKETHROUGH_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
        Boolean.TRUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
    // Attributes use to control layout of text on a line.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * Attribute key for the run direction of the line.  Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   783
     * instances of <b>{@code Boolean}</b>.  The default value is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     * null, which indicates that the standard Bidi algorithm for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     * determining run direction should be used with the value {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     * java.text.Bidi#DIRECTION_DEFAULT_LEFT_TO_RIGHT}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * <p>The constants {@link #RUN_DIRECTION_RTL} and {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * #RUN_DIRECTION_LTR} are provided.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * <p>This determines the value passed to the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * java.text.Bidi} constructor to select the primary direction of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * the text in the paragraph.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * <p><em>Note:</em> This attribute should have the same value for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * all the text in a paragraph, otherwise the behavior is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * undetermined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * @see java.text.Bidi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
    public static final TextAttribute RUN_DIRECTION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
        new TextAttribute("run_direction");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     * Left-to-right run direction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * @see #RUN_DIRECTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
    public static final Boolean RUN_DIRECTION_LTR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
        Boolean.FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     * Right-to-left run direction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * @see #RUN_DIRECTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
    public static final Boolean RUN_DIRECTION_RTL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
        Boolean.TRUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * Attribute key for the embedding level of the text.  Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   820
     * instances of <b>{@code Integer}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   821
     * {@code null}, indicating that the Bidirectional
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * algorithm should run without explicit embeddings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * <p>Positive values 1 through 61 are <em>embedding</em> levels,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * negative values -1 through -61 are <em>override</em> levels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * The value 0 means that the base line direction is used.  These
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * levels are passed in the embedding levels array to the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * java.text.Bidi} constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * <p><em>Note:</em> When this attribute is present anywhere in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * a paragraph, then any Unicode bidi control characters (RLO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * LRO, RLE, LRE, and PDF) in the paragraph are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * disregarded, and runs of text where this attribute is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * present are treated as though it were present and had the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * @see java.text.Bidi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
    public static final TextAttribute BIDI_EMBEDDING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
        new TextAttribute("bidi_embedding");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * Attribute key for the justification of a paragraph.  Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   844
     * instances of <b>{@code Number}</b>.  The default value is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     * 1, indicating that justification should use the full width
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * provided.  Values are pinned to the range [0..1].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * <p>The constants {@link #JUSTIFICATION_FULL} and {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     * #JUSTIFICATION_NONE} are provided.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     * <p>Specifies the fraction of the extra space to use when
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   852
     * justification is requested on a {@code TextLayout}. For
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * example, if the line is 50 points wide and it is requested to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * justify to 70 points, a value of 0.75 will pad to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     * three-quarters of the remaining space, or 15 points, so that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * the resulting line will be 65 points in length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * <p><em>Note:</em> This should have the same value for all the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * text in a paragraph, otherwise the behavior is undetermined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * @see TextLayout#getJustifiedLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
    public static final TextAttribute JUSTIFICATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
        new TextAttribute("justification");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     * Justify the line to the full requested width.  This is the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   868
     * default value for {@code JUSTIFICATION}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
     * @see #JUSTIFICATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
    public static final Float JUSTIFICATION_FULL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
        Float.valueOf(1.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * Do not allow the line to be justified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * @see #JUSTIFICATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
    public static final Float JUSTIFICATION_NONE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
        Float.valueOf(0.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
    // For use by input method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * Attribute key for input method highlight styles.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * <p>Values are instances of {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * java.awt.im.InputMethodHighlight} or {@link
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   890
     * java.text.Annotation}.  The default value is {@code null},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * which means that input method styles should not be applied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * before rendering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * <p>If adjacent runs of text with the same
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   895
     * {@code InputMethodHighlight} need to be rendered
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   896
     * separately, the {@code InputMethodHighlights} should be
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   897
     * wrapped in {@code Annotation} instances.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     * <p>Input method highlights are used while text is being
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     * composed by an input method. Text editing components should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     * retain them even if they generally only deal with unstyled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     * text, and make them available to the drawing routines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * @see java.awt.Font
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     * @see java.awt.im.InputMethodHighlight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * @see java.text.Annotation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
    public static final TextAttribute INPUT_METHOD_HIGHLIGHT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
        new TextAttribute("input method highlight");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * Attribute key for input method underlines.  Values
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   913
     * are instances of <b>{@code Integer}</b>.  The default
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   914
     * value is {@code -1}, which means no underline.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     * <p>Several constant values are provided, see {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * #UNDERLINE_LOW_ONE_PIXEL}, {@link #UNDERLINE_LOW_TWO_PIXEL},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * {@link #UNDERLINE_LOW_DOTTED}, {@link #UNDERLINE_LOW_GRAY}, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * {@link #UNDERLINE_LOW_DASHED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * <p>This may be used in conjunction with {@link #UNDERLINE} if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * desired.  The primary purpose is for use by input methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * Other use of these underlines for simple ornamentation might
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     * confuse users.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * <p>The input method underline affects both the visual bounds and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * the outline of the text.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
    public static final TextAttribute INPUT_METHOD_UNDERLINE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
        new TextAttribute("input method underline");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * Single pixel solid low underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * @see #INPUT_METHOD_UNDERLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
    public static final Integer UNDERLINE_LOW_ONE_PIXEL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
        Integer.valueOf(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     * Double pixel solid low underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * @see #INPUT_METHOD_UNDERLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
    public static final Integer UNDERLINE_LOW_TWO_PIXEL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
        Integer.valueOf(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * Single pixel dotted low underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     * @see #INPUT_METHOD_UNDERLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
    public static final Integer UNDERLINE_LOW_DOTTED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
        Integer.valueOf(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     * Double pixel gray low underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     * @see #INPUT_METHOD_UNDERLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
    public static final Integer UNDERLINE_LOW_GRAY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
        Integer.valueOf(4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     * Single pixel dashed low underline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * @see #INPUT_METHOD_UNDERLINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
    public static final Integer UNDERLINE_LOW_DASHED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
        Integer.valueOf(5);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * Attribute key for swapping foreground and background
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   976
     * {@code Paints}.  Values are instances of
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   977
     * <b>{@code Boolean}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   978
     * {@code false}, which means do not swap colors.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     * <p>The constant value {@link #SWAP_COLORS_ON} is defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
     * <p>If the {@link #FOREGROUND} attribute is set, its
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   983
     * {@code Paint} will be used as the background, otherwise
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   984
     * the {@code Paint} currently on the {@code Graphics}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     * will be used.  If the {@link #BACKGROUND} attribute is set, its
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
   986
     * {@code Paint} will be used as the foreground, otherwise
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * the system will find a contrasting color to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * (resolved) background so that the text will be visible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     * @see #FOREGROUND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * @see #BACKGROUND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
    public static final TextAttribute SWAP_COLORS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
        new TextAttribute("swap_colors");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     * Swap foreground and background.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * @see #SWAP_COLORS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
    public static final Boolean SWAP_COLORS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
        Boolean.TRUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     * Attribute key for converting ASCII decimal digits to other
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     * decimal ranges.  Values are instances of {@link NumericShaper}.
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1007
     * The default is {@code null}, which means do not perform
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     * numeric shaping.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     * <p>When a numeric shaper is defined, the text is first
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     * processed by the shaper before any other analysis of the text
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     * is performed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * <p><em>Note:</em> This should have the same value for all the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     * text in the paragraph, otherwise the behavior is undetermined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * @see NumericShaper
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
    public static final TextAttribute NUMERIC_SHAPING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
        new TextAttribute("numeric_shaping");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * Attribute key to request kerning. Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1025
     * <b>{@code Integer}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1026
     * {@code 0}, which does not request kerning.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     * <p>The constant value {@link #KERNING_ON} is provided.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     * <p>The default advances of single characters are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * appropriate for some character sequences, for example "To" or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     * "AWAY".  Without kerning the adjacent characters appear to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     * separated by too much space.  Kerning causes selected sequences
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     * of characters to be spaced differently for a more pleasing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
     * visual appearance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
    public static final TextAttribute KERNING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
        new TextAttribute("kerning");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
     * Request standard kerning.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
     * @see #KERNING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
    public static final Integer KERNING_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
        Integer.valueOf(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
     * Attribute key for enabling optional ligatures. Values are
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1053
     * instances of <b>{@code Integer}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1054
     * {@code 0}, which means do not use optional ligatures.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
     * <p>The constant value {@link #LIGATURES_ON} is defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
     * <p>Ligatures required by the writing system are always enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
    public static final TextAttribute LIGATURES =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
        new TextAttribute("ligatures");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * Request standard optional ligatures.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     * @see #LIGATURES
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
    public static final Integer LIGATURES_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
        Integer.valueOf(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
     * Attribute key to control tracking.  Values are instances of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1075
     * <b>{@code Number}</b>.  The default value is
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1076
     * {@code 0}, which means no additional tracking.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
     * <p>The constant values {@link #TRACKING_TIGHT} and {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
     * #TRACKING_LOOSE} are provided.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
     * <p>The tracking value is multiplied by the font point size and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
     * passed through the font transform to determine an additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
     * amount to add to the advance of each glyph cluster.  Positive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
     * tracking values will inhibit formation of optional ligatures.
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1085
     * Tracking values are typically between {@code -0.1} and
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32834
diff changeset
  1086
     * {@code 0.3}; values outside this range are generally not
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
  1087
     * desirable.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
    public static final TextAttribute TRACKING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
        new TextAttribute("tracking");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
     * Perform tight tracking.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
     * @see #TRACKING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
    public static final Float TRACKING_TIGHT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
        Float.valueOf(-.04f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
     * Perform loose tracking.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
     * @see #TRACKING
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
    public static final Float TRACKING_LOOSE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
        Float.valueOf(.04f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
}