X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Ftranslators%2FFont.java;h=8026108f38a17b2686fb571aa9545839a7414f74;hb=38786988d12f2c48a314ee37c326965ff0bcadb6;hp=190f9272cf63b297e139bdf892c3fe4f4af2c662;hpb=de71be6ed2ac0542abb790006896980b2c2211a8;p=org.ibex.core.git diff --git a/src/org/xwt/translators/Font.java b/src/org/xwt/translators/Font.java index 190f927..8026108 100644 --- a/src/org/xwt/translators/Font.java +++ b/src/org/xwt/translators/Font.java @@ -2,6 +2,7 @@ package org.xwt.translators; import org.xwt.*; import org.xwt.util.*; import java.io.*; +import java.util.zip.*; // FEATURE: use streams, not memoryfont's // FEATURE: kerning pairs @@ -13,9 +14,15 @@ public class Font { 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(); }