lists.squeakfoundation.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Packages
July 2013
----- 2024 -----
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
packages@lists.squeakfoundation.org
1 participants
522 discussions
Start a n
N
ew thread
The Trunk: Tests-fbs.230.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-fbs.230.mcz
==================== Summary ==================== Name: Tests-fbs.230 Author: fbs Time: 2 July 2013, 10:24:25.456 pm UUID: 669a08b1-3d7f-7d45-af59-4f19e381dca5 Ancestors: Tests-fbs.229 Record that Tools -/-> ST80. =============== Diff against Tests-fbs.229 =============== Item was changed: ----- Method: PackageDependencyTest>>testTools (in category 'tests') ----- testTools self testPackage: 'Tools' dependsExactlyOn: #( Collections Compiler Compression Exceptions Files Graphics Kernel Morphic MorphicExtras Multilingual Network 'PackageInfo-Base' - ST80 System 'ToolBuilder-Kernel' ).!
1
0
0
0
The Trunk: Tests-fbs.230.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-fbs.230.mcz
==================== Summary ==================== Name: Tests-fbs.230 Author: fbs Time: 2 July 2013, 10:24:25.456 pm UUID: 669a08b1-3d7f-7d45-af59-4f19e381dca5 Ancestors: Tests-fbs.229 Record that Tools -/-> ST80. =============== Diff against Tests-fbs.229 =============== Item was changed: ----- Method: PackageDependencyTest>>testTools (in category 'tests') ----- testTools self testPackage: 'Tools' dependsExactlyOn: #( Collections Compiler Compression Exceptions Files Graphics Kernel Morphic MorphicExtras Multilingual Network 'PackageInfo-Base' - ST80 System 'ToolBuilder-Kernel' ).!
1
0
0
0
The Trunk: Morphic-fbs.661.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-fbs.661.mcz
==================== Summary ==================== Name: Morphic-fbs.661 Author: fbs Time: 2 July 2013, 10:19:47.213 pm UUID: 8fa711eb-1495-b14c-aa55-5b7e25d6f96a Ancestors: Morphic-fbs.660 This nearly severs the Multilingual -> Morphic dependency. =============== Diff against Morphic-fbs.660 =============== Item was changed: SystemOrganization addCategory: #'Morphic-Balloon'! SystemOrganization addCategory: #'Morphic-Basic'! SystemOrganization addCategory: #'Morphic-Basic-NewCurve'! SystemOrganization addCategory: #'Morphic-Borders'! SystemOrganization addCategory: #'Morphic-Collections-Arrayed'! SystemOrganization addCategory: #'Morphic-Demo'! SystemOrganization addCategory: #'Morphic-Events'! SystemOrganization addCategory: #'Morphic-Explorer'! SystemOrganization addCategory: #'Morphic-Kernel'! SystemOrganization addCategory: #'Morphic-Layouts'! SystemOrganization addCategory: #'Morphic-Menus'! SystemOrganization addCategory: #'Morphic-Menus-DockingBar'! SystemOrganization addCategory: #'Morphic-Models'! SystemOrganization addCategory: #'Morphic-Pluggable Widgets'! SystemOrganization addCategory: #'Morphic-Support'! + SystemOrganization addCategory: #'Morphic-Multilingual'! SystemOrganization addCategory: #'Morphic-Text Support'! + SystemOrganization addCategory: #'Morphic-ToolBuilder'! SystemOrganization addCategory: #'Morphic-TrueType'! SystemOrganization addCategory: #'Morphic-Widgets'! SystemOrganization addCategory: #'Morphic-Windows'! SystemOrganization addCategory: #'Morphic-Worlds'! - SystemOrganization addCategory: #'Morphic-ToolBuilder'! Item was added: + ----- 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 added: + ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category '*Morphic-Text Support-scanning') ----- + composeFrom: startIndex inRectangle: lineRectangle + firstLine: firstLine leftSide: leftSide rightSide: rightSide + "Answer an instance of TextLineInterval that represents the next line in the paragraph." + | runLength stopCondition | + "Set up margins" + leftMargin := lineRectangle left. + leftSide ifTrue: [leftMargin := leftMargin + + (firstLine ifTrue: [textStyle firstIndent] + ifFalse: [textStyle restIndent])]. + destX := spaceX := leftMargin. + firstDestX := destX. + rightMargin := lineRectangle right. + rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. + lastIndex := startIndex. "scanning sets last index" + destY := lineRectangle top. + lineHeight := baseline := 0. "Will be increased by setFont" + self setStopConditions. "also sets font" + runLength := text runLengthFor: startIndex. + runStopIndex := (lastIndex := startIndex) + (runLength - 1). + line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) + rectangle: lineRectangle. + presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) + rectangle: lineRectangle. + numOfComposition := 0. + spaceCount := 0. + self handleIndentation. + leftMargin := destX. + line leftMargin: leftMargin. + presentationLine leftMargin: leftMargin. + + presentation := TextStream on: (Text fromString: (WideString new: text size)). + + [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex + in: text string rightX: rightMargin stopConditions: stopConditions + kern: kern. + "See setStopConditions for stopping conditions for composing." + (self perform: stopCondition) + ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading + baseline: baseline + textStyle leading. + ^ line lineHeight: lineHeight + textStyle leading + baseline: baseline + textStyle leading]] repeat! Item was added: + ----- Method: MultiCompositionScanner>>setFont (in category '*Morphic-Multilingual') ----- + setFont + super setFont. + breakAtSpace := false. + wantsColumnBreaks == true ifTrue: [ + stopConditions := stopConditions copy. + stopConditions at: TextComposer characterForColumnBreak asciiValue + 1 put: #columnBreak. + ]. + ! Item was added: + NewParagraph subclass: #MultiNewParagraph + instanceVariableNames: 'presentationText presentationLines' + classVariableNames: '' + poolDictionaries: 'TextConstants' + category: 'Morphic-Multilingual'! Item was added: + ----- Method: MultiNewParagraph>>displayOn:using:at: (in category 'fonts-display') ----- + displayOn: aCanvas using: displayScanner at: somePosition + "Send all visible lines to the displayScanner for display" + + | visibleRectangle offset leftInRun line | + visibleRectangle := aCanvas clipRect. + offset := somePosition - positionWhenComposed. + leftInRun := 0. + (self lineIndexForPoint: visibleRectangle topLeft) + to: (self lineIndexForPoint: visibleRectangle bottomRight) + do: [:i | line := lines at: i. + self displaySelectionInLine: line on: aCanvas. + line first <= line last ifTrue: + [leftInRun := displayScanner displayLine: line + offset: offset leftInRun: leftInRun]]. + ! Item was added: + ----- Method: MultiNewParagraph>>displayOnTest:using:at: (in category 'fonts-display') ----- + displayOnTest: aCanvas using: displayScanner at: somePosition + "Send all visible lines to the displayScanner for display" + + | visibleRectangle offset leftInRun line | + (presentationText isNil or: [presentationLines isNil]) ifTrue: [ + ^ self displayOn: aCanvas using: displayScanner at: somePosition. + ]. + visibleRectangle := aCanvas clipRect. + offset := somePosition - positionWhenComposed. + leftInRun := 0. + (self lineIndexForPoint: visibleRectangle topLeft) + to: (self lineIndexForPoint: visibleRectangle bottomRight) + do: [:i | line := presentationLines at: i. + self displaySelectionInLine: line on: aCanvas. + line first <= line last ifTrue: + [leftInRun := displayScanner displayLine: line + offset: offset leftInRun: leftInRun]]. + ! Item was added: + ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') ----- + multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines + atY: startingY + "While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values" + + | newResult composer presentationInfo | + + composer := MultiTextComposer new. + presentationLines := nil. + presentationText := nil. + newResult := composer + multiComposeLinesFrom: start + to: stop + delta: delta + into: lineColl + priorLines: priorLines + atY: startingY + textStyle: textStyle + text: text + container: container + wantsColumnBreaks: wantsColumnBreaks == true. + lines := newResult first asArray. + maxRightX := newResult second. + presentationInfo := composer getPresentationInfo. + presentationLines := presentationInfo first asArray. + presentationText := presentationInfo second. + "maxRightX printString displayAt: 0@0." + ^maxRightX + ! Item was added: + ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') ----- + presentationLines + + ^ presentationLines. + ! Item was added: + ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') ----- + presentationText + + ^ presentationText. + ! Item was added: + TextComposer subclass: #MultiTextComposer + instanceVariableNames: 'presentation presentationLines' + classVariableNames: '' + poolDictionaries: 'TextConstants' + category: 'Morphic-Multilingual'! Item was added: + ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') ----- + composeEachRectangleIn: rectangles + + | myLine lastChar | + + 1 to: rectangles size do: [:i | + currCharIndex <= theText size ifFalse: [^false]. + myLine := scanner + composeFrom: currCharIndex + inRectangle: (rectangles at: i) + firstLine: isFirstLine + leftSide: i=1 + rightSide: i=rectangles size. + lines addLast: myLine. + presentationLines addLast: scanner getPresentationLine. + presentation ifNil: [presentation := scanner getPresentation] + ifNotNil: [presentation := presentation, scanner getPresentation]. + actualHeight := actualHeight max: myLine lineHeight. "includes font changes" + currCharIndex := myLine last + 1. + lastChar := theText at: myLine last. + (CharacterSet crlf includes: lastChar) ifTrue: [^#cr]. + wantsColumnBreaks ifTrue: [ + lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak]. + ]. + ]. + ^false! Item was added: + ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') ----- + getPresentationInfo + + ^ Array with: presentationLines with: presentation. + ! Item was added: + ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') ----- + multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks + + wantsColumnBreaks := argWantsColumnBreaks. + lines := argLinesCollection. + presentationLines := argLinesCollection copy. + theTextStyle := argTextStyle. + theText := argText. + theContainer := argContainer. + deltaCharIndex := argDelta. + currCharIndex := startCharIndex := argStart. + stopCharIndex := argStop. + prevLines := argPriorLines. + currentY := argStartY. + defaultLineHeight := theTextStyle lineGrid. + maxRightX := theContainer left. + possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle]. + nowSliding := false. + prevIndex := 1. + scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle. + scanner wantsColumnBreaks: wantsColumnBreaks. + isFirstLine := true. + self composeAllLines. + isFirstLine ifTrue: ["No space in container or empty text" + self + addNullLineWithIndex: startCharIndex + andRectangle: (theContainer topLeft extent: 0@defaultLineHeight) + ] ifFalse: [ + self fixupLastLineIfCR + ]. + ^{lines asArray. maxRightX} + + ! Item was added: + ----- 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 added: + ----- 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)(a)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!
1
0
0
0
The Trunk: Morphic-fbs.661.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-fbs.661.mcz
==================== Summary ==================== Name: Morphic-fbs.661 Author: fbs Time: 2 July 2013, 10:19:47.213 pm UUID: 8fa711eb-1495-b14c-aa55-5b7e25d6f96a Ancestors: Morphic-fbs.660 This nearly severs the Multilingual -> Morphic dependency. =============== Diff against Morphic-fbs.660 =============== Item was changed: SystemOrganization addCategory: #'Morphic-Balloon'! SystemOrganization addCategory: #'Morphic-Basic'! SystemOrganization addCategory: #'Morphic-Basic-NewCurve'! SystemOrganization addCategory: #'Morphic-Borders'! SystemOrganization addCategory: #'Morphic-Collections-Arrayed'! SystemOrganization addCategory: #'Morphic-Demo'! SystemOrganization addCategory: #'Morphic-Events'! SystemOrganization addCategory: #'Morphic-Explorer'! SystemOrganization addCategory: #'Morphic-Kernel'! SystemOrganization addCategory: #'Morphic-Layouts'! SystemOrganization addCategory: #'Morphic-Menus'! SystemOrganization addCategory: #'Morphic-Menus-DockingBar'! SystemOrganization addCategory: #'Morphic-Models'! SystemOrganization addCategory: #'Morphic-Pluggable Widgets'! SystemOrganization addCategory: #'Morphic-Support'! + SystemOrganization addCategory: #'Morphic-Multilingual'! SystemOrganization addCategory: #'Morphic-Text Support'! + SystemOrganization addCategory: #'Morphic-ToolBuilder'! SystemOrganization addCategory: #'Morphic-TrueType'! SystemOrganization addCategory: #'Morphic-Widgets'! SystemOrganization addCategory: #'Morphic-Windows'! SystemOrganization addCategory: #'Morphic-Worlds'! - SystemOrganization addCategory: #'Morphic-ToolBuilder'! Item was added: + ----- 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 added: + ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category '*Morphic-Text Support-scanning') ----- + composeFrom: startIndex inRectangle: lineRectangle + firstLine: firstLine leftSide: leftSide rightSide: rightSide + "Answer an instance of TextLineInterval that represents the next line in the paragraph." + | runLength stopCondition | + "Set up margins" + leftMargin := lineRectangle left. + leftSide ifTrue: [leftMargin := leftMargin + + (firstLine ifTrue: [textStyle firstIndent] + ifFalse: [textStyle restIndent])]. + destX := spaceX := leftMargin. + firstDestX := destX. + rightMargin := lineRectangle right. + rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. + lastIndex := startIndex. "scanning sets last index" + destY := lineRectangle top. + lineHeight := baseline := 0. "Will be increased by setFont" + self setStopConditions. "also sets font" + runLength := text runLengthFor: startIndex. + runStopIndex := (lastIndex := startIndex) + (runLength - 1). + line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) + rectangle: lineRectangle. + presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) + rectangle: lineRectangle. + numOfComposition := 0. + spaceCount := 0. + self handleIndentation. + leftMargin := destX. + line leftMargin: leftMargin. + presentationLine leftMargin: leftMargin. + + presentation := TextStream on: (Text fromString: (WideString new: text size)). + + [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex + in: text string rightX: rightMargin stopConditions: stopConditions + kern: kern. + "See setStopConditions for stopping conditions for composing." + (self perform: stopCondition) + ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading + baseline: baseline + textStyle leading. + ^ line lineHeight: lineHeight + textStyle leading + baseline: baseline + textStyle leading]] repeat! Item was added: + ----- Method: MultiCompositionScanner>>setFont (in category '*Morphic-Multilingual') ----- + setFont + super setFont. + breakAtSpace := false. + wantsColumnBreaks == true ifTrue: [ + stopConditions := stopConditions copy. + stopConditions at: TextComposer characterForColumnBreak asciiValue + 1 put: #columnBreak. + ]. + ! Item was added: + NewParagraph subclass: #MultiNewParagraph + instanceVariableNames: 'presentationText presentationLines' + classVariableNames: '' + poolDictionaries: 'TextConstants' + category: 'Morphic-Multilingual'! Item was added: + ----- Method: MultiNewParagraph>>displayOn:using:at: (in category 'fonts-display') ----- + displayOn: aCanvas using: displayScanner at: somePosition + "Send all visible lines to the displayScanner for display" + + | visibleRectangle offset leftInRun line | + visibleRectangle := aCanvas clipRect. + offset := somePosition - positionWhenComposed. + leftInRun := 0. + (self lineIndexForPoint: visibleRectangle topLeft) + to: (self lineIndexForPoint: visibleRectangle bottomRight) + do: [:i | line := lines at: i. + self displaySelectionInLine: line on: aCanvas. + line first <= line last ifTrue: + [leftInRun := displayScanner displayLine: line + offset: offset leftInRun: leftInRun]]. + ! Item was added: + ----- Method: MultiNewParagraph>>displayOnTest:using:at: (in category 'fonts-display') ----- + displayOnTest: aCanvas using: displayScanner at: somePosition + "Send all visible lines to the displayScanner for display" + + | visibleRectangle offset leftInRun line | + (presentationText isNil or: [presentationLines isNil]) ifTrue: [ + ^ self displayOn: aCanvas using: displayScanner at: somePosition. + ]. + visibleRectangle := aCanvas clipRect. + offset := somePosition - positionWhenComposed. + leftInRun := 0. + (self lineIndexForPoint: visibleRectangle topLeft) + to: (self lineIndexForPoint: visibleRectangle bottomRight) + do: [:i | line := presentationLines at: i. + self displaySelectionInLine: line on: aCanvas. + line first <= line last ifTrue: + [leftInRun := displayScanner displayLine: line + offset: offset leftInRun: leftInRun]]. + ! Item was added: + ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') ----- + multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines + atY: startingY + "While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values" + + | newResult composer presentationInfo | + + composer := MultiTextComposer new. + presentationLines := nil. + presentationText := nil. + newResult := composer + multiComposeLinesFrom: start + to: stop + delta: delta + into: lineColl + priorLines: priorLines + atY: startingY + textStyle: textStyle + text: text + container: container + wantsColumnBreaks: wantsColumnBreaks == true. + lines := newResult first asArray. + maxRightX := newResult second. + presentationInfo := composer getPresentationInfo. + presentationLines := presentationInfo first asArray. + presentationText := presentationInfo second. + "maxRightX printString displayAt: 0@0." + ^maxRightX + ! Item was added: + ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') ----- + presentationLines + + ^ presentationLines. + ! Item was added: + ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') ----- + presentationText + + ^ presentationText. + ! Item was added: + TextComposer subclass: #MultiTextComposer + instanceVariableNames: 'presentation presentationLines' + classVariableNames: '' + poolDictionaries: 'TextConstants' + category: 'Morphic-Multilingual'! Item was added: + ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') ----- + composeEachRectangleIn: rectangles + + | myLine lastChar | + + 1 to: rectangles size do: [:i | + currCharIndex <= theText size ifFalse: [^false]. + myLine := scanner + composeFrom: currCharIndex + inRectangle: (rectangles at: i) + firstLine: isFirstLine + leftSide: i=1 + rightSide: i=rectangles size. + lines addLast: myLine. + presentationLines addLast: scanner getPresentationLine. + presentation ifNil: [presentation := scanner getPresentation] + ifNotNil: [presentation := presentation, scanner getPresentation]. + actualHeight := actualHeight max: myLine lineHeight. "includes font changes" + currCharIndex := myLine last + 1. + lastChar := theText at: myLine last. + (CharacterSet crlf includes: lastChar) ifTrue: [^#cr]. + wantsColumnBreaks ifTrue: [ + lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak]. + ]. + ]. + ^false! Item was added: + ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') ----- + getPresentationInfo + + ^ Array with: presentationLines with: presentation. + ! Item was added: + ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') ----- + multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks + + wantsColumnBreaks := argWantsColumnBreaks. + lines := argLinesCollection. + presentationLines := argLinesCollection copy. + theTextStyle := argTextStyle. + theText := argText. + theContainer := argContainer. + deltaCharIndex := argDelta. + currCharIndex := startCharIndex := argStart. + stopCharIndex := argStop. + prevLines := argPriorLines. + currentY := argStartY. + defaultLineHeight := theTextStyle lineGrid. + maxRightX := theContainer left. + possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle]. + nowSliding := false. + prevIndex := 1. + scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle. + scanner wantsColumnBreaks: wantsColumnBreaks. + isFirstLine := true. + self composeAllLines. + isFirstLine ifTrue: ["No space in container or empty text" + self + addNullLineWithIndex: startCharIndex + andRectangle: (theContainer topLeft extent: 0@defaultLineHeight) + ] ifFalse: [ + self fixupLastLineIfCR + ]. + ^{lines asArray. maxRightX} + + ! Item was added: + ----- 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 added: + ----- 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)(a)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!
1
0
0
0
The Trunk: Morphic-fbs.661.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-fbs.661.mcz
==================== Summary ==================== Name: Morphic-fbs.661 Author: fbs Time: 2 July 2013, 10:19:47.213 pm UUID: 8fa711eb-1495-b14c-aa55-5b7e25d6f96a Ancestors: Morphic-fbs.660 This nearly severs the Multilingual -> Morphic dependency. =============== Diff against Morphic-fbs.660 =============== Item was changed: SystemOrganization addCategory: #'Morphic-Balloon'! SystemOrganization addCategory: #'Morphic-Basic'! SystemOrganization addCategory: #'Morphic-Basic-NewCurve'! SystemOrganization addCategory: #'Morphic-Borders'! SystemOrganization addCategory: #'Morphic-Collections-Arrayed'! SystemOrganization addCategory: #'Morphic-Demo'! SystemOrganization addCategory: #'Morphic-Events'! SystemOrganization addCategory: #'Morphic-Explorer'! SystemOrganization addCategory: #'Morphic-Kernel'! SystemOrganization addCategory: #'Morphic-Layouts'! SystemOrganization addCategory: #'Morphic-Menus'! SystemOrganization addCategory: #'Morphic-Menus-DockingBar'! SystemOrganization addCategory: #'Morphic-Models'! SystemOrganization addCategory: #'Morphic-Pluggable Widgets'! SystemOrganization addCategory: #'Morphic-Support'! + SystemOrganization addCategory: #'Morphic-Multilingual'! SystemOrganization addCategory: #'Morphic-Text Support'! + SystemOrganization addCategory: #'Morphic-ToolBuilder'! SystemOrganization addCategory: #'Morphic-TrueType'! SystemOrganization addCategory: #'Morphic-Widgets'! SystemOrganization addCategory: #'Morphic-Windows'! SystemOrganization addCategory: #'Morphic-Worlds'! - SystemOrganization addCategory: #'Morphic-ToolBuilder'! Item was added: + ----- 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 added: + ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category '*Morphic-Text Support-scanning') ----- + composeFrom: startIndex inRectangle: lineRectangle + firstLine: firstLine leftSide: leftSide rightSide: rightSide + "Answer an instance of TextLineInterval that represents the next line in the paragraph." + | runLength stopCondition | + "Set up margins" + leftMargin := lineRectangle left. + leftSide ifTrue: [leftMargin := leftMargin + + (firstLine ifTrue: [textStyle firstIndent] + ifFalse: [textStyle restIndent])]. + destX := spaceX := leftMargin. + firstDestX := destX. + rightMargin := lineRectangle right. + rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. + lastIndex := startIndex. "scanning sets last index" + destY := lineRectangle top. + lineHeight := baseline := 0. "Will be increased by setFont" + self setStopConditions. "also sets font" + runLength := text runLengthFor: startIndex. + runStopIndex := (lastIndex := startIndex) + (runLength - 1). + line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) + rectangle: lineRectangle. + presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) + rectangle: lineRectangle. + numOfComposition := 0. + spaceCount := 0. + self handleIndentation. + leftMargin := destX. + line leftMargin: leftMargin. + presentationLine leftMargin: leftMargin. + + presentation := TextStream on: (Text fromString: (WideString new: text size)). + + [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex + in: text string rightX: rightMargin stopConditions: stopConditions + kern: kern. + "See setStopConditions for stopping conditions for composing." + (self perform: stopCondition) + ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading + baseline: baseline + textStyle leading. + ^ line lineHeight: lineHeight + textStyle leading + baseline: baseline + textStyle leading]] repeat! Item was added: + ----- Method: MultiCompositionScanner>>setFont (in category '*Morphic-Multilingual') ----- + setFont + super setFont. + breakAtSpace := false. + wantsColumnBreaks == true ifTrue: [ + stopConditions := stopConditions copy. + stopConditions at: TextComposer characterForColumnBreak asciiValue + 1 put: #columnBreak. + ]. + ! Item was added: + NewParagraph subclass: #MultiNewParagraph + instanceVariableNames: 'presentationText presentationLines' + classVariableNames: '' + poolDictionaries: 'TextConstants' + category: 'Morphic-Multilingual'! Item was added: + ----- Method: MultiNewParagraph>>displayOn:using:at: (in category 'fonts-display') ----- + displayOn: aCanvas using: displayScanner at: somePosition + "Send all visible lines to the displayScanner for display" + + | visibleRectangle offset leftInRun line | + visibleRectangle := aCanvas clipRect. + offset := somePosition - positionWhenComposed. + leftInRun := 0. + (self lineIndexForPoint: visibleRectangle topLeft) + to: (self lineIndexForPoint: visibleRectangle bottomRight) + do: [:i | line := lines at: i. + self displaySelectionInLine: line on: aCanvas. + line first <= line last ifTrue: + [leftInRun := displayScanner displayLine: line + offset: offset leftInRun: leftInRun]]. + ! Item was added: + ----- Method: MultiNewParagraph>>displayOnTest:using:at: (in category 'fonts-display') ----- + displayOnTest: aCanvas using: displayScanner at: somePosition + "Send all visible lines to the displayScanner for display" + + | visibleRectangle offset leftInRun line | + (presentationText isNil or: [presentationLines isNil]) ifTrue: [ + ^ self displayOn: aCanvas using: displayScanner at: somePosition. + ]. + visibleRectangle := aCanvas clipRect. + offset := somePosition - positionWhenComposed. + leftInRun := 0. + (self lineIndexForPoint: visibleRectangle topLeft) + to: (self lineIndexForPoint: visibleRectangle bottomRight) + do: [:i | line := presentationLines at: i. + self displaySelectionInLine: line on: aCanvas. + line first <= line last ifTrue: + [leftInRun := displayScanner displayLine: line + offset: offset leftInRun: leftInRun]]. + ! Item was added: + ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') ----- + multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines + atY: startingY + "While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values" + + | newResult composer presentationInfo | + + composer := MultiTextComposer new. + presentationLines := nil. + presentationText := nil. + newResult := composer + multiComposeLinesFrom: start + to: stop + delta: delta + into: lineColl + priorLines: priorLines + atY: startingY + textStyle: textStyle + text: text + container: container + wantsColumnBreaks: wantsColumnBreaks == true. + lines := newResult first asArray. + maxRightX := newResult second. + presentationInfo := composer getPresentationInfo. + presentationLines := presentationInfo first asArray. + presentationText := presentationInfo second. + "maxRightX printString displayAt: 0@0." + ^maxRightX + ! Item was added: + ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') ----- + presentationLines + + ^ presentationLines. + ! Item was added: + ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') ----- + presentationText + + ^ presentationText. + ! Item was added: + TextComposer subclass: #MultiTextComposer + instanceVariableNames: 'presentation presentationLines' + classVariableNames: '' + poolDictionaries: 'TextConstants' + category: 'Morphic-Multilingual'! Item was added: + ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') ----- + composeEachRectangleIn: rectangles + + | myLine lastChar | + + 1 to: rectangles size do: [:i | + currCharIndex <= theText size ifFalse: [^false]. + myLine := scanner + composeFrom: currCharIndex + inRectangle: (rectangles at: i) + firstLine: isFirstLine + leftSide: i=1 + rightSide: i=rectangles size. + lines addLast: myLine. + presentationLines addLast: scanner getPresentationLine. + presentation ifNil: [presentation := scanner getPresentation] + ifNotNil: [presentation := presentation, scanner getPresentation]. + actualHeight := actualHeight max: myLine lineHeight. "includes font changes" + currCharIndex := myLine last + 1. + lastChar := theText at: myLine last. + (CharacterSet crlf includes: lastChar) ifTrue: [^#cr]. + wantsColumnBreaks ifTrue: [ + lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak]. + ]. + ]. + ^false! Item was added: + ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') ----- + getPresentationInfo + + ^ Array with: presentationLines with: presentation. + ! Item was added: + ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') ----- + multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks + + wantsColumnBreaks := argWantsColumnBreaks. + lines := argLinesCollection. + presentationLines := argLinesCollection copy. + theTextStyle := argTextStyle. + theText := argText. + theContainer := argContainer. + deltaCharIndex := argDelta. + currCharIndex := startCharIndex := argStart. + stopCharIndex := argStop. + prevLines := argPriorLines. + currentY := argStartY. + defaultLineHeight := theTextStyle lineGrid. + maxRightX := theContainer left. + possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle]. + nowSliding := false. + prevIndex := 1. + scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle. + scanner wantsColumnBreaks: wantsColumnBreaks. + isFirstLine := true. + self composeAllLines. + isFirstLine ifTrue: ["No space in container or empty text" + self + addNullLineWithIndex: startCharIndex + andRectangle: (theContainer topLeft extent: 0@defaultLineHeight) + ] ifFalse: [ + self fixupLastLineIfCR + ]. + ^{lines asArray. maxRightX} + + ! Item was added: + ----- 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 added: + ----- 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)(a)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!
1
0
0
0
The Trunk: Multilingual-fbs.164.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-fbs.164.mcz
==================== Summary ==================== Name: Multilingual-fbs.164 Author: fbs Time: 2 July 2013, 10:18:42.84 pm UUID: 83457f26-4043-914a-b92d-8b34b4a2b37e Ancestors: Multilingual-fbs.163 This nearly severs the Multilingual -> Morphic dependency. =============== Diff against Multilingual-fbs.163 =============== Item was removed: - ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category 'scanning') ----- - composeFrom: startIndex inRectangle: lineRectangle - firstLine: firstLine leftSide: leftSide rightSide: rightSide - "Answer an instance of TextLineInterval that represents the next line in the paragraph." - | runLength stopCondition | - "Set up margins" - leftMargin := lineRectangle left. - leftSide ifTrue: [leftMargin := leftMargin + - (firstLine ifTrue: [textStyle firstIndent] - ifFalse: [textStyle restIndent])]. - destX := spaceX := leftMargin. - firstDestX := destX. - rightMargin := lineRectangle right. - rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. - lastIndex := startIndex. "scanning sets last index" - destY := lineRectangle top. - lineHeight := baseline := 0. "Will be increased by setFont" - self setStopConditions. "also sets font" - runLength := text runLengthFor: startIndex. - runStopIndex := (lastIndex := startIndex) + (runLength - 1). - line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - numOfComposition := 0. - spaceCount := 0. - self handleIndentation. - leftMargin := destX. - line leftMargin: leftMargin. - presentationLine leftMargin: leftMargin. - - presentation := TextStream on: (Text fromString: (WideString new: text size)). - - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex - in: text string rightX: rightMargin stopConditions: stopConditions - kern: kern. - "See setStopConditions for stopping conditions for composing." - (self perform: stopCondition) - ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading. - ^ line lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading]] repeat! Item was removed: - ----- Method: MultiCompositionScanner>>setFont (in category 'stop conditions') ----- - setFont - super setFont. - breakAtSpace := false. - wantsColumnBreaks == true ifTrue: [ - stopConditions := stopConditions copy. - stopConditions at: TextComposer characterForColumnBreak asciiValue + 1 put: #columnBreak. - ]. - ! Item was removed: - NewParagraph subclass: #MultiNewParagraph - instanceVariableNames: 'presentationText presentationLines' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Multilingual-Scanning'! Item was removed: - ----- Method: MultiNewParagraph>>displayOn:using:at: (in category 'fonts-display') ----- - displayOn: aCanvas using: displayScanner at: somePosition - "Send all visible lines to the displayScanner for display" - - | visibleRectangle offset leftInRun line | - visibleRectangle := aCanvas clipRect. - offset := somePosition - positionWhenComposed. - leftInRun := 0. - (self lineIndexForPoint: visibleRectangle topLeft) - to: (self lineIndexForPoint: visibleRectangle bottomRight) - do: [:i | line := lines at: i. - self displaySelectionInLine: line on: aCanvas. - line first <= line last ifTrue: - [leftInRun := displayScanner displayLine: line - offset: offset leftInRun: leftInRun]]. - ! Item was removed: - ----- Method: MultiNewParagraph>>displayOnTest:using:at: (in category 'fonts-display') ----- - displayOnTest: aCanvas using: displayScanner at: somePosition - "Send all visible lines to the displayScanner for display" - - | visibleRectangle offset leftInRun line | - (presentationText isNil or: [presentationLines isNil]) ifTrue: [ - ^ self displayOn: aCanvas using: displayScanner at: somePosition. - ]. - visibleRectangle := aCanvas clipRect. - offset := somePosition - positionWhenComposed. - leftInRun := 0. - (self lineIndexForPoint: visibleRectangle topLeft) - to: (self lineIndexForPoint: visibleRectangle bottomRight) - do: [:i | line := presentationLines at: i. - self displaySelectionInLine: line on: aCanvas. - line first <= line last ifTrue: - [leftInRun := displayScanner displayLine: line - offset: offset leftInRun: leftInRun]]. - ! Item was removed: - ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') ----- - multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines - atY: startingY - "While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values" - - | newResult composer presentationInfo | - - composer := MultiTextComposer new. - presentationLines := nil. - presentationText := nil. - newResult := composer - multiComposeLinesFrom: start - to: stop - delta: delta - into: lineColl - priorLines: priorLines - atY: startingY - textStyle: textStyle - text: text - container: container - wantsColumnBreaks: wantsColumnBreaks == true. - lines := newResult first asArray. - maxRightX := newResult second. - presentationInfo := composer getPresentationInfo. - presentationLines := presentationInfo first asArray. - presentationText := presentationInfo second. - "maxRightX printString displayAt: 0@0." - ^maxRightX - ! Item was removed: - ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') ----- - presentationLines - - ^ presentationLines. - ! Item was removed: - ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') ----- - presentationText - - ^ presentationText. - ! Item was removed: - TextComposer subclass: #MultiTextComposer - instanceVariableNames: 'presentation presentationLines' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Multilingual-Scanning'! Item was removed: - ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') ----- - composeEachRectangleIn: rectangles - - | myLine lastChar | - - 1 to: rectangles size do: [:i | - currCharIndex <= theText size ifFalse: [^false]. - myLine := scanner - composeFrom: currCharIndex - inRectangle: (rectangles at: i) - firstLine: isFirstLine - leftSide: i=1 - rightSide: i=rectangles size. - lines addLast: myLine. - presentationLines addLast: scanner getPresentationLine. - presentation ifNil: [presentation := scanner getPresentation] - ifNotNil: [presentation := presentation, scanner getPresentation]. - actualHeight := actualHeight max: myLine lineHeight. "includes font changes" - currCharIndex := myLine last + 1. - lastChar := theText at: myLine last. - (CharacterSet crlf includes: lastChar) ifTrue: [^#cr]. - wantsColumnBreaks ifTrue: [ - lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak]. - ]. - ]. - ^false! Item was removed: - ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') ----- - getPresentationInfo - - ^ Array with: presentationLines with: presentation. - ! Item was removed: - ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') ----- - multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks - - wantsColumnBreaks := argWantsColumnBreaks. - lines := argLinesCollection. - presentationLines := argLinesCollection copy. - theTextStyle := argTextStyle. - theText := argText. - theContainer := argContainer. - deltaCharIndex := argDelta. - currCharIndex := startCharIndex := argStart. - stopCharIndex := argStop. - prevLines := argPriorLines. - currentY := argStartY. - defaultLineHeight := theTextStyle lineGrid. - maxRightX := theContainer left. - possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle]. - nowSliding := false. - prevIndex := 1. - scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle. - scanner wantsColumnBreaks: wantsColumnBreaks. - isFirstLine := true. - self composeAllLines. - isFirstLine ifTrue: ["No space in container or empty text" - self - addNullLineWithIndex: startCharIndex - andRectangle: (theContainer topLeft extent: 0@defaultLineHeight) - ] ifFalse: [ - self fixupLastLineIfCR - ]. - ^{lines asArray. maxRightX} - - ! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:lineGlyph:lingGlyphWidth:emphasis: (in category '*Multilingual-Display-converting') ----- - 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)(a)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!
1
0
0
0
The Trunk: Multilingual-fbs.164.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-fbs.164.mcz
==================== Summary ==================== Name: Multilingual-fbs.164 Author: fbs Time: 2 July 2013, 10:18:42.84 pm UUID: 83457f26-4043-914a-b92d-8b34b4a2b37e Ancestors: Multilingual-fbs.163 This nearly severs the Multilingual -> Morphic dependency. =============== Diff against Multilingual-fbs.163 =============== Item was removed: - ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category 'scanning') ----- - composeFrom: startIndex inRectangle: lineRectangle - firstLine: firstLine leftSide: leftSide rightSide: rightSide - "Answer an instance of TextLineInterval that represents the next line in the paragraph." - | runLength stopCondition | - "Set up margins" - leftMargin := lineRectangle left. - leftSide ifTrue: [leftMargin := leftMargin + - (firstLine ifTrue: [textStyle firstIndent] - ifFalse: [textStyle restIndent])]. - destX := spaceX := leftMargin. - firstDestX := destX. - rightMargin := lineRectangle right. - rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. - lastIndex := startIndex. "scanning sets last index" - destY := lineRectangle top. - lineHeight := baseline := 0. "Will be increased by setFont" - self setStopConditions. "also sets font" - runLength := text runLengthFor: startIndex. - runStopIndex := (lastIndex := startIndex) + (runLength - 1). - line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - numOfComposition := 0. - spaceCount := 0. - self handleIndentation. - leftMargin := destX. - line leftMargin: leftMargin. - presentationLine leftMargin: leftMargin. - - presentation := TextStream on: (Text fromString: (WideString new: text size)). - - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex - in: text string rightX: rightMargin stopConditions: stopConditions - kern: kern. - "See setStopConditions for stopping conditions for composing." - (self perform: stopCondition) - ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading. - ^ line lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading]] repeat! Item was removed: - ----- Method: MultiCompositionScanner>>setFont (in category 'stop conditions') ----- - setFont - super setFont. - breakAtSpace := false. - wantsColumnBreaks == true ifTrue: [ - stopConditions := stopConditions copy. - stopConditions at: TextComposer characterForColumnBreak asciiValue + 1 put: #columnBreak. - ]. - ! Item was removed: - NewParagraph subclass: #MultiNewParagraph - instanceVariableNames: 'presentationText presentationLines' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Multilingual-Scanning'! Item was removed: - ----- Method: MultiNewParagraph>>displayOn:using:at: (in category 'fonts-display') ----- - displayOn: aCanvas using: displayScanner at: somePosition - "Send all visible lines to the displayScanner for display" - - | visibleRectangle offset leftInRun line | - visibleRectangle := aCanvas clipRect. - offset := somePosition - positionWhenComposed. - leftInRun := 0. - (self lineIndexForPoint: visibleRectangle topLeft) - to: (self lineIndexForPoint: visibleRectangle bottomRight) - do: [:i | line := lines at: i. - self displaySelectionInLine: line on: aCanvas. - line first <= line last ifTrue: - [leftInRun := displayScanner displayLine: line - offset: offset leftInRun: leftInRun]]. - ! Item was removed: - ----- Method: MultiNewParagraph>>displayOnTest:using:at: (in category 'fonts-display') ----- - displayOnTest: aCanvas using: displayScanner at: somePosition - "Send all visible lines to the displayScanner for display" - - | visibleRectangle offset leftInRun line | - (presentationText isNil or: [presentationLines isNil]) ifTrue: [ - ^ self displayOn: aCanvas using: displayScanner at: somePosition. - ]. - visibleRectangle := aCanvas clipRect. - offset := somePosition - positionWhenComposed. - leftInRun := 0. - (self lineIndexForPoint: visibleRectangle topLeft) - to: (self lineIndexForPoint: visibleRectangle bottomRight) - do: [:i | line := presentationLines at: i. - self displaySelectionInLine: line on: aCanvas. - line first <= line last ifTrue: - [leftInRun := displayScanner displayLine: line - offset: offset leftInRun: leftInRun]]. - ! Item was removed: - ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') ----- - multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines - atY: startingY - "While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values" - - | newResult composer presentationInfo | - - composer := MultiTextComposer new. - presentationLines := nil. - presentationText := nil. - newResult := composer - multiComposeLinesFrom: start - to: stop - delta: delta - into: lineColl - priorLines: priorLines - atY: startingY - textStyle: textStyle - text: text - container: container - wantsColumnBreaks: wantsColumnBreaks == true. - lines := newResult first asArray. - maxRightX := newResult second. - presentationInfo := composer getPresentationInfo. - presentationLines := presentationInfo first asArray. - presentationText := presentationInfo second. - "maxRightX printString displayAt: 0@0." - ^maxRightX - ! Item was removed: - ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') ----- - presentationLines - - ^ presentationLines. - ! Item was removed: - ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') ----- - presentationText - - ^ presentationText. - ! Item was removed: - TextComposer subclass: #MultiTextComposer - instanceVariableNames: 'presentation presentationLines' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Multilingual-Scanning'! Item was removed: - ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') ----- - composeEachRectangleIn: rectangles - - | myLine lastChar | - - 1 to: rectangles size do: [:i | - currCharIndex <= theText size ifFalse: [^false]. - myLine := scanner - composeFrom: currCharIndex - inRectangle: (rectangles at: i) - firstLine: isFirstLine - leftSide: i=1 - rightSide: i=rectangles size. - lines addLast: myLine. - presentationLines addLast: scanner getPresentationLine. - presentation ifNil: [presentation := scanner getPresentation] - ifNotNil: [presentation := presentation, scanner getPresentation]. - actualHeight := actualHeight max: myLine lineHeight. "includes font changes" - currCharIndex := myLine last + 1. - lastChar := theText at: myLine last. - (CharacterSet crlf includes: lastChar) ifTrue: [^#cr]. - wantsColumnBreaks ifTrue: [ - lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak]. - ]. - ]. - ^false! Item was removed: - ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') ----- - getPresentationInfo - - ^ Array with: presentationLines with: presentation. - ! Item was removed: - ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') ----- - multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks - - wantsColumnBreaks := argWantsColumnBreaks. - lines := argLinesCollection. - presentationLines := argLinesCollection copy. - theTextStyle := argTextStyle. - theText := argText. - theContainer := argContainer. - deltaCharIndex := argDelta. - currCharIndex := startCharIndex := argStart. - stopCharIndex := argStop. - prevLines := argPriorLines. - currentY := argStartY. - defaultLineHeight := theTextStyle lineGrid. - maxRightX := theContainer left. - possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle]. - nowSliding := false. - prevIndex := 1. - scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle. - scanner wantsColumnBreaks: wantsColumnBreaks. - isFirstLine := true. - self composeAllLines. - isFirstLine ifTrue: ["No space in container or empty text" - self - addNullLineWithIndex: startCharIndex - andRectangle: (theContainer topLeft extent: 0@defaultLineHeight) - ] ifFalse: [ - self fixupLastLineIfCR - ]. - ^{lines asArray. maxRightX} - - ! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:lineGlyph:lingGlyphWidth:emphasis: (in category '*Multilingual-Display-converting') ----- - 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)(a)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!
1
0
0
0
The Trunk: Multilingual-fbs.164.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-fbs.164.mcz
==================== Summary ==================== Name: Multilingual-fbs.164 Author: fbs Time: 2 July 2013, 10:18:42.84 pm UUID: 83457f26-4043-914a-b92d-8b34b4a2b37e Ancestors: Multilingual-fbs.163 This nearly severs the Multilingual -> Morphic dependency. =============== Diff against Multilingual-fbs.163 =============== Item was removed: - ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category 'scanning') ----- - composeFrom: startIndex inRectangle: lineRectangle - firstLine: firstLine leftSide: leftSide rightSide: rightSide - "Answer an instance of TextLineInterval that represents the next line in the paragraph." - | runLength stopCondition | - "Set up margins" - leftMargin := lineRectangle left. - leftSide ifTrue: [leftMargin := leftMargin + - (firstLine ifTrue: [textStyle firstIndent] - ifFalse: [textStyle restIndent])]. - destX := spaceX := leftMargin. - firstDestX := destX. - rightMargin := lineRectangle right. - rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. - lastIndex := startIndex. "scanning sets last index" - destY := lineRectangle top. - lineHeight := baseline := 0. "Will be increased by setFont" - self setStopConditions. "also sets font" - runLength := text runLengthFor: startIndex. - runStopIndex := (lastIndex := startIndex) + (runLength - 1). - line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - numOfComposition := 0. - spaceCount := 0. - self handleIndentation. - leftMargin := destX. - line leftMargin: leftMargin. - presentationLine leftMargin: leftMargin. - - presentation := TextStream on: (Text fromString: (WideString new: text size)). - - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex - in: text string rightX: rightMargin stopConditions: stopConditions - kern: kern. - "See setStopConditions for stopping conditions for composing." - (self perform: stopCondition) - ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading. - ^ line lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading]] repeat! Item was removed: - ----- Method: MultiCompositionScanner>>setFont (in category 'stop conditions') ----- - setFont - super setFont. - breakAtSpace := false. - wantsColumnBreaks == true ifTrue: [ - stopConditions := stopConditions copy. - stopConditions at: TextComposer characterForColumnBreak asciiValue + 1 put: #columnBreak. - ]. - ! Item was removed: - NewParagraph subclass: #MultiNewParagraph - instanceVariableNames: 'presentationText presentationLines' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Multilingual-Scanning'! Item was removed: - ----- Method: MultiNewParagraph>>displayOn:using:at: (in category 'fonts-display') ----- - displayOn: aCanvas using: displayScanner at: somePosition - "Send all visible lines to the displayScanner for display" - - | visibleRectangle offset leftInRun line | - visibleRectangle := aCanvas clipRect. - offset := somePosition - positionWhenComposed. - leftInRun := 0. - (self lineIndexForPoint: visibleRectangle topLeft) - to: (self lineIndexForPoint: visibleRectangle bottomRight) - do: [:i | line := lines at: i. - self displaySelectionInLine: line on: aCanvas. - line first <= line last ifTrue: - [leftInRun := displayScanner displayLine: line - offset: offset leftInRun: leftInRun]]. - ! Item was removed: - ----- Method: MultiNewParagraph>>displayOnTest:using:at: (in category 'fonts-display') ----- - displayOnTest: aCanvas using: displayScanner at: somePosition - "Send all visible lines to the displayScanner for display" - - | visibleRectangle offset leftInRun line | - (presentationText isNil or: [presentationLines isNil]) ifTrue: [ - ^ self displayOn: aCanvas using: displayScanner at: somePosition. - ]. - visibleRectangle := aCanvas clipRect. - offset := somePosition - positionWhenComposed. - leftInRun := 0. - (self lineIndexForPoint: visibleRectangle topLeft) - to: (self lineIndexForPoint: visibleRectangle bottomRight) - do: [:i | line := presentationLines at: i. - self displaySelectionInLine: line on: aCanvas. - line first <= line last ifTrue: - [leftInRun := displayScanner displayLine: line - offset: offset leftInRun: leftInRun]]. - ! Item was removed: - ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') ----- - multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines - atY: startingY - "While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values" - - | newResult composer presentationInfo | - - composer := MultiTextComposer new. - presentationLines := nil. - presentationText := nil. - newResult := composer - multiComposeLinesFrom: start - to: stop - delta: delta - into: lineColl - priorLines: priorLines - atY: startingY - textStyle: textStyle - text: text - container: container - wantsColumnBreaks: wantsColumnBreaks == true. - lines := newResult first asArray. - maxRightX := newResult second. - presentationInfo := composer getPresentationInfo. - presentationLines := presentationInfo first asArray. - presentationText := presentationInfo second. - "maxRightX printString displayAt: 0@0." - ^maxRightX - ! Item was removed: - ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') ----- - presentationLines - - ^ presentationLines. - ! Item was removed: - ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') ----- - presentationText - - ^ presentationText. - ! Item was removed: - TextComposer subclass: #MultiTextComposer - instanceVariableNames: 'presentation presentationLines' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Multilingual-Scanning'! Item was removed: - ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') ----- - composeEachRectangleIn: rectangles - - | myLine lastChar | - - 1 to: rectangles size do: [:i | - currCharIndex <= theText size ifFalse: [^false]. - myLine := scanner - composeFrom: currCharIndex - inRectangle: (rectangles at: i) - firstLine: isFirstLine - leftSide: i=1 - rightSide: i=rectangles size. - lines addLast: myLine. - presentationLines addLast: scanner getPresentationLine. - presentation ifNil: [presentation := scanner getPresentation] - ifNotNil: [presentation := presentation, scanner getPresentation]. - actualHeight := actualHeight max: myLine lineHeight. "includes font changes" - currCharIndex := myLine last + 1. - lastChar := theText at: myLine last. - (CharacterSet crlf includes: lastChar) ifTrue: [^#cr]. - wantsColumnBreaks ifTrue: [ - lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak]. - ]. - ]. - ^false! Item was removed: - ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') ----- - getPresentationInfo - - ^ Array with: presentationLines with: presentation. - ! Item was removed: - ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') ----- - multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks - - wantsColumnBreaks := argWantsColumnBreaks. - lines := argLinesCollection. - presentationLines := argLinesCollection copy. - theTextStyle := argTextStyle. - theText := argText. - theContainer := argContainer. - deltaCharIndex := argDelta. - currCharIndex := startCharIndex := argStart. - stopCharIndex := argStop. - prevLines := argPriorLines. - currentY := argStartY. - defaultLineHeight := theTextStyle lineGrid. - maxRightX := theContainer left. - possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle]. - nowSliding := false. - prevIndex := 1. - scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle. - scanner wantsColumnBreaks: wantsColumnBreaks. - isFirstLine := true. - self composeAllLines. - isFirstLine ifTrue: ["No space in container or empty text" - self - addNullLineWithIndex: startCharIndex - andRectangle: (theContainer topLeft extent: 0@defaultLineHeight) - ] ifFalse: [ - self fixupLastLineIfCR - ]. - ^{lines asArray. maxRightX} - - ! Item was removed: - ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:lineGlyph:lingGlyphWidth:emphasis: (in category '*Multilingual-Display-converting') ----- - 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)(a)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!
1
0
0
0
The Trunk: TrueType-fbs.23.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-fbs.23.mcz
==================== Summary ==================== Name: TrueType-fbs.23 Author: fbs Time: 2 July 2013, 10:17:49.29 pm UUID: fcdc0152-0d7a-284f-9e68-59c4ac55bb1d Ancestors: TrueType-fbs.22 Move graphical stuff up into Morphic-Multilingual. =============== Diff against TrueType-fbs.22 =============== Item was removed: - ----- Method: LinedTTCFont>>computeForm: (in category 'as yet unclassified') ----- - 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: TTCFont>>computeForm: (in category 'private') ----- - computeForm: char - "Compute the glyph form for the given character" - ^ttcDescription renderGlyph: char height: self height fgColor: foregroundColor bgColor: Color transparent depth: self depth!
1
0
0
0
The Trunk: TrueType-fbs.23.mcz
by commits@source.squeak.org
02 Jul '13
02 Jul '13
Frank Shearar uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-fbs.23.mcz
==================== Summary ==================== Name: TrueType-fbs.23 Author: fbs Time: 2 July 2013, 10:17:49.29 pm UUID: fcdc0152-0d7a-284f-9e68-59c4ac55bb1d Ancestors: TrueType-fbs.22 Move graphical stuff up into Morphic-Multilingual. =============== Diff against TrueType-fbs.22 =============== Item was removed: - ----- Method: LinedTTCFont>>computeForm: (in category 'as yet unclassified') ----- - 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: TTCFont>>computeForm: (in category 'private') ----- - computeForm: char - "Compute the glyph form for the given character" - ^ttcDescription renderGlyph: char height: self height fgColor: foregroundColor bgColor: Color transparent depth: self depth!
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200