diff --git a/src/org/recompile/mobile/MobilePlatform.java b/src/org/recompile/mobile/MobilePlatform.java index 697acf27..d66fc7c6 100644 --- a/src/org/recompile/mobile/MobilePlatform.java +++ b/src/org/recompile/mobile/MobilePlatform.java @@ -33,6 +33,7 @@ import java.awt.Color; import java.awt.Graphics2D; +import java.awt.RenderingHints; import java.awt.event.KeyEvent; import javax.microedition.lcdui.Canvas; @@ -424,6 +425,10 @@ private final void showFPS() { BufferedImage overlayImage = new BufferedImage(OVERLAY_WIDTH, OVERLAY_HEIGHT, BufferedImage.TYPE_INT_ARGB); Graphics2D overlayGraphics = overlayImage.createGraphics(); + + // Enable font AA for better text quality (GASP uses font resource information to apply AA when appropriate) + gc.getGraphics2D().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + gc.getGraphics2D().setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); // Set the overlay background overlayGraphics.setColor(new Color(0, 0, 105, 150)); // BG is a semi-transparent dark blue @@ -444,7 +449,7 @@ private final void showFPS() { double scale = Math.min(lcdWidth, lcdHeight); int scaledWidth = 0; - if(scale < 100) { scaledWidth = (int) (lcdWidth / 2);} + if(scale < 100) { scaledWidth = (int) (lcdWidth / 2.5);} if(scale > 100) { scaledWidth = (int) (lcdWidth / 3);} if(scale > 200) { scaledWidth = (int) (lcdWidth / 4);} if(scale > 300) { scaledWidth = (int) (lcdWidth / 5);} diff --git a/src/org/recompile/mobile/PlatformImage.java b/src/org/recompile/mobile/PlatformImage.java index c5469a9e..9e473e9d 100644 --- a/src/org/recompile/mobile/PlatformImage.java +++ b/src/org/recompile/mobile/PlatformImage.java @@ -32,6 +32,7 @@ import javax.imageio.ImageIO; import java.awt.Graphics2D; +import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.awt.image.WritableRaster; @@ -51,6 +52,13 @@ public class PlatformImage extends javax.microedition.lcdui.Image protected void createGraphics() { gc = new PlatformGraphics(this); + + + // Assuming we ever decide to implement configurable Java Graphics rendering options (2D smoothing, AA, etc), they should be applied here + + // Example: Enable font AA (GASP uses font resource information to apply AA when appropriate) + //gc.getGraphics2D().setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); + gc.setColor(0x000000); }