1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 /** 18 * @author Ilya S. Okomin 19 * @version $Revision$ 20 */ 21 22 package java.awt.font; 23 24 /** 25 * The LineMetrics class provides information such as concerning how the text is 26 * positioned with respect to the base line, such as ascent, descent, and 27 * leading. 28 * 29 * @since Android 1.0 30 */ 31 public abstract class LineMetrics { 32 33 /** 34 * Gets the baseline offsets of the text according to the the baseline of 35 * this text. 36 * 37 * @return the baseline offsets of the text according to the the baseline of 38 * this text. 39 */ getBaselineOffsets()40 public abstract float[] getBaselineOffsets(); 41 42 /** 43 * Gets the number of characters of the text. 44 * 45 * @return the number of characters of the text. 46 */ getNumChars()47 public abstract int getNumChars(); 48 49 /** 50 * Gets the baseline index, returns one of the following index: 51 * ROMAN_BASELINE, CENTER_BASELINE, HANGING_BASELINE. 52 * 53 * @return the baseline index: ROMAN_BASELINE, CENTER_BASELINE or 54 * HANGING_BASELINE. 55 */ getBaselineIndex()56 public abstract int getBaselineIndex(); 57 58 /** 59 * Gets the thickness of the underline. 60 * 61 * @return the thickness of the underline. 62 */ getUnderlineThickness()63 public abstract float getUnderlineThickness(); 64 65 /** 66 * Gets the offset of the underline. 67 * 68 * @return the offset of the underline. 69 */ getUnderlineOffset()70 public abstract float getUnderlineOffset(); 71 72 /** 73 * Gets the thickness of strike through line. 74 * 75 * @return the thickness of strike through line. 76 */ getStrikethroughThickness()77 public abstract float getStrikethroughThickness(); 78 79 /** 80 * Gets the offset of the strike through line. 81 * 82 * @return the offset of the strike through line. 83 */ getStrikethroughOffset()84 public abstract float getStrikethroughOffset(); 85 86 /** 87 * Gets the leading of the text. 88 * 89 * @return the leading of the text. 90 */ getLeading()91 public abstract float getLeading(); 92 93 /** 94 * Gets the height of the text as a sum of the ascent, the descent and the 95 * leading. 96 * 97 * @return the height of the text as a sum of the ascent, the descent and 98 * the leading. 99 */ getHeight()100 public abstract float getHeight(); 101 102 /** 103 * Gets the descent of the text. 104 * 105 * @return the descent of the text. 106 */ getDescent()107 public abstract float getDescent(); 108 109 /** 110 * Gets the ascent of the text. 111 * 112 * @return the ascent of the text. 113 */ getAscent()114 public abstract float getAscent(); 115 116 } 117