aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/net/java/dev/typecast/ot/TTFontTest.java (renamed from src/test/java/net/java/dev/typecast/ot/OTFontTest.java)16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/test/java/net/java/dev/typecast/ot/OTFontTest.java b/src/test/java/net/java/dev/typecast/ot/TTFontTest.java
index 028bf8a..1621f3e 100644
--- a/src/test/java/net/java/dev/typecast/ot/OTFontTest.java
+++ b/src/test/java/net/java/dev/typecast/ot/TTFontTest.java
@@ -1,23 +1,20 @@
package net.java.dev.typecast.ot;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
+import java.io.*;
import java.net.URISyntaxException;
import java.net.URL;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import net.java.dev.typecast.ot.table.HeadTable;
-public class OTFontTest extends TestCase {
+public class TTFontTest extends TestCase {
/**
* Create the test case
*
* @param testName name of the test case
*/
- public OTFontTest(String testName) {
+ public TTFontTest(String testName) {
super(testName);
}
@@ -25,14 +22,15 @@ public class OTFontTest extends TestCase {
* @return the suite of tests being tested
*/
public static Test suite() {
- return new TestSuite(OTFontTest.class);
+ return new TestSuite(TTFontTest.class);
}
public void testLoadSingleFont() throws URISyntaxException, IOException {
URL url = ClassLoader.getSystemResource("Lato-Regular.ttf");
File file = new File(url.toURI());
- OTFontCollection fontCollection = OTFontCollection.create(file);
- OTFont font = fontCollection.getFont(0);
+ DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(file), (int)file.length()));
+ dis.mark((int)file.length());
+ TTFont font = new TTFont(dis, 0);
assertEquals(HeadTable.class, font.getHeadTable().getClass());
}
}