Frank Shearar uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-fbs.213.mcz ==================== Summary ==================== Name: Graphics-fbs.213 Author: fbs Time: 2 July 2013, 8:22:08.772 pm UUID: 4596c82c-588c-8d45-8f6f-f91168e57234 Ancestors: Graphics-fbs.212 Break the Multilingual <-> TrueType cyclic dependency by moving TTC (TrueType Collection) classes to TrueType and FixedFaceFont to Graphics-Fonts (because this concerns displaying fonts). =============== Diff against Graphics-fbs.212 =============== Item was changed: SystemOrganization addCategory: #'Graphics-Display Objects'! + SystemOrganization addCategory: #'Graphics-External-Ffenestri'! SystemOrganization addCategory: #'Graphics-Files'! SystemOrganization addCategory: #'Graphics-Fonts'! SystemOrganization addCategory: #'Graphics-Primitives'! SystemOrganization addCategory: #'Graphics-Text'! SystemOrganization addCategory: #'Graphics-Transformations'! - SystemOrganization addCategory: #'Graphics-External-Ffenestri'! Item was added: + AbstractFont subclass: #FixedFaceFont + instanceVariableNames: 'baseFont substitutionCharacter displaySelector' + classVariableNames: '' + poolDictionaries: '' + category: 'Graphics-Fonts'! + + !FixedFaceFont commentStamp: 'tak 12/22/2004 01:45' prior: 0! + I am a font for special purpose like password or fallback. + I can show same form whenever someone requests any character. + + Variable displaySelector is future use to show a form dynamically. + (Although it would be unnecessary...)! Item was added: + ----- Method: FixedFaceFont>>ascent (in category 'accessing') ----- + ascent + ^baseFont ascent! Item was added: + ----- Method: FixedFaceFont>>ascentOf: (in category 'accessing') ----- + ascentOf: aCharacter + ^ self ascent! Item was added: + ----- Method: FixedFaceFont>>baseFont (in category 'accessing') ----- + baseFont + ^baseFont! Item was added: + ----- Method: FixedFaceFont>>baseFont: (in category 'accessing') ----- + baseFont: aFont + baseFont := aFont! Item was added: + ----- Method: FixedFaceFont>>baseKern (in category 'accessing') ----- + baseKern + ^baseFont baseKern! Item was added: + ----- Method: FixedFaceFont>>characterFormAt: (in category 'accessing') ----- + characterFormAt: character + ^ baseFont characterFormAt: substitutionCharacter! Item was added: + ----- Method: FixedFaceFont>>descent (in category 'accessing') ----- + descent + ^baseFont descent! Item was added: + ----- Method: FixedFaceFont>>descentKern (in category 'accessing') ----- + descentKern + ^baseFont descentKern! Item was added: + ----- Method: FixedFaceFont>>descentOf: (in category 'accessing') ----- + descentOf: aCharacter + ^ self descent! Item was added: + ----- Method: FixedFaceFont>>displayErrorOn:length:at:kern: (in category 'displaying') ----- + displayErrorOn: aCanvas length: length at: aPoint kern: kernDelta + | maskedString | + maskedString := String new: length. + maskedString atAllPut: substitutionCharacter. + ^ baseFont + displayString: maskedString + on: aCanvas + from: 1 + to: length + at: aPoint + kern: kernDelta! Item was added: + ----- Method: FixedFaceFont>>displayErrorOn:length:at:kern:baselineY: (in category 'displaying') ----- + displayErrorOn: aCanvas length: length at: aPoint kern: kernDelta baselineY: baselineY + | maskedString | + maskedString := String new: length. + maskedString atAllPut: substitutionCharacter. + ^ baseFont + displayString: maskedString + on: aCanvas + from: 1 + to: length + at: aPoint + kern: kernDelta + baselineY: baselineY! Item was added: + ----- Method: FixedFaceFont>>displayPasswordOn:length:at:kern: (in category 'displaying') ----- + displayPasswordOn: aCanvas length: length at: aPoint kern: kernDelta + | maskedString | + maskedString := String new: length. + maskedString atAllPut: substitutionCharacter. + ^ baseFont + displayString: maskedString + on: aCanvas + from: 1 + to: length + at: aPoint + kern: kernDelta! Item was added: + ----- Method: FixedFaceFont>>displayPasswordOn:length:at:kern:baselineY: (in category 'displaying') ----- + displayPasswordOn: aCanvas length: length at: aPoint kern: kernDelta baselineY: baselineY + | maskedString | + maskedString := String new: length. + maskedString atAllPut: substitutionCharacter. + ^ baseFont + displayString: maskedString + on: aCanvas + from: 1 + to: length + at: aPoint + kern: kernDelta + baselineY: baselineY! Item was added: + ----- Method: FixedFaceFont>>displayString:on:from:to:at:kern: (in category 'displaying') ----- + displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta + | size | + size := stopIndex - startIndex + 1. + ^ self perform: displaySelector withArguments: (Array with: aDisplayContext with: size with: aPoint with: kernDelta with: aPoint y + self ascent).! Item was added: + ----- Method: FixedFaceFont>>displayString:on:from:to:at:kern:baselineY: (in category 'displaying') ----- + displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY + | size | + size := stopIndex - startIndex + 1. + ^ self perform: displaySelector withArguments: (Array with: aDisplayContext with: size with: aPoint with: kernDelta with: baselineY).! Item was added: + ----- Method: FixedFaceFont>>displayString:on:from:to:at:kern:from: (in category 'displaying') ----- + displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta from: fromFont + | destPoint | + destPoint := self + displayString: aString + on: aBitBlt + from: startIndex + to: stopIndex + at: aPoint + kern: kernDelta. + ^ Array with: stopIndex + 1 with: destPoint! Item was added: + ----- Method: FixedFaceFont>>displayString:on:from:to:at:kern:from:baselineY: (in category 'displaying') ----- + displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta from: fromFont baselineY: baselineY + | destPoint | + destPoint := self + displayString: aString + on: aBitBlt + from: startIndex + to: stopIndex + at: aPoint + kern: kernDelta + baselineY: baselineY. + ^destPoint! Item was added: + ----- Method: FixedFaceFont>>emphasized: (in category 'accessing') ----- + emphasized: emph + ^self class new baseFont: (baseFont emphasized: emph)! Item was added: + ----- Method: FixedFaceFont>>errorFont (in category 'initialize-release') ----- + errorFont + displaySelector := #displayErrorOn:length:at:kern:baselineY:. + substitutionCharacter := $?.! Item was added: + ----- Method: FixedFaceFont>>familyName (in category 'accessing') ----- + familyName + ^baseFont familyName, '-pw'! Item was added: + ----- Method: FixedFaceFont>>fontSize: (in category 'accessing') ----- + fontSize: aNumber + self baseFont: (StrikeFont familyName: baseFont familyName size: aNumber) copy! Item was added: + ----- Method: FixedFaceFont>>glyphInfoOf:into: (in category 'private') ----- + glyphInfoOf: aCharacter into: glyphInfoArray + + ^ baseFont glyphInfoOf: substitutionCharacter into: glyphInfoArray. + ! Item was added: + ----- Method: FixedFaceFont>>height (in category 'accessing') ----- + height + ^baseFont height! Item was added: + ----- Method: FixedFaceFont>>initialize (in category 'initialize-release') ----- + initialize + "This used to be the default textstyle, but it needs to be a StrikeFont and not a TTCFont and sometimes the default textstyle is a TTCFont. So, we use a typical StrikeFont as the default fallback font." + baseFont := StrikeFont defaultSized: 12. + self passwordFont! Item was added: + ----- Method: FixedFaceFont>>installOn:foregroundColor:backgroundColor: (in category 'displaying') ----- + installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor + ^baseFont installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor! Item was added: + ----- Method: FixedFaceFont>>lineGrid (in category 'accessing') ----- + lineGrid + ^baseFont lineGrid! Item was added: + ----- Method: FixedFaceFont>>maxAscii (in category 'accessing') ----- + maxAscii + ^ SmallInteger maxVal! Item was added: + ----- Method: FixedFaceFont>>passwordCharacter (in category 'accessing') ----- + passwordCharacter + ^$*! Item was added: + ----- Method: FixedFaceFont>>passwordFont (in category 'initialize-release') ----- + passwordFont + displaySelector := #displayPasswordOn:length:at:kern:baselineY:. + substitutionCharacter := $*! Item was added: + ----- Method: FixedFaceFont>>pointSize (in category 'accessing') ----- + pointSize + ^baseFont pointSize! Item was added: + ----- Method: FixedFaceFont>>releaseCachedState (in category 'caching') ----- + releaseCachedState + baseFont releaseCachedState.! Item was added: + ----- Method: FixedFaceFont>>widthOf: (in category 'measuring') ----- + widthOf: aCharacter + ^ baseFont widthOf: substitutionCharacter! |
Free forum by Nabble | Edit this page |