#35 fix demo
[fanfix.git] / src / jexer / backend / GlyphMaker.java
index 0c798b1d7e1fdd48eb7d0df0b2f10f45326c5231..91bda6d7314059c0fbbe0bddfcb763688d8c378d 100644 (file)
@@ -201,8 +201,7 @@ class GlyphMakerFont {
         Graphics2D gr2 = image.createGraphics();
         gr2.setFont(font);
 
-        Cell cellColor = new Cell();
-        cellColor.setTo(cell);
+        Cell cellColor = new Cell(cell);
 
         // Check for reverse
         if (cell.isReverse()) {
@@ -231,14 +230,18 @@ class GlyphMakerFont {
         gr2.dispose();
 
         // We need a new key that will not be mutated by invertCell().
-        Cell key = new Cell();
-        key.setTo(cell);
+        Cell key = new Cell(cell);
         if (cell.isBlink() && !blinkVisible) {
             glyphCacheBlink.put(key, image);
         } else {
             glyphCache.put(key, image);
         }
 
+        /*
+        System.err.println("cellWidth " + cellWidth +
+            " cellHeight " + cellHeight + " image " + image);
+         */
+
         return image;
     }
 
@@ -267,6 +270,13 @@ class GlyphMakerFont {
 
         textHeight = fontTextHeight + textAdjustHeight;
         textWidth = fontTextWidth + textAdjustWidth;
+        /*
+        System.err.println("font " + font);
+        System.err.println("fontTextWidth " + fontTextWidth);
+        System.err.println("fontTextHeight " + fontTextHeight);
+        System.err.println("textWidth " + textWidth);
+        System.err.println("textHeight " + textHeight);
+         */
 
         gotFontDimensions = true;
     }
@@ -347,6 +357,7 @@ public class GlyphMaker {
      * @param fontSize the size of these fonts in pixels
      */
     private GlyphMaker(final int fontSize) {
+        assert (fontSize > 3);
         makerMono = new GlyphMakerFont(MONO, fontSize);
         // makerCJKhk = new GlyphMakerFont(CJKhk, fontSize);
         // makerCJKkr = new GlyphMakerFont(CJKkr, fontSize);