simplified treatment of Isabelle fonts, via Isabelle_System.register_fonts (requires Java 1.6);
authorwenzelm
Mon Dec 07 22:41:15 2009 +0100 (2009-12-07)
changeset 347516ed1b3701459
parent 34750 8a630617faa9
child 34752 e20ef5b33d17
simplified treatment of Isabelle fonts, via Isabelle_System.register_fonts (requires Java 1.6);
src/Tools/jEdit/src/jedit/OptionPane.scala
src/Tools/jEdit/src/jedit/Plugin.scala
     1.1 --- a/src/Tools/jEdit/src/jedit/OptionPane.scala	Mon Dec 07 22:40:01 2009 +0100
     1.2 +++ b/src/Tools/jEdit/src/jedit/OptionPane.scala	Mon Dec 07 22:41:15 2009 +0100
     1.3 @@ -38,10 +38,6 @@
     1.4      Isabelle.Property("logic") = logic
     1.5  
     1.6      val size = font_size.getValue().asInstanceOf[Int]
     1.7 -    if (Isabelle.Int_Property("font-size") != size)
     1.8 -    {
     1.9 -      Isabelle.Int_Property("font-size") = size
    1.10 -      Swing_Thread.later { Isabelle.plugin.set_font(size) }
    1.11 -    }
    1.12 +    Isabelle.Int_Property("font-size") = size
    1.13    }
    1.14  }
     2.1 --- a/src/Tools/jEdit/src/jedit/Plugin.scala	Mon Dec 07 22:40:01 2009 +0100
     2.2 +++ b/src/Tools/jEdit/src/jedit/Plugin.scala	Mon Dec 07 22:41:15 2009 +0100
     2.3 @@ -84,20 +84,6 @@
     2.4  
     2.5  class Plugin extends EBPlugin
     2.6  {
     2.7 -  /* Isabelle font */
     2.8 -
     2.9 -  var font: Font = null
    2.10 -  val font_changed = new Event_Bus[Font]
    2.11 -
    2.12 -  def set_font(size: Int)
    2.13 -  {
    2.14 -    font = Font.createFont(Font.TRUETYPE_FONT,
    2.15 -        Isabelle.system.platform_file("~~/lib/fonts/IsabelleMono.ttf")).
    2.16 -      deriveFont(Font.PLAIN, (size max 1).toFloat)
    2.17 -    font_changed.event(font)
    2.18 -  }
    2.19 -
    2.20 -
    2.21    /* event buses */
    2.22  
    2.23    val state_update = new Event_Bus[Command]
    2.24 @@ -154,9 +140,10 @@
    2.25  
    2.26    override def start()
    2.27    {
    2.28 +    Isabelle.plugin = this
    2.29      Isabelle.system = new Isabelle_System
    2.30 -    Isabelle.plugin = this
    2.31 -    set_font(Isabelle.Int_Property("font-size"))
    2.32 +    if (!Isabelle.system.register_fonts())
    2.33 +      System.err.println("Failed to register Isabelle fonts")
    2.34    }
    2.35  
    2.36    override def stop()