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,99 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001,2003 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.ByteArrayInputStream;
|
21
|
+
import java.io.IOException;
|
22
|
+
import org.apache.batik.svggen.font.*;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @version $Id: HmtxTable.java,v 1.4 2004/08/18 07:15:21 vhardy Exp $
|
26
|
+
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
|
27
|
+
*/
|
28
|
+
public class HmtxTable implements Table {
|
29
|
+
|
30
|
+
private byte[] buf = null;
|
31
|
+
private int[] hMetrics = null;
|
32
|
+
private short[] leftSideBearing = null;
|
33
|
+
|
34
|
+
protected HmtxTable(DirectoryEntry de,RandomAccessFileEmulator raf) throws IOException {
|
35
|
+
raf.seek(de.getOffset());
|
36
|
+
buf = new byte[de.getLength()];
|
37
|
+
raf.read(buf);
|
38
|
+
/*
|
39
|
+
TableMaxp t_maxp = (TableMaxp) td.getEntryByTag(maxp).getTable();
|
40
|
+
TableHhea t_hhea = (TableHhea) td.getEntryByTag(hhea).getTable();
|
41
|
+
int lsbCount = t_maxp.getNumGlyphs() - t_hhea.getNumberOfHMetrics();
|
42
|
+
hMetrics = new int[t_hhea.getNumberOfHMetrics()];
|
43
|
+
for (int i = 0; i < t_hhea.getNumberOfHMetrics(); i++) {
|
44
|
+
hMetrics[i] = raf.readInt();
|
45
|
+
}
|
46
|
+
if (lsbCount > 0) {
|
47
|
+
leftSideBearing = new short[lsbCount];
|
48
|
+
for (int i = 0; i < lsbCount; i++) {
|
49
|
+
leftSideBearing[i] = raf.readShort();
|
50
|
+
}
|
51
|
+
}
|
52
|
+
*/
|
53
|
+
}
|
54
|
+
|
55
|
+
public void init(int numberOfHMetrics, int lsbCount) {
|
56
|
+
if (buf == null) {
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
hMetrics = new int[numberOfHMetrics];
|
60
|
+
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
|
61
|
+
for (int i = 0; i < numberOfHMetrics; i++) {
|
62
|
+
hMetrics[i] = (bais.read()<<24 | bais.read()<<16 |
|
63
|
+
bais.read()<< 8 | bais.read());
|
64
|
+
}
|
65
|
+
if (lsbCount > 0) {
|
66
|
+
leftSideBearing = new short[lsbCount];
|
67
|
+
for (int i = 0; i < lsbCount; i++) {
|
68
|
+
leftSideBearing[i] = (short)(bais.read()<<8 | bais.read());
|
69
|
+
}
|
70
|
+
}
|
71
|
+
buf = null;
|
72
|
+
}
|
73
|
+
|
74
|
+
public int getAdvanceWidth(int i) {
|
75
|
+
if (hMetrics == null) {
|
76
|
+
return 0;
|
77
|
+
}
|
78
|
+
if (i < hMetrics.length) {
|
79
|
+
return hMetrics[i] >> 16;
|
80
|
+
} else {
|
81
|
+
return hMetrics[hMetrics.length - 1] >> 16;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
public short getLeftSideBearing(int i) {
|
86
|
+
if (hMetrics == null) {
|
87
|
+
return 0;
|
88
|
+
}
|
89
|
+
if (i < hMetrics.length) {
|
90
|
+
return (short)(hMetrics[i] & 0xffff);
|
91
|
+
} else {
|
92
|
+
return leftSideBearing[i - hMetrics.length];
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
public int getType() {
|
97
|
+
return hmtx;
|
98
|
+
}
|
99
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Copyright 2001,2003 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: KernSubtable.java,v 1.4 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public abstract class KernSubtable {
|
29
|
+
|
30
|
+
/** Creates new KernSubtable */
|
31
|
+
protected KernSubtable() {
|
32
|
+
}
|
33
|
+
|
34
|
+
public abstract int getKerningPairCount();
|
35
|
+
|
36
|
+
public abstract KerningPair getKerningPair(int i);
|
37
|
+
|
38
|
+
public static KernSubtable read(RandomAccessFileEmulator raf) throws IOException {
|
39
|
+
KernSubtable table = null;
|
40
|
+
/* int version =*/ raf.readUnsignedShort();
|
41
|
+
/* int length =*/ raf.readUnsignedShort();
|
42
|
+
int coverage = raf.readUnsignedShort();
|
43
|
+
int format = coverage >> 8;
|
44
|
+
|
45
|
+
switch (format) {
|
46
|
+
case 0:
|
47
|
+
table = new KernSubtableFormat0(raf);
|
48
|
+
break;
|
49
|
+
case 2:
|
50
|
+
table = new KernSubtableFormat2(raf);
|
51
|
+
break;
|
52
|
+
default:
|
53
|
+
break;
|
54
|
+
}
|
55
|
+
return table;
|
56
|
+
}
|
57
|
+
|
58
|
+
}
|
@@ -0,0 +1,65 @@
|
|
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: KernSubtableFormat0.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public class KernSubtableFormat0 extends KernSubtable {
|
29
|
+
|
30
|
+
private final int nPairs;
|
31
|
+
private final int searchRange;
|
32
|
+
private final int entrySelector;
|
33
|
+
private final int rangeShift;
|
34
|
+
private final KerningPair[] kerningPairs;
|
35
|
+
|
36
|
+
/** Creates new KernSubtableFormat0
|
37
|
+
* @param raf
|
38
|
+
* @throws java.io.IOException */
|
39
|
+
protected KernSubtableFormat0(RandomAccessFileEmulator raf) throws IOException {
|
40
|
+
nPairs = raf.readUnsignedShort();
|
41
|
+
searchRange = raf.readUnsignedShort();
|
42
|
+
entrySelector = raf.readUnsignedShort();
|
43
|
+
rangeShift = raf.readUnsignedShort();
|
44
|
+
kerningPairs = new KerningPair[nPairs];
|
45
|
+
for (int i = 0; i < nPairs; i++) {
|
46
|
+
kerningPairs[i] = new KerningPair(raf);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
@Override
|
51
|
+
public int getKerningPairCount() {
|
52
|
+
return nPairs;
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
*
|
57
|
+
* @param i
|
58
|
+
* @return
|
59
|
+
*/
|
60
|
+
@Override
|
61
|
+
public KerningPair getKerningPair(int i) {
|
62
|
+
return kerningPairs[i];
|
63
|
+
}
|
64
|
+
|
65
|
+
}
|
@@ -0,0 +1,56 @@
|
|
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: KernSubtableFormat2.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public class KernSubtableFormat2 extends KernSubtable {
|
29
|
+
|
30
|
+
private final int rowWidth;
|
31
|
+
private final int leftClassTable;
|
32
|
+
private final int rightClassTable;
|
33
|
+
private final int array;
|
34
|
+
|
35
|
+
/** Creates new KernSubtableFormat2
|
36
|
+
* @param raf
|
37
|
+
* @throws java.io.IOException
|
38
|
+
*/
|
39
|
+
protected KernSubtableFormat2(RandomAccessFileEmulator raf) throws IOException {
|
40
|
+
rowWidth = raf.readUnsignedShort();
|
41
|
+
leftClassTable = raf.readUnsignedShort();
|
42
|
+
rightClassTable = raf.readUnsignedShort();
|
43
|
+
array = raf.readUnsignedShort();
|
44
|
+
}
|
45
|
+
|
46
|
+
@Override
|
47
|
+
public int getKerningPairCount() {
|
48
|
+
return 0;
|
49
|
+
}
|
50
|
+
|
51
|
+
@Override
|
52
|
+
public KerningPair getKerningPair(int i) {
|
53
|
+
return null;
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
@@ -0,0 +1,64 @@
|
|
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: KernTable.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public class KernTable implements Table {
|
29
|
+
|
30
|
+
private final int version;
|
31
|
+
private final int nTables;
|
32
|
+
private final KernSubtable[] tables;
|
33
|
+
|
34
|
+
/** Creates new KernTable
|
35
|
+
* @param de
|
36
|
+
* @param raf
|
37
|
+
* @throws java.io.IOException */
|
38
|
+
protected KernTable(DirectoryEntry de, RandomAccessFileEmulator raf) throws IOException {
|
39
|
+
raf.seek(de.getOffset());
|
40
|
+
version = raf.readUnsignedShort();
|
41
|
+
nTables = raf.readUnsignedShort();
|
42
|
+
tables = new KernSubtable[nTables];
|
43
|
+
for (int i = 0; i < nTables; i++) {
|
44
|
+
tables[i] = KernSubtable.read(raf);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
public int getSubtableCount() {
|
49
|
+
return nTables;
|
50
|
+
}
|
51
|
+
|
52
|
+
public KernSubtable getSubtable(int i) {
|
53
|
+
return tables[i];
|
54
|
+
}
|
55
|
+
|
56
|
+
/** Get the table type, as a table directory value.
|
57
|
+
* @return The table type
|
58
|
+
*/
|
59
|
+
@Override
|
60
|
+
public int getType() {
|
61
|
+
return kern;
|
62
|
+
}
|
63
|
+
|
64
|
+
}
|
@@ -0,0 +1,53 @@
|
|
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: KerningPair.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public class KerningPair {
|
29
|
+
|
30
|
+
private int left;
|
31
|
+
private int right;
|
32
|
+
private short value;
|
33
|
+
|
34
|
+
/** Creates new KerningPair */
|
35
|
+
protected KerningPair(RandomAccessFileEmulator raf) throws IOException {
|
36
|
+
left = raf.readUnsignedShort();
|
37
|
+
right = raf.readUnsignedShort();
|
38
|
+
value = raf.readShort();
|
39
|
+
}
|
40
|
+
|
41
|
+
public int getLeft() {
|
42
|
+
return left;
|
43
|
+
}
|
44
|
+
|
45
|
+
public int getRight() {
|
46
|
+
return right;
|
47
|
+
}
|
48
|
+
|
49
|
+
public short getValue() {
|
50
|
+
return value;
|
51
|
+
}
|
52
|
+
|
53
|
+
}
|
@@ -0,0 +1,58 @@
|
|
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: LangSys.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
|
27
|
+
*/
|
28
|
+
public class LangSys {
|
29
|
+
|
30
|
+
private final int lookupOrder;
|
31
|
+
private final int reqFeatureIndex;
|
32
|
+
private final int featureCount;
|
33
|
+
private final int[] featureIndex;
|
34
|
+
|
35
|
+
/** Creates new LangSys
|
36
|
+
* @param raf
|
37
|
+
* @throws java.io.IOException */
|
38
|
+
protected LangSys(RandomAccessFileEmulator raf) throws IOException {
|
39
|
+
lookupOrder = raf.readUnsignedShort();
|
40
|
+
reqFeatureIndex = raf.readUnsignedShort();
|
41
|
+
featureCount = raf.readUnsignedShort();
|
42
|
+
featureIndex = new int[featureCount];
|
43
|
+
for (int i = 0; i < featureCount; i++) {
|
44
|
+
featureIndex[i] = raf.readUnsignedShort();
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
protected boolean isFeatureIndexed(int n) {
|
49
|
+
for (int i = 0; i < featureCount; i++) {
|
50
|
+
if (featureIndex[i] == n) {
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
return false;
|
55
|
+
}
|
56
|
+
|
57
|
+
}
|
58
|
+
|