geomerative 0.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/LICENSE +662 -0
- data/LICENSE.md +9 -0
- data/README.md +2 -0
- data/Rakefile +37 -0
- data/examples/README.md +7 -0
- data/examples/data/FreeSans.ttf +0 -0
- data/examples/data/ReplicaBold.ttf +0 -0
- data/examples/data/bot1.svg +160 -0
- data/examples/hello_svg_to_pdf.rb +26 -0
- data/examples/hello_world.rb +23 -0
- data/examples/physics_type.rb +77 -0
- data/examples/rotate_first_letter.rb +28 -0
- data/geomerative.gemspec +32 -0
- data/lib/geomerative.rb +12 -0
- data/lib/geomerative/version.rb +3 -0
- data/pom.xml +110 -0
- data/src/geomerative/FastRClip.java +2715 -0
- data/src/geomerative/RClip.java +2892 -0
- data/src/geomerative/RClosest.java +64 -0
- data/src/geomerative/RCommand.java +1941 -0
- data/src/geomerative/RContour.java +348 -0
- data/src/geomerative/RFont.java +583 -0
- data/src/geomerative/RG.java +753 -0
- data/src/geomerative/RGeomElem.java +1075 -0
- data/src/geomerative/RGroup.java +888 -0
- data/src/geomerative/RMatrix.java +401 -0
- data/src/geomerative/RMesh.java +420 -0
- data/src/geomerative/RPath.java +1095 -0
- data/src/geomerative/RPoint.java +419 -0
- data/src/geomerative/RPolygon.java +1110 -0
- data/src/geomerative/RRectangle.java +91 -0
- data/src/geomerative/RSVG.java +976 -0
- data/src/geomerative/RShape.java +2045 -0
- data/src/geomerative/RStrip.java +221 -0
- data/src/geomerative/RStyle.java +469 -0
- data/src/org/apache/batik/svggen/font/.SVGFont.java.swp +0 -0
- data/src/org/apache/batik/svggen/font/Font.java +188 -0
- data/src/org/apache/batik/svggen/font/Glyph.java +113 -0
- data/src/org/apache/batik/svggen/font/Messages.java.bak +72 -0
- data/src/org/apache/batik/svggen/font/Point.java +38 -0
- data/src/org/apache/batik/svggen/font/RandomAccessFileEmulator.java +15 -0
- data/src/org/apache/batik/svggen/font/table/ClassDef.java +42 -0
- data/src/org/apache/batik/svggen/font/table/ClassDefFormat1.java +55 -0
- data/src/org/apache/batik/svggen/font/table/ClassDefFormat2.java +49 -0
- data/src/org/apache/batik/svggen/font/table/CmapFormat.java +81 -0
- data/src/org/apache/batik/svggen/font/table/CmapFormat0.java +60 -0
- data/src/org/apache/batik/svggen/font/table/CmapFormat2.java +48 -0
- data/src/org/apache/batik/svggen/font/table/CmapFormat4.java +147 -0
- data/src/org/apache/batik/svggen/font/table/CmapFormat6.java +60 -0
- data/src/org/apache/batik/svggen/font/table/CmapIndexEntry.java +84 -0
- data/src/org/apache/batik/svggen/font/table/CmapTable.java +87 -0
- data/src/org/apache/batik/svggen/font/table/Coverage.java +50 -0
- data/src/org/apache/batik/svggen/font/table/CoverageFormat1.java +59 -0
- data/src/org/apache/batik/svggen/font/table/CoverageFormat2.java +56 -0
- data/src/org/apache/batik/svggen/font/table/CvtTable.java +48 -0
- data/src/org/apache/batik/svggen/font/table/Device.java +63 -0
- data/src/org/apache/batik/svggen/font/table/DirectoryEntry.java +73 -0
- data/src/org/apache/batik/svggen/font/table/Feature.java +56 -0
- data/src/org/apache/batik/svggen/font/table/FeatureList.java +70 -0
- data/src/org/apache/batik/svggen/font/table/FeatureRecord.java +52 -0
- data/src/org/apache/batik/svggen/font/table/FeatureTags.java +30 -0
- data/src/org/apache/batik/svggen/font/table/FpgmTable.java +38 -0
- data/src/org/apache/batik/svggen/font/table/GlyfCompositeComp.java +165 -0
- data/src/org/apache/batik/svggen/font/table/GlyfCompositeDescript.java +160 -0
- data/src/org/apache/batik/svggen/font/table/GlyfDescript.java +79 -0
- data/src/org/apache/batik/svggen/font/table/GlyfSimpleDescript.java +155 -0
- data/src/org/apache/batik/svggen/font/table/GlyfTable.java +111 -0
- data/src/org/apache/batik/svggen/font/table/GlyphDescription.java +39 -0
- data/src/org/apache/batik/svggen/font/table/GposTable.java +80 -0
- data/src/org/apache/batik/svggen/font/table/GsubTable.java +118 -0
- data/src/org/apache/batik/svggen/font/table/HeadTable.java +159 -0
- data/src/org/apache/batik/svggen/font/table/HheaTable.java +109 -0
- data/src/org/apache/batik/svggen/font/table/HmtxTable.java +99 -0
- data/src/org/apache/batik/svggen/font/table/KernSubtable.java +58 -0
- data/src/org/apache/batik/svggen/font/table/KernSubtableFormat0.java +65 -0
- data/src/org/apache/batik/svggen/font/table/KernSubtableFormat2.java +56 -0
- data/src/org/apache/batik/svggen/font/table/KernTable.java +64 -0
- data/src/org/apache/batik/svggen/font/table/KerningPair.java +53 -0
- data/src/org/apache/batik/svggen/font/table/LangSys.java +58 -0
- data/src/org/apache/batik/svggen/font/table/LangSysRecord.java +52 -0
- data/src/org/apache/batik/svggen/font/table/Ligature.java +57 -0
- data/src/org/apache/batik/svggen/font/table/LigatureSet.java +55 -0
- data/src/org/apache/batik/svggen/font/table/LigatureSubst.java +40 -0
- data/src/org/apache/batik/svggen/font/table/LigatureSubstFormat1.java +63 -0
- data/src/org/apache/batik/svggen/font/table/LocaTable.java +72 -0
- data/src/org/apache/batik/svggen/font/table/Lookup.java +77 -0
- data/src/org/apache/batik/svggen/font/table/LookupList.java +68 -0
- data/src/org/apache/batik/svggen/font/table/LookupSubtable.java +27 -0
- data/src/org/apache/batik/svggen/font/table/LookupSubtableFactory.java +31 -0
- data/src/org/apache/batik/svggen/font/table/MaxpTable.java +124 -0
- data/src/org/apache/batik/svggen/font/table/NameRecord.java +98 -0
- data/src/org/apache/batik/svggen/font/table/NameTable.java +67 -0
- data/src/org/apache/batik/svggen/font/table/Os2Table.java +232 -0
- data/src/org/apache/batik/svggen/font/table/Panose.java +108 -0
- data/src/org/apache/batik/svggen/font/table/PostTable.java +379 -0
- data/src/org/apache/batik/svggen/font/table/PrepTable.java +38 -0
- data/src/org/apache/batik/svggen/font/table/Program.java +49 -0
- data/src/org/apache/batik/svggen/font/table/RangeRecord.java +57 -0
- data/src/org/apache/batik/svggen/font/table/Script.java +72 -0
- data/src/org/apache/batik/svggen/font/table/ScriptList.java +78 -0
- data/src/org/apache/batik/svggen/font/table/ScriptRecord.java +52 -0
- data/src/org/apache/batik/svggen/font/table/ScriptTags.java +28 -0
- data/src/org/apache/batik/svggen/font/table/SingleSubst.java +47 -0
- data/src/org/apache/batik/svggen/font/table/SingleSubstFormat1.java +67 -0
- data/src/org/apache/batik/svggen/font/table/SingleSubstFormat2.java +67 -0
- data/src/org/apache/batik/svggen/font/table/Table.java +204 -0
- data/src/org/apache/batik/svggen/font/table/TableDirectory.java +94 -0
- data/src/org/apache/batik/svggen/font/table/TableFactory.java +121 -0
- metadata +206 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001 The Apache Software Foundation
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
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
|
+
package org.apache.batik.svggen.font.table;
|
19
|
+
|
20
|
+
/**
|
21
|
+
*
|
22
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
23
|
+
* @version $Id: LookupSubtable.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
24
|
+
*/
|
25
|
+
public abstract class LookupSubtable {
|
26
|
+
|
27
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001 The Apache Software Foundation
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
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
|
+
package org.apache.batik.svggen.font.table;
|
19
|
+
|
20
|
+
import java.io.IOException;
|
21
|
+
import org.apache.batik.svggen.font.*;
|
22
|
+
|
23
|
+
/**
|
24
|
+
*
|
25
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
26
|
+
* @version $Id: LookupSubtableFactory.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public interface LookupSubtableFactory {
|
29
|
+
public LookupSubtable read(int type, RandomAccessFileEmulator raf, int offset)
|
30
|
+
throws IOException;
|
31
|
+
}
|
@@ -0,0 +1,124 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001 The Apache Software Foundation
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
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
|
+
package org.apache.batik.svggen.font.table;
|
19
|
+
|
20
|
+
import java.io.IOException;
|
21
|
+
import org.apache.batik.svggen.font.*;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @version $Id: MaxpTable.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
25
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
26
|
+
*/
|
27
|
+
public class MaxpTable implements Table {
|
28
|
+
|
29
|
+
private final int versionNumber;
|
30
|
+
private final int numGlyphs;
|
31
|
+
private final int maxPoints;
|
32
|
+
private final int maxContours;
|
33
|
+
private final int maxCompositePoints;
|
34
|
+
private final int maxCompositeContours;
|
35
|
+
private final int maxZones;
|
36
|
+
private final int maxTwilightPoints;
|
37
|
+
private final int maxStorage;
|
38
|
+
private final int maxFunctionDefs;
|
39
|
+
private final int maxInstructionDefs;
|
40
|
+
private final int maxStackElements;
|
41
|
+
private final int maxSizeOfInstructions;
|
42
|
+
private final int maxComponentElements;
|
43
|
+
private final int maxComponentDepth;
|
44
|
+
|
45
|
+
protected MaxpTable(DirectoryEntry de,RandomAccessFileEmulator raf) throws IOException {
|
46
|
+
raf.seek(de.getOffset());
|
47
|
+
versionNumber = raf.readInt();
|
48
|
+
numGlyphs = raf.readUnsignedShort();
|
49
|
+
maxPoints = raf.readUnsignedShort();
|
50
|
+
maxContours = raf.readUnsignedShort();
|
51
|
+
maxCompositePoints = raf.readUnsignedShort();
|
52
|
+
maxCompositeContours = raf.readUnsignedShort();
|
53
|
+
maxZones = raf.readUnsignedShort();
|
54
|
+
maxTwilightPoints = raf.readUnsignedShort();
|
55
|
+
maxStorage = raf.readUnsignedShort();
|
56
|
+
maxFunctionDefs = raf.readUnsignedShort();
|
57
|
+
maxInstructionDefs = raf.readUnsignedShort();
|
58
|
+
maxStackElements = raf.readUnsignedShort();
|
59
|
+
maxSizeOfInstructions = raf.readUnsignedShort();
|
60
|
+
maxComponentElements = raf.readUnsignedShort();
|
61
|
+
maxComponentDepth = raf.readUnsignedShort();
|
62
|
+
}
|
63
|
+
|
64
|
+
public int getMaxComponentDepth() {
|
65
|
+
return maxComponentDepth;
|
66
|
+
}
|
67
|
+
|
68
|
+
public int getMaxComponentElements() {
|
69
|
+
return maxComponentElements;
|
70
|
+
}
|
71
|
+
|
72
|
+
public int getMaxCompositeContours() {
|
73
|
+
return maxCompositeContours;
|
74
|
+
}
|
75
|
+
|
76
|
+
public int getMaxCompositePoints() {
|
77
|
+
return maxCompositePoints;
|
78
|
+
}
|
79
|
+
|
80
|
+
public int getMaxContours() {
|
81
|
+
return maxContours;
|
82
|
+
}
|
83
|
+
|
84
|
+
public int getMaxFunctionDefs() {
|
85
|
+
return maxFunctionDefs;
|
86
|
+
}
|
87
|
+
|
88
|
+
public int getMaxInstructionDefs() {
|
89
|
+
return maxInstructionDefs;
|
90
|
+
}
|
91
|
+
|
92
|
+
public int getMaxPoints() {
|
93
|
+
return maxPoints;
|
94
|
+
}
|
95
|
+
|
96
|
+
public int getMaxSizeOfInstructions() {
|
97
|
+
return maxSizeOfInstructions;
|
98
|
+
}
|
99
|
+
|
100
|
+
public int getMaxStackElements() {
|
101
|
+
return maxStackElements;
|
102
|
+
}
|
103
|
+
|
104
|
+
public int getMaxStorage() {
|
105
|
+
return maxStorage;
|
106
|
+
}
|
107
|
+
|
108
|
+
public int getMaxTwilightPoints() {
|
109
|
+
return maxTwilightPoints;
|
110
|
+
}
|
111
|
+
|
112
|
+
public int getMaxZones() {
|
113
|
+
return maxZones;
|
114
|
+
}
|
115
|
+
|
116
|
+
public int getNumGlyphs() {
|
117
|
+
return numGlyphs;
|
118
|
+
}
|
119
|
+
|
120
|
+
@Override
|
121
|
+
public int getType() {
|
122
|
+
return maxp;
|
123
|
+
}
|
124
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001 The Apache Software Foundation
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
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
|
+
package org.apache.batik.svggen.font.table;
|
19
|
+
|
20
|
+
import java.io.IOException;
|
21
|
+
import org.apache.batik.svggen.font.*;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @version $Id: NameRecord.java,v 1.3 2004/08/18 07:15:22 vhardy Exp $
|
25
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
26
|
+
*/
|
27
|
+
public class NameRecord {
|
28
|
+
|
29
|
+
private final short platformId;
|
30
|
+
private final short encodingId;
|
31
|
+
private final short languageId;
|
32
|
+
private final short nameId;
|
33
|
+
private final short stringLength;
|
34
|
+
private final short stringOffset;
|
35
|
+
private String record;
|
36
|
+
|
37
|
+
protected NameRecord(RandomAccessFileEmulator raf) throws IOException {
|
38
|
+
platformId = raf.readShort();
|
39
|
+
encodingId = raf.readShort();
|
40
|
+
languageId = raf.readShort();
|
41
|
+
nameId = raf.readShort();
|
42
|
+
stringLength = raf.readShort();
|
43
|
+
stringOffset = raf.readShort();
|
44
|
+
}
|
45
|
+
|
46
|
+
public short getEncodingId() {
|
47
|
+
return encodingId;
|
48
|
+
}
|
49
|
+
|
50
|
+
public short getLanguageId() {
|
51
|
+
return languageId;
|
52
|
+
}
|
53
|
+
|
54
|
+
public short getNameId() {
|
55
|
+
return nameId;
|
56
|
+
}
|
57
|
+
|
58
|
+
public short getPlatformId() {
|
59
|
+
return platformId;
|
60
|
+
}
|
61
|
+
|
62
|
+
public String getRecordString() {
|
63
|
+
return record;
|
64
|
+
}
|
65
|
+
|
66
|
+
protected void loadString(RandomAccessFileEmulator raf, int stringStorageOffset) throws IOException {
|
67
|
+
StringBuilder sb = new StringBuilder();
|
68
|
+
raf.seek(stringStorageOffset + stringOffset);
|
69
|
+
if (platformId == Table.platformAppleUnicode) {
|
70
|
+
|
71
|
+
// Unicode (big-endian)
|
72
|
+
for (int i = 0; i < stringLength/2; i++) {
|
73
|
+
sb.append(raf.readChar());
|
74
|
+
}
|
75
|
+
} else if (platformId == Table.platformMacintosh) {
|
76
|
+
|
77
|
+
// Macintosh encoding, ASCII
|
78
|
+
for (int i = 0; i < stringLength; i++) {
|
79
|
+
sb.append((char) raf.readByte());
|
80
|
+
}
|
81
|
+
} else if (platformId == Table.platformISO) {
|
82
|
+
|
83
|
+
// ISO encoding, ASCII
|
84
|
+
for (int i = 0; i < stringLength; i++) {
|
85
|
+
sb.append((char) raf.readByte());
|
86
|
+
}
|
87
|
+
} else if (platformId == Table.platformMicrosoft) {
|
88
|
+
|
89
|
+
// Microsoft encoding, Unicode
|
90
|
+
char c;
|
91
|
+
for (int i = 0; i < stringLength/2; i++) {
|
92
|
+
c = raf.readChar();
|
93
|
+
sb.append(c);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
record = sb.toString();
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001 The Apache Software Foundation
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
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
|
+
package org.apache.batik.svggen.font.table;
|
19
|
+
|
20
|
+
import java.io.IOException;
|
21
|
+
import org.apache.batik.svggen.font.*;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @version $Id: NameTable.java,v 1.3 2004/08/18 07:15:22 vhardy Exp $
|
25
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
26
|
+
*/
|
27
|
+
public class NameTable implements Table {
|
28
|
+
|
29
|
+
private final short formatSelector;
|
30
|
+
private final short numberOfNameRecords;
|
31
|
+
private final short stringStorageOffset;
|
32
|
+
private final NameRecord[] records;
|
33
|
+
|
34
|
+
protected NameTable(DirectoryEntry de,RandomAccessFileEmulator raf) throws IOException {
|
35
|
+
raf.seek(de.getOffset());
|
36
|
+
formatSelector = raf.readShort();
|
37
|
+
numberOfNameRecords = raf.readShort();
|
38
|
+
stringStorageOffset = raf.readShort();
|
39
|
+
records = new NameRecord[numberOfNameRecords];
|
40
|
+
|
41
|
+
// Load the records, which contain the encoding information and string offsets
|
42
|
+
for (int i = 0; i < numberOfNameRecords; i++) {
|
43
|
+
records[i] = new NameRecord(raf);
|
44
|
+
}
|
45
|
+
|
46
|
+
// Now load the strings
|
47
|
+
for (int i = 0; i < numberOfNameRecords; i++) {
|
48
|
+
records[i].loadString(raf, de.getOffset() + stringStorageOffset);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
public String getRecord(short nameId) {
|
53
|
+
|
54
|
+
// Search for the first instance of this name ID
|
55
|
+
for (int i = 0; i < numberOfNameRecords; i++) {
|
56
|
+
if (records[i].getNameId() == nameId) {
|
57
|
+
return records[i].getRecordString();
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return "";
|
61
|
+
}
|
62
|
+
|
63
|
+
@Override
|
64
|
+
public int getType() {
|
65
|
+
return name;
|
66
|
+
}
|
67
|
+
}
|
@@ -0,0 +1,232 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001 The Apache Software Foundation
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
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
|
+
package org.apache.batik.svggen.font.table;
|
19
|
+
|
20
|
+
import java.io.IOException;
|
21
|
+
import org.apache.batik.svggen.font.*;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @version $Id: Os2Table.java,v 1.3 2004/08/18 07:15:22 vhardy Exp $
|
25
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
26
|
+
*/
|
27
|
+
public class Os2Table implements Table {
|
28
|
+
|
29
|
+
private final int version;
|
30
|
+
private final short xAvgCharWidth;
|
31
|
+
private final int usWeightClass;
|
32
|
+
private final int usWidthClass;
|
33
|
+
private final short fsType;
|
34
|
+
private final short ySubscriptXSize;
|
35
|
+
private final short ySubscriptYSize;
|
36
|
+
private final short ySubscriptXOffset;
|
37
|
+
private final short ySubscriptYOffset;
|
38
|
+
private final short ySuperscriptXSize;
|
39
|
+
private final short ySuperscriptYSize;
|
40
|
+
private final short ySuperscriptXOffset;
|
41
|
+
private final short ySuperscriptYOffset;
|
42
|
+
private final short yStrikeoutSize;
|
43
|
+
private final short yStrikeoutPosition;
|
44
|
+
private final short sFamilyClass;
|
45
|
+
private final Panose panose;
|
46
|
+
private final int ulUnicodeRange1;
|
47
|
+
private final int ulUnicodeRange2;
|
48
|
+
private final int ulUnicodeRange3;
|
49
|
+
private final int ulUnicodeRange4;
|
50
|
+
private final int achVendorID;
|
51
|
+
private final short fsSelection;
|
52
|
+
private final int usFirstCharIndex;
|
53
|
+
private final int usLastCharIndex;
|
54
|
+
private final short sTypoAscender;
|
55
|
+
private final short sTypoDescender;
|
56
|
+
private final short sTypoLineGap;
|
57
|
+
private final int usWinAscent;
|
58
|
+
private final int usWinDescent;
|
59
|
+
private final int ulCodePageRange1;
|
60
|
+
private final int ulCodePageRange2;
|
61
|
+
|
62
|
+
protected Os2Table(DirectoryEntry de,RandomAccessFileEmulator raf) throws IOException {
|
63
|
+
raf.seek(de.getOffset());
|
64
|
+
version = raf.readUnsignedShort();
|
65
|
+
xAvgCharWidth = raf.readShort();
|
66
|
+
usWeightClass = raf.readUnsignedShort();
|
67
|
+
usWidthClass = raf.readUnsignedShort();
|
68
|
+
fsType = raf.readShort();
|
69
|
+
ySubscriptXSize = raf.readShort();
|
70
|
+
ySubscriptYSize = raf.readShort();
|
71
|
+
ySubscriptXOffset = raf.readShort();
|
72
|
+
ySubscriptYOffset = raf.readShort();
|
73
|
+
ySuperscriptXSize = raf.readShort();
|
74
|
+
ySuperscriptYSize = raf.readShort();
|
75
|
+
ySuperscriptXOffset = raf.readShort();
|
76
|
+
ySuperscriptYOffset = raf.readShort();
|
77
|
+
yStrikeoutSize = raf.readShort();
|
78
|
+
yStrikeoutPosition = raf.readShort();
|
79
|
+
sFamilyClass = raf.readShort();
|
80
|
+
byte[] buf = new byte[10];
|
81
|
+
raf.read(buf);
|
82
|
+
panose = new Panose(buf);
|
83
|
+
ulUnicodeRange1 = raf.readInt();
|
84
|
+
ulUnicodeRange2 = raf.readInt();
|
85
|
+
ulUnicodeRange3 = raf.readInt();
|
86
|
+
ulUnicodeRange4 = raf.readInt();
|
87
|
+
achVendorID = raf.readInt();
|
88
|
+
fsSelection = raf.readShort();
|
89
|
+
usFirstCharIndex = raf.readUnsignedShort();
|
90
|
+
usLastCharIndex = raf.readUnsignedShort();
|
91
|
+
sTypoAscender = raf.readShort();
|
92
|
+
sTypoDescender = raf.readShort();
|
93
|
+
sTypoLineGap = raf.readShort();
|
94
|
+
usWinAscent = raf.readUnsignedShort();
|
95
|
+
usWinDescent = raf.readUnsignedShort();
|
96
|
+
ulCodePageRange1 = raf.readInt();
|
97
|
+
ulCodePageRange2 = raf.readInt();
|
98
|
+
}
|
99
|
+
|
100
|
+
public int getVersion() {
|
101
|
+
return version;
|
102
|
+
}
|
103
|
+
|
104
|
+
public short getAvgCharWidth() {
|
105
|
+
return xAvgCharWidth;
|
106
|
+
}
|
107
|
+
|
108
|
+
public int getWeightClass() {
|
109
|
+
return usWeightClass;
|
110
|
+
}
|
111
|
+
|
112
|
+
public int getWidthClass() {
|
113
|
+
return usWidthClass;
|
114
|
+
}
|
115
|
+
|
116
|
+
public short getLicenseType() {
|
117
|
+
return fsType;
|
118
|
+
}
|
119
|
+
|
120
|
+
public short getSubscriptXSize() {
|
121
|
+
return ySubscriptXSize;
|
122
|
+
}
|
123
|
+
|
124
|
+
public short getSubscriptYSize() {
|
125
|
+
return ySubscriptYSize;
|
126
|
+
}
|
127
|
+
|
128
|
+
public short getSubscriptXOffset() {
|
129
|
+
return ySubscriptXOffset;
|
130
|
+
}
|
131
|
+
|
132
|
+
public short getSubscriptYOffset() {
|
133
|
+
return ySubscriptYOffset;
|
134
|
+
}
|
135
|
+
|
136
|
+
public short getSuperscriptXSize() {
|
137
|
+
return ySuperscriptXSize;
|
138
|
+
}
|
139
|
+
|
140
|
+
public short getSuperscriptYSize() {
|
141
|
+
return ySuperscriptYSize;
|
142
|
+
}
|
143
|
+
|
144
|
+
public short getSuperscriptXOffset() {
|
145
|
+
return ySuperscriptXOffset;
|
146
|
+
}
|
147
|
+
|
148
|
+
public short getSuperscriptYOffset() {
|
149
|
+
return ySuperscriptYOffset;
|
150
|
+
}
|
151
|
+
|
152
|
+
public short getStrikeoutSize() {
|
153
|
+
return yStrikeoutSize;
|
154
|
+
}
|
155
|
+
|
156
|
+
public short getStrikeoutPosition() {
|
157
|
+
return yStrikeoutPosition;
|
158
|
+
}
|
159
|
+
|
160
|
+
public short getFamilyClass() {
|
161
|
+
return sFamilyClass;
|
162
|
+
}
|
163
|
+
|
164
|
+
public Panose getPanose() {
|
165
|
+
return panose;
|
166
|
+
}
|
167
|
+
|
168
|
+
public int getUnicodeRange1() {
|
169
|
+
return ulUnicodeRange1;
|
170
|
+
}
|
171
|
+
|
172
|
+
public int getUnicodeRange2() {
|
173
|
+
return ulUnicodeRange2;
|
174
|
+
}
|
175
|
+
|
176
|
+
public int getUnicodeRange3() {
|
177
|
+
return ulUnicodeRange3;
|
178
|
+
}
|
179
|
+
|
180
|
+
public int getUnicodeRange4() {
|
181
|
+
return ulUnicodeRange4;
|
182
|
+
}
|
183
|
+
|
184
|
+
public int getVendorID() {
|
185
|
+
return achVendorID;
|
186
|
+
}
|
187
|
+
|
188
|
+
public short getSelection() {
|
189
|
+
return fsSelection;
|
190
|
+
}
|
191
|
+
|
192
|
+
public int getFirstCharIndex() {
|
193
|
+
return usFirstCharIndex;
|
194
|
+
}
|
195
|
+
|
196
|
+
public int getLastCharIndex() {
|
197
|
+
return usLastCharIndex;
|
198
|
+
}
|
199
|
+
|
200
|
+
public short getTypoAscender() {
|
201
|
+
return sTypoAscender;
|
202
|
+
}
|
203
|
+
|
204
|
+
public short getTypoDescender() {
|
205
|
+
return sTypoDescender;
|
206
|
+
}
|
207
|
+
|
208
|
+
public short getTypoLineGap() {
|
209
|
+
return sTypoLineGap;
|
210
|
+
}
|
211
|
+
|
212
|
+
public int getWinAscent() {
|
213
|
+
return usWinAscent;
|
214
|
+
}
|
215
|
+
|
216
|
+
public int getWinDescent() {
|
217
|
+
return usWinDescent;
|
218
|
+
}
|
219
|
+
|
220
|
+
public int getCodePageRange1() {
|
221
|
+
return ulCodePageRange1;
|
222
|
+
}
|
223
|
+
|
224
|
+
public int getCodePageRange2() {
|
225
|
+
return ulCodePageRange2;
|
226
|
+
}
|
227
|
+
|
228
|
+
@Override
|
229
|
+
public int getType() {
|
230
|
+
return OS_2;
|
231
|
+
}
|
232
|
+
}
|