Skip to content

Instantly share code, notes, and snippets.

@miau
Created August 21, 2011 19:26
Show Gist options
  • Select an option

  • Save miau/1161033 to your computer and use it in GitHub Desktop.

Select an option

Save miau/1161033 to your computer and use it in GitHub Desktop.
import groovy.swing.SwingBuilder
import java.awt.Font
text = "!\"#\$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~‚ ƒAˆŸ[‚Ï"
font_names = [
"Monospaced", "Courier New", "Consolas", "Inconsolata", "MS Gothic", "MeiryoKe_Console",
"M+2VM+IPAG circle", "Migu 1M", "Ricty", "Ricty Discord"
]
new SwingBuilder().edt {
frame(title:'Frame', show: true, pack: true) {
vbox {
for (font_name in font_names) {
label(text: font_name, font: new Font(font_name, Font.BOLD, 16))
label(text: text, font: new Font(font_name, Font.PLAIN, 12))
label(text: text, font: new Font(font_name, Font.BOLD, 12))
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment