Font.st
changeset 2433 b2d7a24db748
parent 2321 75a179c343cf
child 2545 829790f194cc
equal deleted inserted replaced
2432:d4daad924fbf 2433:b2d7a24db748
    14 	instanceVariableNames:'device fontId replacementFont ascent descent width isFixedWidth
    14 	instanceVariableNames:'device fontId replacementFont ascent descent width isFixedWidth
    15 		minWidth maxWidth maxAscent maxDescent'
    15 		minWidth maxWidth maxAscent maxDescent'
    16 	classVariableNames:'Replacements'
    16 	classVariableNames:'Replacements'
    17 	poolDictionaries:''
    17 	poolDictionaries:''
    18 	category:'Graphics-Support'
    18 	category:'Graphics-Support'
       
    19 !
       
    20 
       
    21 Object subclass:#DeviceFontHandle
       
    22 	instanceVariableNames:'device fontId'
       
    23 	classVariableNames:''
       
    24 	poolDictionaries:''
       
    25 	privateIn:Font
    19 !
    26 !
    20 
    27 
    21 !Font class methodsFor:'documentation'!
    28 !Font class methodsFor:'documentation'!
    22 
    29 
    23 copyright
    30 copyright
   511     "Modified: 10.1.1997 / 15:40:21 / cg"
   518     "Modified: 10.1.1997 / 15:40:21 / cg"
   512 ! !
   519 ! !
   513 
   520 
   514 !Font methodsFor:'instance release'!
   521 !Font methodsFor:'instance release'!
   515 
   522 
   516 disposed
       
   517     "some Font has been collected - tell it to the x-server"
       
   518 
       
   519     |id|
       
   520 
       
   521     (id := fontId) notNil ifTrue:[
       
   522 	fontId := nil.
       
   523 	device releaseFont:id.
       
   524     ]
       
   525 !
       
   526 
       
   527 shallowCopyForFinalization
   523 shallowCopyForFinalization
   528     "redefined to return a lightweight copy 
   524     "redefined to return a lightweight copy 
   529      - all we need is the device handle"
   525      - all we need is the device handle"
   530 
   526 
   531     |aCopy|
   527     |aCopy|
   532 
   528 
   533     aCopy := self class basicNew.
   529     aCopy := DeviceFontHandle basicNew.
   534     aCopy setDevice:device fontId:fontId.
   530     aCopy setDevice:device fontId:fontId.
   535    ^ aCopy
   531    ^ aCopy
   536 
   532 
   537     "Modified: 20.4.1996 / 23:23:04 / cg"
   533     "Modified: / 20.4.1996 / 23:23:04 / cg"
       
   534     "Modified: / 3.2.1999 / 16:13:10 / stefan"
   538 ! !
   535 ! !
   539 
   536 
   540 !Font methodsFor:'printing & storing'!
   537 !Font methodsFor:'printing & storing'!
   541 
   538 
   542 printOn:aStream
   539 printOn:aStream
  1088      for st-80 compatibility"
  1085      for st-80 compatibility"
  1089 
  1086 
  1090     ^ self height
  1087     ^ self height
  1091 ! !
  1088 ! !
  1092 
  1089 
       
  1090 !Font::DeviceFontHandle class methodsFor:'documentation'!
       
  1091 
       
  1092 documentation
       
  1093 "
       
  1094     This is used as a finalization handle for fonts.
       
  1095 
       
  1096     [author:]
       
  1097         Stefan Vogel (stefan@nilpferd)
       
  1098 
       
  1099     [see also:]
       
  1100         Font
       
  1101 
       
  1102     [instance variables:]
       
  1103 
       
  1104     [class variables:]
       
  1105 "
       
  1106 ! !
       
  1107 
       
  1108 !Font::DeviceFontHandle methodsFor:'accessing'!
       
  1109 
       
  1110 setDevice:aDevice fontId:anId
       
  1111     "set the handles contents"
       
  1112 
       
  1113     device := aDevice.
       
  1114     fontId := anId.
       
  1115 
       
  1116     "Created: / 3.2.1999 / 16:08:31 / stefan"
       
  1117 ! !
       
  1118 
       
  1119 !Font::DeviceFontHandle methodsFor:'finalization'!
       
  1120 
       
  1121 disposed
       
  1122     "some Font has been collected - tell it to the x-server"
       
  1123 
       
  1124     |id|
       
  1125 
       
  1126     (id := fontId) notNil ifTrue:[
       
  1127         fontId := nil.
       
  1128         device releaseFont:id.
       
  1129     ]
       
  1130 
       
  1131     "Created: / 3.2.1999 / 16:09:25 / stefan"
       
  1132 ! !
       
  1133 
  1093 !Font class methodsFor:'documentation'!
  1134 !Font class methodsFor:'documentation'!
  1094 
  1135 
  1095 version
  1136 version
  1096     ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.64 1998-09-10 10:55:46 cg Exp $'
  1137     ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.65 1999-02-03 15:16:55 stefan Exp $'
  1097 ! !
  1138 ! !
  1098 Font initialize!
  1139 Font initialize!