fixes for font sizing that wasn't matching the operating system

This commit is contained in:
benfry
2004-09-29 01:55:40 +00:00
parent fe4e041276
commit 7d21605164
5 changed files with 563 additions and 442 deletions

View File

@@ -118,6 +118,10 @@ public class PFont2 extends PFont {
g.setFont(font);
FontMetrics metrics = g.getFontMetrics();
ascent = metrics.getAscent();
descent = metrics.getDescent();
//System.out.println("descent found was " + descent);
int maxWidthHeight = 0;
int index = 0;
for (int i = 0; i < charCount; i++) {
@@ -208,7 +212,7 @@ public class PFont2 extends PFont {
charCount = index;
// size for image/texture is next power of 2 over largest char
mbox = (int)
mbox2 = (int)
Math.pow(2, Math.ceil(Math.log(maxWidthHeight) / Math.log(2)));
//System.out.println("mbox is " + mbox);
//System.out.println("found " + charCount + " chars