X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FGlyphMaker.java;h=e5fcc522da927fb2c8788b98f8a5075815389f38;hp=0da2918def6c8d9d0f57d7a77506828039994d69;hb=c4cefaa04ec122fc02efb6542451a31fdf722c32;hpb=c6815053bca27b1c2374548e06779a97651fe07d diff --git a/src/jexer/backend/GlyphMaker.java b/src/jexer/backend/GlyphMaker.java index 0da2918..e5fcc52 100644 --- a/src/jexer/backend/GlyphMaker.java +++ b/src/jexer/backend/GlyphMaker.java @@ -29,6 +29,7 @@ package jexer.backend; import java.awt.Font; +import java.awt.FontFormatException; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; @@ -139,7 +140,7 @@ class GlyphMakerFont { if (filename.length() == 0) { // Fallback font - font = new Font(Font.MONOSPACED, Font.PLAIN, fontSize); + font = new Font(Font.MONOSPACED, Font.PLAIN, fontSize - 2); return; } @@ -148,16 +149,16 @@ class GlyphMakerFont { ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream in = loader.getResourceAsStream(filename); fontRoot = Font.createFont(Font.TRUETYPE_FONT, in); - font = fontRoot.deriveFont(Font.PLAIN, fontSize); - } catch (java.awt.FontFormatException e) { + font = fontRoot.deriveFont(Font.PLAIN, fontSize - 2); + } catch (FontFormatException e) { // Ideally we would report an error here, either via System.err // or TExceptionDialog. However, I do not want GlyphMaker to // know about available backends, so we quietly fallback to // whatever is available as MONO. - font = new Font(Font.MONOSPACED, Font.PLAIN, fontSize); - } catch (java.io.IOException e) { + font = new Font(Font.MONOSPACED, Font.PLAIN, fontSize - 2); + } catch (IOException e) { // See comment above. - font = new Font(Font.MONOSPACED, Font.PLAIN, fontSize); + font = new Font(Font.MONOSPACED, Font.PLAIN, fontSize - 2); } }