Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1191.mcz ==================== Summary ==================== Name: Morphic-mt.1191 Author: mt Time: 13 July 2016, 12:15:09.232029 pm UUID: 3976006c-99a5-7d4a-8d8e-36775aa92b2c Ancestors: Morphic-mt.1190 Clean-up some dependencies between Graphics, Morphic, and TrueType. =============== Diff against Morphic-mt.1190 =============== Item was removed: - ----- Method: LinedTTCFont>>computeForm: (in category '*Morphic-Multilingual') ----- - computeForm: char - - | ttGlyph scale | - - char = Character tab ifTrue: [^ super computeForm: char]. - - "char = $U ifTrue: [self doOnlyOnce: [self halt]]." - scale := self pixelSize asFloat / (ttcDescription ascender - ttcDescription descender). - ttGlyph := ttcDescription at: char. - ^ ttGlyph asFormWithScale: scale ascender: ttcDescription ascender descender: ttcDescription descender fgColor: foregroundColor bgColor: Color transparent depth: self depth replaceColor: false lineGlyph: lineGlyph lingGlyphWidth: contourWidth emphasis: emphasis! Item was removed: - ----- Method: Point>>ceiling (in category '*Morphic-Truncation and Roundoff') ----- - ceiling - "Answer a Point that is the receiver's x and y ceiling. Answer the receiver if its coordinates are already integral." - - (x isInteger and: [y isInteger]) ifTrue: [^ self]. - ^ x ceiling @ y ceiling - ! Item was removed: - ----- Method: Point>>floor (in category '*Morphic-Truncation and Roundoff') ----- - floor - "Answer a Point that is the receiver's x and y floor. Answer the receiver if its coordinates are already integral." - - (x isInteger and: [y isInteger]) ifTrue: [^ self]. - ^ x floor @ y floor - ! Item was removed: - ----- Method: Point>>guarded (in category '*Morphic-extent functions') ----- - guarded - "Return a positive nonzero extent." - self max: 1@1 .! Item was removed: - ----- Method: Point>>isIntegerPoint (in category '*Morphic-Truncation and Roundoff') ----- - isIntegerPoint - ^ x isInteger and: [ y isInteger ] ! Item was removed: - ----- Method: Point>>roundDownTo: (in category '*Morphic-Truncation and Roundoff') ----- - roundDownTo: grid - "Answer a Point that is the receiver's x and y rounded to grid x and - grid y by lower value (toward negative infinity)." - - | gridPoint | - gridPoint := grid asPoint. - ^(x roundDownTo: gridPoint x) @ (y roundDownTo: gridPoint y)! Item was removed: - ----- Method: Point>>roundUpTo: (in category '*Morphic-Truncation and Roundoff') ----- - roundUpTo: grid - "Answer a Point that is the receiver's x and y rounded to grid x and - grid y by upper value (toward infinity)." - - | gridPoint | - gridPoint := grid asPoint. - ^(x roundUpTo: gridPoint x) @ (y roundUpTo: gridPoint y)! Item was removed: - ----- Method: Point>>scaleTo: (in category '*Morphic-extent functions') ----- - scaleTo: anExtent - "Return a Point scalefactor for shrinking a thumbnail of the receiver's extent to fit within anExtent" - " self and anExtent are expected to have positive nonZero x and y. " - | factor sX sY | - factor := 3.0 reciprocal . "EccentricityThreshhold reciprical" - sX := anExtent x / self x asFloat . - sY := anExtent y / self y asFloat . - sX = sY ifTrue: [ ^ sX @ sY ] . "Same aspect ratio" - ^ sX < sY ifTrue: [ sX @ (sX max: sY * factor) ] - ifFalse: [ (sY max: sX * factor ) @ sY ] ! Item was removed: - ----- Method: Rectangle>>ceiling (in category '*Morphic-Truncation and Roundoff') ----- - ceiling - "Answer the integer rectange to the bottom right of receiver. - Return reciever if it already and integerRectange." - - self isIntegerRectangle ifTrue: [ ^ self ] . - - ^origin ceiling corner: corner ceiling! Item was removed: - ----- Method: Rectangle>>compressTo: (in category '*Morphic-Truncation and Roundoff') ----- - compressTo: grid - "Answer a Rectangle whose origin and corner are rounded to grid x and grid y. - Rounding is done by upper value on origin and lower value on corner so that - rounded rectangle is inside self." - - ^Rectangle origin: (origin roundUpTo: grid) - corner: (corner roundDownTo: grid)! Item was removed: - ----- Method: Rectangle>>compressed (in category '*Morphic-Truncation and Roundoff') ----- - compressed - "Answer a Rectangle whose origin and corner are rounded to integers. - Rounding is done by upper value on origin and lower value on corner so that - rounded rectangle is inside self." - - ^Rectangle origin: origin ceiling corner: corner floor! Item was removed: - ----- Method: Rectangle>>expandTo: (in category '*Morphic-Truncation and Roundoff') ----- - expandTo: grid - "Answer a Rectangle whose origin and corner are rounded to grid x and grid y. - Rounding is done by upper value on origin and lower value on corner so that - self is inside rounded rectangle." - - ^Rectangle origin: (origin roundDownTo: grid) - corner: (corner roundUpTo: grid)! Item was removed: - ----- Method: Rectangle>>expanded (in category '*Morphic-Truncation and Roundoff') ----- - expanded - "Answer a Rectangle whose origin and corner are rounded to integers. - Rounding is done by upper value on origin and lower value on corner so that - self is inside rounded rectangle." - - ^Rectangle origin: origin floor corner: corner ceiling! Item was removed: - ----- Method: Rectangle>>floor (in category '*Morphic-Truncation and Roundoff') ----- - floor - "Answer the integer rectange to the topleft of receiver. - Return reciever if it already and integerRectange." - - self isIntegerRectangle ifTrue: [ ^ self ] . - - ^origin floor corner: corner floor! Item was removed: - ----- Method: Rectangle>>isIntegerRectangle (in category '*Morphic-Truncation and Roundoff') ----- - isIntegerRectangle - "Answer true if all component of receiver are integral." - - ^origin isIntegerPoint and: [ corner isIntegerPoint ]! Item was removed: - ----- Method: Rectangle>>roundTo: (in category '*Morphic-Truncation and Roundoff') ----- - roundTo: grid - "Answer a Rectangle whose origin and corner are rounded to grid x and grid y." - - ^Rectangle origin: (origin roundTo: grid) - corner: (corner roundTo: grid)! Item was removed: - ----- Method: TTCFont>>computeForm: (in category '*Morphic-Multilingual') ----- - computeForm: char - "Compute the glyph form for the given character" - ^ttcDescription renderGlyph: char height: self height fgColor: foregroundColor bgColor: Color transparent depth: self depth! Item was removed: - ----- Method: TTCFont>>fallbackForm (in category '*Morphic-Multilingual') ----- - fallbackForm - "Compute the glyph form for the fallback glyph" - ^ttcDescription renderFallbackGlyphOfHeight: self height fgColor: foregroundColor bgColor: Color transparent depth: self depth! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender: (in category '*Morphic-Multilingual') ----- - asFormWithScale: scale ascender: ascender descender: descender - ^ self - asFormWithScale: scale - ascender: ascender - descender: descender - fgColor: Color black - bgColor: Color white - depth: 8 - replaceColor: true. - ! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth: (in category '*Morphic-Multilingual') ----- - asFormWithScale: scale ascender: ascender descender: descender fgColor: fgColor bgColor: bgColor depth: depth - - ^ self - asFormWithScale: scale - ascender: ascender - descender: descender - fgColor: fgColor - bgColor: bgColor - depth: depth - replaceColor: false. - ! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor: (in category '*Morphic-Multilingual') ----- - asFormWithScale: scale ascender: ascender descender: descender fgColor: fgColor bgColor: bgColor depth: depth replaceColor: replaceColorFlag - - ^ self - asFormWithScale: scale - ascender: ascender - descender: descender - fgColor: fgColor - bgColor: bgColor - depth: depth - replaceColor: replaceColorFlag - lineGlyph: nil - lingGlyphWidth: 0 - emphasis: 0.! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:lineGlyph:lingGlyphWidth:emphasis: (in category '*Morphic-Multilingual') ----- - asFormWithScale: scale ascender: ascender descender: descender fgColor: fgColor bgColor: bgColor depth: depth replaceColor: replaceColorFlag lineGlyph: lineGlyph lingGlyphWidth: lWidth emphasis: code - - | form canvas newScale | - form := Form extent: (advanceWidth @ (ascender - descender) * scale) rounded depth: depth. - form fillColor: bgColor. - canvas := BalloonCanvas on: form. - canvas aaLevel: 4. - canvas transformBy: (MatrixTransform2x3 withScale: scale asPoint * (1 @ -1)). - canvas transformBy: (MatrixTransform2x3 withOffset: 0 @ ascender negated). - canvas - drawGeneralBezierShape: self contours - color: fgColor - borderWidth: 0 - borderColor: fgColor. - ((code bitAnd: 4) ~= 0 or: [(code bitAnd: 16) ~= 0]) ifTrue: [ - newScale := (form width + 1) asFloat / lineGlyph calculateWidth asFloat. - canvas transformBy: (MatrixTransform2x3 withScale: (newScale / scale)@1.0). - - (code bitAnd: 4) ~= 0 ifTrue: [ - canvas - drawGeneralBezierShape: lineGlyph contours - color: fgColor - borderWidth: 0 - borderColor: fgColor. - ]. - - (code bitAnd: 16) ~= 0 ifTrue: [ - canvas transformBy: (MatrixTransform2x3 withOffset: 0@(ascender // 2)). - canvas - drawGeneralBezierShape: lineGlyph contours - color: fgColor - borderWidth: 0 - borderColor: fgColor. - ]. - ]. - - replaceColorFlag ifTrue: [ - form replaceColor: bgColor withColor: Color transparent. - ]. - ^ form! |
Free forum by Nabble | Edit this page |