src/Pure/GUI/gui.scala
changeset 54368 36dc6aa4fe87
parent 53853 e8430d668f44
child 54658 a6697947e277
--- a/src/Pure/GUI/gui.scala	Wed Nov 06 18:04:36 2013 +0100
+++ b/src/Pure/GUI/gui.scala	Wed Nov 06 18:15:25 2013 +0100
@@ -168,10 +168,11 @@
   def font_metrics(font: Font): LineMetrics =
     font.getLineMetrics("", new FontRenderContext(null, false, false))
 
-  def imitate_font(family: String, font: Font): Font =
+  def imitate_font(family: String, font: Font, scale: Double = 1.0): Font =
   {
     val font1 = new Font(family, font.getStyle, font.getSize)
-    font1.deriveFont(font_metrics(font).getAscent / font_metrics(font1).getAscent * font.getSize)
+    val size = scale * (font_metrics(font).getAscent / font_metrics(font1).getAscent * font.getSize)
+    font1.deriveFont(size.round.toInt)
   }
 
   def transform_font(font: Font, transform: AffineTransform): Font =