From 90d55865d0f7684780f995bc22c09396d1de84c2 Mon Sep 17 00:00:00 2001 From: benfry Date: Thu, 15 Apr 2010 23:37:00 +0000 Subject: [PATCH] fix two bugs with new font creation code --- core/src/processing/core/PFont.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/src/processing/core/PFont.java b/core/src/processing/core/PFont.java index 421cfb09e..e08e650ea 100644 --- a/core/src/processing/core/PFont.java +++ b/core/src/processing/core/PFont.java @@ -172,7 +172,7 @@ public class PFont implements PConstants { size = font.getSize(); // no, i'm not interested in getting off the couch - lazy = true; + //lazy = true; // not sure what else to do here //mbox2 = 0; @@ -206,7 +206,10 @@ public class PFont implements PConstants { //ascent = lazyMetrics.getAscent(); //descent = lazyMetrics.getDescent(); - if (charset != null) { + if (charset == null) { + lazy = true; + + } else { // charset needs to be sorted to make index lookup run more quickly // http://dev.processing.org/bugs/show_bug.cgi?id=494 Arrays.sort(charset); @@ -216,7 +219,11 @@ public class PFont implements PConstants { glyphCount = 0; for (char c : charset) { if (font.canDisplay(c)) { - glyphs[glyphCount++] = new Glyph(c); + Glyph glyf = new Glyph(c); + if (glyf.value < 128) { + ascii[glyf.value] = glyphCount; + } + glyphs[glyphCount++] = glyf; } } @@ -506,7 +513,7 @@ public class PFont implements PConstants { if (font.canDisplay(c)) { // create the glyph addGlyph(c); - // now where did i put that? + // now where did i put that? return indexActual(c); } else {