Created
February 19, 2018 16:41
-
-
Save Sciss/c22e59fe31e239aa41a21d1e083d42fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.{Color, Font, RenderingHints, Graphics2D} | |
val f = Font.createFont(Font.TRUETYPE_FONT, | |
new java.io.FileInputStream("/home/hhrutz/Downloads/alegreya/Alegreya-Regular.otf")) | |
val f1 = f.deriveFont(Font.PLAIN, 64) | |
val c = new scala.swing.Label { | |
override def paintComponent(g: Graphics2D): Unit = { | |
g.setFont(f1) | |
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON) | |
g.setColor(Color.WHITE) | |
g.drawString("Hello World", 10, 56) | |
} | |
} | |
val fr = new scala.swing.Frame { | |
contents = c | |
size = new java.awt.Dimension(400, 400) | |
open() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment