From: megacz Date: Fri, 30 Jan 2004 07:40:50 +0000 (+0000) Subject: 2003/11/03 05:28:31 X-Git-Tag: RC3~382 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=99ca130d23feab443f062b8389c2c12426ef7575 2003/11/03 05:28:31 darcs-hash:20040130074050-2ba56-4ab46bf938c5ff2eecda5c9d55d79c71ffefe573.gz --- diff --git a/src/org/xwt/Glyph.java b/src/org/xwt/Glyph.java deleted file mode 100644 index 71cf19e..0000000 --- a/src/org/xwt/Glyph.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL] -package org.xwt; -import org.xwt.translators.*; -import org.xwt.util.*; -import org.xwt.js.*; -import java.util.*; - -public class Glyph { - public char c; - public int max_ascent; // same value for every glyph in font; the max ascent of all chars - public int max_descent; // same value for every glyph in font; the max descent of all chars - public int baseline; // within the picture, this is the y-coordinate of the baseline - public int advance; // amount to increment the x-coordinate - public int pointsize; - public Picture p; - public Res res; - public boolean rendered = false; - - // k1=font.res k2=(c << 16 | pointsize) - private static Cache glyphCache = new Cache(); - - private static Queue glyphsToBeRendered = new Queue(255); - private static Freetype freetype = new Freetype(); - - private static Scheduler.Task glyphRenderingTask = new Scheduler.Task() { - public Object call(Object arg) { - Glyph g = (Glyph)glyphsToBeRendered.remove(false); - if (g == null) return null; - if (g.p != null) return null; - Log.log(Glyph.class, "rendering glyph " + g.c); - freetype.renderGlyph(g.res, g); - g.rendered = true; - Scheduler.add(this); - return null; - } - }; - - /** - - * If the glyphs of text are not yet loaded, spawn a - * Task to load them and invoke callback. - * - - * returns the width (in the high-order int) and height (in the - * low-order int) of the string's rasterization, or -1 if some - * glyphs are not loaded. - - */ - public static long rasterizeGlyphs(final Res res, final int pointsize, final String text, PixelBuffer pb, int textcolor, - int x, int y, int cx1, int cy1, int cx2, int cy2, final Callback callback) { - boolean ret = true; - int width = 0; - int height = 0; - for(int i=0; i