KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fonts > truetype > TTFCmapEntry


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: TTFCmapEntry.java 426576 2006-07-28 15:44:37Z jeremias $ */
19  
20 package org.apache.fop.fonts.truetype;
21
22 /**
23  * The CMap entry contains information of a Unicode range and the
24  * the glyph indexes related to the range
25  */

26 public class TTFCmapEntry {
27
28     private int unicodeStart;
29     private int unicodeEnd;
30     private int glyphStartIndex;
31
32     TTFCmapEntry() {
33         unicodeStart = 0;
34         unicodeEnd = 0;
35         glyphStartIndex = 0;
36     }
37
38     TTFCmapEntry(int unicodeStart, int unicodeEnd, int glyphStartIndex) {
39         this.unicodeStart = unicodeStart;
40         this.unicodeEnd = unicodeEnd;
41         this.glyphStartIndex = glyphStartIndex;
42     }
43
44     /**
45      * @see java.lang.Object#equals(Object)
46      */

47     public boolean equals(Object JavaDoc o) {
48         if (o instanceof TTFCmapEntry) {
49             TTFCmapEntry ce = (TTFCmapEntry)o;
50             if (ce.unicodeStart == this.unicodeStart
51                     && ce.unicodeEnd == this.unicodeEnd
52                     && ce.glyphStartIndex == this.glyphStartIndex) {
53                 return true;
54             }
55         }
56         return false;
57     }
58
59     /**
60      * Returns the glyphStartIndex.
61      * @return int
62      */

63     public int getGlyphStartIndex() {
64         return glyphStartIndex;
65     }
66
67     /**
68      * Returns the unicodeEnd.
69      * @return int
70      */

71     public int getUnicodeEnd() {
72         return unicodeEnd;
73     }
74
75     /**
76      * Returns the unicodeStart.
77      * @return int
78      */

79     public int getUnicodeStart() {
80         return unicodeStart;
81     }
82
83     /**
84      * Sets the glyphStartIndex.
85      * @param glyphStartIndex The glyphStartIndex to set
86      */

87     public void setGlyphStartIndex(int glyphStartIndex) {
88         this.glyphStartIndex = glyphStartIndex;
89     }
90
91     /**
92      * Sets the unicodeEnd.
93      * @param unicodeEnd The unicodeEnd to set
94      */

95     public void setUnicodeEnd(int unicodeEnd) {
96         this.unicodeEnd = unicodeEnd;
97     }
98
99     /**
100      * Sets the unicodeStart.
101      * @param unicodeStart The unicodeStart to set
102      */

103     public void setUnicodeStart(int unicodeStart) {
104         this.unicodeStart = unicodeStart;
105     }
106
107 }
108
Popular Tags