equal
deleted
inserted
replaced
9 |
9 |
10 import java.lang.System |
10 import java.lang.System |
11 import java.util.regex.Pattern |
11 import java.util.regex.Pattern |
12 import java.util.Locale |
12 import java.util.Locale |
13 import java.io.{InputStream, OutputStream, File => JFile, BufferedReader, InputStreamReader, |
13 import java.io.{InputStream, OutputStream, File => JFile, BufferedReader, InputStreamReader, |
14 BufferedWriter, OutputStreamWriter, IOException} |
14 BufferedWriter, OutputStreamWriter, IOException, FileInputStream, BufferedInputStream} |
15 import java.awt.{GraphicsEnvironment, Font} |
15 import java.awt.{GraphicsEnvironment, Font} |
16 import java.awt.font.TextAttribute |
16 import java.awt.font.TextAttribute |
17 |
17 |
18 import scala.io.Source |
18 import scala.io.Source |
19 import scala.util.matching.Regex |
19 import scala.util.matching.Regex |
295 new Font(family, if (bold) Font.BOLD else Font.PLAIN, size) |
295 new Font(family, if (bold) Font.BOLD else Font.PLAIN, size) |
296 |
296 |
297 def install_fonts() |
297 def install_fonts() |
298 { |
298 { |
299 val ge = GraphicsEnvironment.getLocalGraphicsEnvironment() |
299 val ge = GraphicsEnvironment.getLocalGraphicsEnvironment() |
300 for (font <- Path.split(getenv_strict("ISABELLE_FONTS"))) |
300 for (font <- Path.split(getenv_strict("ISABELLE_FONTS"))) { |
301 ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, font.file)) |
301 ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, font.file)) |
|
302 |
|
303 val stream = new BufferedInputStream(new FileInputStream(font.file)) |
|
304 try { javafx.scene.text.Font.loadFont(stream, 1.0) } |
|
305 finally { stream.close } |
|
306 } |
302 } |
307 } |
303 } |
308 } |