01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
10: http://www.apache.org/licenses/LICENSE-2.0
11:
12: Unless required by applicable law or agreed to in writing, software
13: distributed under the License is distributed on an "AS IS" BASIS,
14: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: See the License for the specific language governing permissions and
16: limitations under the License.
17:
18: */
19: package org.apache.batik.svggen.font.table;
20:
21: import java.io.ByteArrayInputStream;
22:
23: /**
24: * @version $Id: GlyfDescript.java 475477 2006-11-15 22:44:28Z cam $
25: * @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
26: */
27: public abstract class GlyfDescript extends Program implements
28: GlyphDescription {
29:
30: // flags
31: public static final byte onCurve = 0x01;
32: public static final byte xShortVector = 0x02;
33: public static final byte yShortVector = 0x04;
34: public static final byte repeat = 0x08;
35: public static final byte xDual = 0x10;
36: public static final byte yDual = 0x20;
37:
38: protected GlyfTable parentTable;
39: private int numberOfContours;
40: private short xMin;
41: private short yMin;
42: private short xMax;
43: private short yMax;
44:
45: protected GlyfDescript(GlyfTable parentTable,
46: short numberOfContours, ByteArrayInputStream bais) {
47: this .parentTable = parentTable;
48: this .numberOfContours = numberOfContours;
49: xMin = (short) (bais.read() << 8 | bais.read());
50: yMin = (short) (bais.read() << 8 | bais.read());
51: xMax = (short) (bais.read() << 8 | bais.read());
52: yMax = (short) (bais.read() << 8 | bais.read());
53: }
54:
55: public void resolve() {
56: }
57:
58: public int getNumberOfContours() {
59: return numberOfContours;
60: }
61:
62: public short getXMaximum() {
63: return xMax;
64: }
65:
66: public short getXMinimum() {
67: return xMin;
68: }
69:
70: public short getYMaximum() {
71: return yMax;
72: }
73:
74: public short getYMinimum() {
75: return yMin;
76: }
77: }
|