KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fonts > FontMetrics


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 /* $Id: FontMetrics.java 426576 2006-07-28 15:44:37Z jeremias $ */
19  
20 package org.apache.fop.fonts;
21
22 import java.util.Map JavaDoc;
23
24
25 /**
26  * Main interface for access to font metrics.
27  */

28 public interface FontMetrics {
29
30     /**
31      * Returns the font name.
32      * @return the font name
33      */

34     String JavaDoc getFontName();
35     
36     
37     /**
38      * Returns the type of the font.
39      * @return the font type
40      */

41     FontType getFontType();
42     
43
44     /**
45      * Returns the maximum ascent of the font described by this
46      * FontMetrics object. Note: This is not the same as getAscender().
47      * @param size font size
48      * @return ascent in milliponts
49      */

50     int getMaxAscent(int size);
51     
52     /**
53      * Returns the ascent of the font described by this
54      * FontMetrics object. It returns the nominal ascent within the em box.
55      * @param size font size
56      * @return ascent in milliponts
57      */

58     int getAscender(int size);
59     
60     /**
61      * Returns the size of a capital letter measured from the font's baseline.
62      * @param size font size
63      * @return height of capital characters
64      */

65     int getCapHeight(int size);
66     
67     
68     /**
69      * Returns the descent of the font described by this
70      * FontMetrics object.
71      * @param size font size
72      * @return descent in milliponts
73      */

74     int getDescender(int size);
75     
76     
77     /**
78      * Determines the typical font height of this
79      * FontMetrics object
80      * @param size font size
81      * @return font height in millipoints
82      */

83     int getXHeight(int size);
84
85     /**
86      * Return the width (in 1/1000ths of point size) of the character at
87      * code point i.
88      * @param i code point index
89      * @param size font size
90      * @return the width of the character
91      */

92     int getWidth(int i, int size);
93
94     /**
95      * Return the array of widths.
96      * <p>
97      * This is used to get an array for inserting in an output format.
98      * It should not be used for lookup.
99      * @return an array of widths
100      */

101     int[] getWidths();
102     
103     /**
104      * Indicates if the font has kering information.
105      * @return True, if kerning is available.
106      */

107     boolean hasKerningInfo();
108         
109     /**
110      * Returns the kerning map for the font.
111      * @return the kerning map
112      */

113     Map JavaDoc getKerningInfo();
114     
115 }
116
Popular Tags