- String key = glyph.font.res.getCacheKey() + ":" + glyph.c;
- key = new String(Base64.encode(key.getBytes()));
- cacheFile = new java.io.File(System.getProperty("user.home") +
- java.io.File.separatorChar + ".xwt" +
- java.io.File.separatorChar + "caches" +
- java.io.File.separatorChar + "glyphs" +
- java.io.File.separatorChar +
- key);
- new java.io.File(cacheFile.getParent()).mkdirs();
- } catch (Res.NotCacheableException e) {
- Log.log(Freetype.class, "note: glyph not cacheable");
- }
- */
- if (cacheFile != null && cacheFile.exists()) {
- DataInputStream dis = new DataInputStream(new FileInputStream(cacheFile));
- width = dis.readInt();
- height = dis.readInt();
- glyph.font.max_ascent = dis.readInt();
- glyph.font.max_descent = dis.readInt();
- glyph.baseline = dis.readInt();
- glyph.advance = dis.readInt();
- data = new byte[width * height];
- if (width != 0 && height != 0) dis.readFully(data);
-
- } else try {
- //System.out.println("cache miss!");
- if (loadedStream != glyph.font.res) loadFontByteStream(glyph.font.res);