class: FontDescription
authorClaus Gittinger <cg@exept.de>
Thu, 27 Nov 2014 01:10:50 +0100
changeset 6629 38198a85e3ed
parent 6628 429c85b2ca8e
child 6630 81c3e5842617
class: FontDescription added: #asPixelSize:
FontDescription.st
--- a/FontDescription.st	Thu Nov 27 01:07:04 2014 +0100
+++ b/FontDescription.st	Thu Nov 27 01:10:50 2014 +0100
@@ -1059,6 +1059,28 @@
     ^ self asStyle:#oblique
 !
 
+asPixelSize:anotherSize
+    "return another font corresponding to the receivers 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:anotherSize 
+        sizeUnit:#px
+        encoding:encoding.
+
+    newFont isGenericFont:self isGenericFont.
+    ^ newFont onDevice:self graphicsDevice.
+!
+
 asSize:anotherSize
     "return another font corresponding to the receivers family, face and style but
      with another size"
@@ -1708,11 +1730,11 @@
 !FontDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.96 2014-07-09 02:52:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.97 2014-11-27 00:10:50 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.96 2014-07-09 02:52:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.97 2014-11-27 00:10:50 cg Exp $'
 ! !