From ead50aee6cf4a13be428e2f0d846bbcb92753b40 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 28 Aug 2016 14:26:40 -0400 Subject: [PATCH] a little font cleaning --- app/src/processing/app/ui/Toolkit.java | 46 ++------------------------ 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/app/src/processing/app/ui/Toolkit.java b/app/src/processing/app/ui/Toolkit.java index e30b9f98a..5ed3c1a4b 100644 --- a/app/src/processing/app/ui/Toolkit.java +++ b/app/src/processing/app/ui/Toolkit.java @@ -55,6 +55,7 @@ import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Locale; +import java.util.Set; import java.util.regex.Pattern; import javax.swing.Action; @@ -763,47 +764,6 @@ public class Toolkit { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -// static Font monoFont; -// static Font plainFont; -// static Font boldFont; -// -// -// static public Font getMonoFont(int size) { -// if (monoFont == null) { -// try { -// monoFont = createFont("DroidSansMono.ttf", size); -// } catch (Exception e) { -// monoFont = new Font("Monospaced", Font.PLAIN, size); -// } -// } -// return monoFont; -// } -// -// -// static public Font getPlainFont(int size) { -// if (plainFont == null) { -// try { -// plainFont = createFont("DroidSans.ttf", size); -// } catch (Exception e) { -// plainFont = new Font("SansSerif", Font.PLAIN, size); -// } -// } -// return plainFont; -// } -// -// -// static public Font getBoldFont(int size) { -// if (boldFont == null) { -// try { -// boldFont = createFont("DroidSans-Bold.ttf", size); -// } catch (Exception e) { -// boldFont = new Font("SansSerif", Font.BOLD, size); -// } -// } -// return boldFont; -// } - - static final char GREEK_SMALL_LETTER_ALPHA = '\u03B1'; // α static final char GREEK_CAPITAL_LETTER_OMEGA = '\u03A9'; // ω @@ -813,7 +773,7 @@ public class Toolkit { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); - ArrayList outgoing = new ArrayList(); + List outgoing = new ArrayList(); // Using AffineTransform.getScaleInstance(100, 100) doesn't change sizes FontRenderContext frc = new FontRenderContext(new AffineTransform(), @@ -855,7 +815,7 @@ public class Toolkit { static public String[] getMonoFontFamilies() { - HashSet families = new HashSet(); + Set families = new HashSet<>(); for (Font font : getMonoFontList()) { families.add(font.getFamily()); }