summaryrefslogtreecommitdiffstats
path: root/awt/java/awt/font/LineMetrics.java
blob: 4b03e5db2b0e23171a7d19b66206b2de31a943e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/**
 * @author Ilya S. Okomin
 * @version $Revision$
 */

package java.awt.font;

/**
 * The LineMetrics class provides information such as concerning how the text is
 * positioned with respect to the base line, such as ascent, descent, and
 * leading.
 * 
 * @since Android 1.0
 */
public abstract class LineMetrics {

    /**
     * Gets the baseline offsets of the text according to the the baseline of
     * this text.
     * 
     * @return the baseline offsets of the text according to the the baseline of
     *         this text.
     */
    public abstract float[] getBaselineOffsets();

    /**
     * Gets the number of characters of the text.
     * 
     * @return the number of characters of the text.
     */
    public abstract int getNumChars();

    /**
     * Gets the baseline index, returns one of the following index:
     * ROMAN_BASELINE, CENTER_BASELINE, HANGING_BASELINE.
     * 
     * @return the baseline index: ROMAN_BASELINE, CENTER_BASELINE or
     *         HANGING_BASELINE.
     */
    public abstract int getBaselineIndex();

    /**
     * Gets the thickness of the underline.
     * 
     * @return the thickness of the underline.
     */
    public abstract float getUnderlineThickness();

    /**
     * Gets the offset of the underline.
     * 
     * @return the offset of the underline.
     */
    public abstract float getUnderlineOffset();

    /**
     * Gets the thickness of strike through line.
     * 
     * @return the thickness of strike through line.
     */
    public abstract float getStrikethroughThickness();

    /**
     * Gets the offset of the strike through line.
     * 
     * @return the offset of the strike through line.
     */
    public abstract float getStrikethroughOffset();

    /**
     * Gets the leading of the text.
     * 
     * @return the leading of the text.
     */
    public abstract float getLeading();

    /**
     * Gets the height of the text as a sum of the ascent, the descent and the
     * leading.
     * 
     * @return the height of the text as a sum of the ascent, the descent and
     *         the leading.
     */
    public abstract float getHeight();

    /**
     * Gets the descent of the text.
     * 
     * @return the descent of the text.
     */
    public abstract float getDescent();

    /**
     * Gets the ascent of the text.
     * 
     * @return the ascent of the text.
     */
    public abstract float getAscent();

}