KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > render > afp > fonts > AFPFont


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: AFPFont.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.render.afp.fonts;
21 import java.util.Map JavaDoc;
22 import org.apache.fop.fonts.FontType;
23 import org.apache.fop.fonts.Typeface;
24
25
26 /**
27  * All implemenations of AFP fonts should extend this base class,
28  * the object implements the FontMetrics information.
29  * <p/>
30  */

31 public abstract class AFPFont extends Typeface {
32
33     /** The font name */
34     protected String JavaDoc _name;
35
36     /**
37      * Constructor for the base font requires the name.
38      * @param name the name of the font
39      */

40     public AFPFont(String JavaDoc name) {
41
42         _name = name;
43
44     }
45
46     /**
47      * @return the name of the font.
48      */

49     public String JavaDoc getFontName() {
50         return _name;
51     }
52
53     /**
54      * Returns the type of the font.
55      * @return the font type
56      */

57     public FontType getFontType() {
58         return FontType.OTHER;
59     }
60
61     /**
62      * Indicates if the font has kering information.
63      * @return True, if kerning is available.
64      */

65     public boolean hasKerningInfo() {
66         return false;
67     }
68
69     /**
70      * Returns the kerning map for the font.
71      * @return the kerning map
72      */

73     public Map JavaDoc getKerningInfo() {
74         return null;
75     }
76
77     /**
78      * Returns the character set for a given size
79      * @param size the font size
80      * @return the character set object
81      */

82     public abstract CharacterSet getCharacterSet(int size);
83
84      /**
85      * Determines whether this font contains a particular character/glyph.
86      * @param c character to check
87      * @return True if the character is supported, Falso otherwise
88      */

89     public boolean hasChar(char c) {
90         return true;
91     }
92
93 }
Popular Tags