load fonts into JavaFX as well;
authorwenzelm
Wed Sep 12 16:54:24 2012 +0200 (2012-09-12)
changeset 49334dbc169ddd404
parent 49333 8b144338e1a2
child 49335 096967bf3940
load fonts into JavaFX as well;
src/Pure/System/isabelle_system.scala
     1.1 --- a/src/Pure/System/isabelle_system.scala	Wed Sep 12 16:27:44 2012 +0200
     1.2 +++ b/src/Pure/System/isabelle_system.scala	Wed Sep 12 16:54:24 2012 +0200
     1.3 @@ -11,7 +11,7 @@
     1.4  import java.util.regex.Pattern
     1.5  import java.util.Locale
     1.6  import java.io.{InputStream, OutputStream, File => JFile, BufferedReader, InputStreamReader,
     1.7 -  BufferedWriter, OutputStreamWriter, IOException}
     1.8 +  BufferedWriter, OutputStreamWriter, IOException, FileInputStream, BufferedInputStream}
     1.9  import java.awt.{GraphicsEnvironment, Font}
    1.10  import java.awt.font.TextAttribute
    1.11  
    1.12 @@ -297,7 +297,12 @@
    1.13    def install_fonts()
    1.14    {
    1.15      val ge = GraphicsEnvironment.getLocalGraphicsEnvironment()
    1.16 -    for (font <- Path.split(getenv_strict("ISABELLE_FONTS")))
    1.17 +    for (font <- Path.split(getenv_strict("ISABELLE_FONTS"))) {
    1.18        ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, font.file))
    1.19 +
    1.20 +      val stream = new BufferedInputStream(new FileInputStream(font.file))
    1.21 +      try { javafx.scene.text.Font.loadFont(stream, 1.0) }
    1.22 +      finally { stream.close }
    1.23 +    }
    1.24    }
    1.25  }