aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorDavid Schweinsberg <[email protected]>2019-09-13 14:41:19 -0700
committerDavid Schweinsberg <[email protected]>2019-09-13 14:41:19 -0700
commit974c0c58947ef06873fe30bb9e6a58ebe08b9dc5 (patch)
tree313e3c6625c7cee812ce588c1f6c87279daf7e7c /src/test
parent193329eafc1a14214e15297b4b1b56d9bbb9ecbb (diff)
Start decoupling tables, fonts, and font collections
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());
}
}