import org.xwt.*;
import org.xwt.util.*;
import java.io.*;
+import java.util.zip.*;
// FEATURE: use streams, not memoryfont's
// FEATURE: kerning pairs
public static synchronized void renderGlyphs(Res res, int pointsize, int firstGlyph, int lastGlyph, Cache glyphCache) {
try {
+
if (vm == null) {
- vm = new org.xwt.mips.Interpreter("freetype.mips");
- vm.start(new String[]{ "freetype.mips"});
+
+ InputStream bis = Platform.getBuiltinInputStream();
+ ZipInputStream zis = new ZipInputStream(bis);
+ for(ZipEntry ze = zis.getNextEntry(); ze != null && !ze.getName().equals("freetype.mips"); ze = zis.getNextEntry());
+ byte[] image = Resources.isToByteArray(zis);
+ vm = new org.xwt.mips.Interpreter(image);
+ vm.start(new String[]{ "freetype.mips" });
vm.execute();
}