FontDescription.st
changeset 7566 e15d5734e788
parent 7561 a9ba31e29ade
child 7575 151c445c946c
child 7607 3168f2e16613
--- a/FontDescription.st	Tue Sep 13 17:41:45 2016 +0200
+++ b/FontDescription.st	Tue Sep 13 18:30:05 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1994 by Claus Gittinger
 	      All Rights Reserved
@@ -1236,6 +1234,27 @@
    "Created: 28.3.1997 / 16:09:30 / cg"
 !
 
+scaled:factor 
+    "return another font corresponding to the receiver's family, face and style but
+     with another pixel size"
+    
+    |newFont|
+
+    family isNil ifTrue:[
+        "CompoundFonts do not have a family"
+        ^ self
+    ].
+    newFont := self class 
+            family:family
+            face:face
+            style:style
+            size:(size * factor) rounded
+            sizeUnit:sizeUnit
+            encoding:encoding.
+    newFont isGenericFont:self isGenericFont.
+    ^ newFont onDevice:self graphicsDevice.
+!
+
 size:anotherSize
     <resource: #obsolete>