5 */ |
5 */ |
6 |
6 |
7 package isabelle |
7 package isabelle |
8 |
8 |
9 import java.lang.{ClassLoader, ClassNotFoundException, NoSuchMethodException} |
9 import java.lang.{ClassLoader, ClassNotFoundException, NoSuchMethodException} |
10 import java.awt.{GraphicsEnvironment, Image, Component, Container, Toolkit, Window, Font, |
10 import java.awt.{Image, Component, Container, Toolkit, Window, Font, KeyboardFocusManager} |
11 KeyboardFocusManager} |
|
12 import java.awt.font.{TextAttribute, TransformAttribute, FontRenderContext, LineMetrics} |
11 import java.awt.font.{TextAttribute, TransformAttribute, FontRenderContext, LineMetrics} |
13 import java.awt.geom.AffineTransform |
12 import java.awt.geom.AffineTransform |
14 import javax.swing.{ImageIcon, JOptionPane, UIManager, JLayeredPane, JFrame, JWindow, JDialog, |
13 import javax.swing.{ImageIcon, JOptionPane, UIManager, JLayeredPane, JFrame, JWindow, JDialog, |
15 JButton, JTextField} |
14 JButton, JTextField} |
16 |
15 |
240 font.deriveFont(Map(TextAttribute.TRANSFORM -> new TransformAttribute(transform))) |
239 font.deriveFont(Map(TextAttribute.TRANSFORM -> new TransformAttribute(transform))) |
241 } |
240 } |
242 |
241 |
243 def font(family: String = Isabelle_Fonts.sans, size: Int = 1, bold: Boolean = false): Font = |
242 def font(family: String = Isabelle_Fonts.sans, size: Int = 1, bold: Boolean = false): Font = |
244 new Font(family, if (bold) Font.BOLD else Font.PLAIN, size) |
243 new Font(family, if (bold) Font.BOLD else Font.PLAIN, size) |
245 |
|
246 def install_fonts() |
|
247 { |
|
248 val ge = GraphicsEnvironment.getLocalGraphicsEnvironment() |
|
249 Isabelle_Fonts.fonts().foreach(entry => ge.registerFont(entry.font)) |
|
250 } |
|
251 } |
244 } |
252 |
245 |