GUI tool for font creation heaven/hell.
| 51 | * GUI tool for font creation heaven/hell. |
| 52 | */ |
| 53 | public class CreateFont extends JFrame implements Tool { |
| 54 | Base base; |
| 55 | |
| 56 | JList<String> fontSelector; |
| 57 | JTextField sizeSelector; |
| 58 | JButton charsetButton; |
| 59 | JCheckBox smoothBox; |
| 60 | JComponent sample; |
| 61 | JButton okButton; |
| 62 | JTextField filenameField; |
| 63 | |
| 64 | Map<String,Font> table; |
| 65 | boolean smooth = true; |
| 66 | |
| 67 | Font font; |
| 68 | |
| 69 | String[] list; |
| 70 | int selection = -1; |
| 71 | |
| 72 | CharacterSelector charSelector; |
| 73 | |
| 74 | |
| 75 | public CreateFont() { |
| 76 | super(Language.text("create_font")); |
| 77 | } |
| 78 | |
| 79 | |
| 80 | public String getMenuTitle() { |
| 81 | return Language.text("menu.tools.create_font"); |
| 82 | } |
| 83 | |
| 84 | |
| 85 | public void init(Base base) { |
| 86 | this.base = base; |
| 87 | |
| 88 | Container paine = getContentPane(); |
| 89 | paine.setLayout(new BorderLayout()); //10, 10)); |
| 90 | |
| 91 | JPanel pain = new JPanel(); |
| 92 | pain.setBorder(new EmptyBorder(13, 13, 13, 13)); |
| 93 | paine.add(pain, BorderLayout.CENTER); |
| 94 | |
| 95 | pain.setLayout(new BoxLayout(pain, BoxLayout.Y_AXIS)); |
| 96 | |
| 97 | String labelText = Language.text("create_font.label"); |
| 98 | |
| 99 | JTextArea textarea = new JTextArea(labelText); |
| 100 | textarea.setBorder(new EmptyBorder(10, 10, 20, 10)); |
| 101 | textarea.setBackground(null); |
| 102 | textarea.setEditable(false); |
| 103 | textarea.setHighlighter(null); |
| 104 | textarea.setFont(new Font("Dialog", Font.PLAIN, 12)); |
| 105 | pain.add(textarea); |
| 106 | |
| 107 | // don't care about families starting with . or # |
| 108 | // also ignore dialog, dialoginput, monospaced, serif, sansserif |
| 109 | |
| 110 | // getFontList is deprecated in 1.4, so this has to be used |
nothing calls this directly
no outgoing calls
no test coverage detected