X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=backend%2FGlyphMaker.java;h=e5fcc522da927fb2c8788b98f8a5075815389f38;hp=0da2918def6c8d9d0f57d7a77506828039994d69;hb=e6bb1700749980e69b5e913acbfd276f129c24dc;hpb=cf01c92f5809a0732409e280fb0f32f27393618d diff --git a/backend/GlyphMaker.java b/backend/GlyphMaker.java index 0da2918..e5fcc52 100644 --- a/backend/GlyphMaker.java +++ b/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); } }