Marcel Taeumel uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-mt.501.mcz
==================== Summary ====================
Name: Graphics-mt.501 Author: mt Time: 16 March 2022, 3:08:20.005608 pm UUID: 69349e70-0302-ae46-aa63-3f615833c0ae Ancestors: Graphics-mt.500
Complements TrueType-mt.90.
=============== Diff against Graphics-mt.500 ===============
Item was added: + ----- Method: AbstractFont>>characterFormAt: (in category 'character shapes') ----- + characterFormAt: aCharacter + + self subclassResponsibility.!
Item was added: + ----- Method: AbstractFont>>formOf: (in category 'character shapes') ----- + formOf: aCharacter + + self subclassResponsibility.!
Item was added: + ----- Method: AbstractFont>>widthOfByteCharacter: (in category 'measuring') ----- + widthOfByteCharacter: aCharacter + "Return the width of the given character whose codePoint is <= 16rFF." + + ^ self widthOf: aCharacter!
Item was changed: ----- Method: AbstractFont>>widthOfString:from:to: (in category 'measuring') ----- widthOfString: aString from: startIndex to: stopIndex + "Measure the length of the given string between start and stop index." + - "Measure the length of the given string between start and stop index" | resultX | resultX := 0. startIndex to: stopIndex do: [:i | resultX := resultX + (self widthOf: (aString at: i))]. + ^ resultX + + "TODO: Use scanner to support kerning. + CharacterScanner new + measureString: asString inFont: self + from: startIndex to: stopIndex + "! - ^resultX!
Item was added: + ----- Method: FixedFaceFont>>isTTCFont (in category 'testing') ----- + isTTCFont + + ^ baseFont isTTCFont!
Item was changed: ----- Method: StrikeFont>>characterFormAt: (in category 'character shapes') ----- characterFormAt: character "Answer a Form copied out of the glyphs for the argument, character." + | ascii leftX rightX | ascii := self codeForCharacter: character. - (ascii between: minAscii and: maxAscii) ifFalse: [ascii := maxAscii + 1]. leftX := xTable at: ascii + 1. rightX := xTable at: ascii + 2. leftX < 0 ifTrue: [^ glyphs copy: (0@0 corner: 0@self height)]. ^ glyphs copy: (leftX @ 0 corner: rightX @ self height)!
Item was changed: ----- Method: StrikeFont>>glyphInfoOf:into: (in category 'accessing') ----- glyphInfoOf: aCharacter into: glyphInfoArray + "Answer the glyph info for aCharacter. If I don't have such a character use my fallback font." + - "return the glyph info for aCharacter; if I don't have such a character, try my fallback font, if I have one of those. - Unlike some other implementors, the returned info for a missing character is not given for the question-mark but rather the zero-ascii char." | code | + (self hasGlyphOf: aCharacter) ifFalse: [ + ^ self fallbackFont + foregroundColor: self foregroundColor; + glyphInfoOf: aCharacter into: glyphInfoArray]. + + code := self codeForCharacter: aCharacter. - (self hasGlyphOf: aCharacter) - ifTrue: [code := self codeForCharacter: aCharacter] - ifFalse: [fallbackFont - ifNotNil: [^ fallbackFont glyphInfoOf: aCharacter into: glyphInfoArray]. - code := 0]. glyphInfoArray at: 1 put: glyphs; at: 2 put: (xTable at: code + 1); at: 3 put: (xTable at: code + 2); + at: 4 put: self ascent "(self ascentOf: aCharacter)"; + at: 5 put: self. - at: 4 put: (self ascentOf: aCharacter); - at: 5 put: self. ^ glyphInfoArray!
packages@lists.squeakfoundation.org