The Trunk: Multilingual-nice.178.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Multilingual-nice.178.mcz

commits-2
Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.178.mcz

==================== Summary ====================

Name: Multilingual-nice.178
Author: nice
Time: 27 September 2013, 2:42:55.746 am
UUID: 72088458-95a8-4a56-b35f-e2a97349df16
Ancestors: Multilingual-nice.177, Multilingual-tpr.177

Merge nice.177 and some of tpr.177

But: don't remove scanSelector
Don't remove method that was freshly moved from Morphic
Move breakAtSpace := false initialization elsewhere

=============== Diff against Multilingual-nice.177 ===============

Item was changed:
  ----- Method: EncodedCharSet class>>scanSelector (in category 'accessing - displaying') -----
  scanSelector
+ "Note: this message can be sent both to an EncodedCharSet or a LanguageEnvironment."
- "This appears to be redundant - possibly once used as a default and now usurped by LanguageEnvironmet class>scanSelector ?"
  ^ #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:!

Item was changed:
  ----- Method: MultiCharacterScanner>>isBreakableAt:in:in: (in category 'scanner methods') -----
  isBreakableAt: index in: sourceString in: encodingClass
+ "check with the encoding whether the character at index is a breakable character- only the JISX0208 & JapaneseEnvironment will ever return true, so only the scanJapaneseCharacters... method calls this"
-
  ^ encodingClass isBreakableAt: index in: sourceString.
  !

Item was changed:
  ----- 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.
  spaceCount := 0.
+ breakAtSpace := false.
  self handleIndentation.
  leftMargin := destX.
  line leftMargin: leftMargin.
 
  [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] whileFalse.
 
  ^ line
  lineHeight: lineHeight + textStyle leading
  baseline: baseline + textStyle leading!

Item was changed:
  ----- Method: MultiCompositionScanner>>composeLine:fromCharacterIndex:inParagraph: (in category 'scanning') -----
  composeLine: lineIndex fromCharacterIndex: startIndex inParagraph: aParagraph
  "Answer an instance of TextLineInterval that represents the next line in the paragraph."
  | runLength stopCondition |
  destX := spaceX := leftMargin := aParagraph leftMarginForCompositionForLine: lineIndex.
  destY := 0.
  rightMargin := aParagraph rightMarginForComposition.
  leftMargin >= rightMargin ifTrue: [self error: 'No room between margins to compose'].
  lastIndex := startIndex. "scanning sets last index"
  lineHeight := textStyle lineGrid.  "may be increased by setFont:..."
  baseline := textStyle baseline.
- baselineY := destY + baseline.
  self setStopConditions. "also sets font"
  self handleIndentation.
  runLength := text runLengthFor: startIndex.
  runStopIndex := (lastIndex := startIndex) + (runLength - 1).
  line := TextLineInterval
  start: lastIndex
  stop: 0
  internalSpaces: 0
  paddingWidth: 0.
  spaceCount := 0.
+ breakAtSpace := false.
 
  [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] whileFalse.
 
  ^line
  lineHeight: lineHeight + textStyle leading
  baseline: baseline + textStyle leading!

Item was changed:
  ----- Method: MultiCompositionScanner>>cr (in category 'stop conditions') -----
  cr
  "Answer true. Set up values for the text line interval currently being
  composed."
 
  pendingKernX := 0.
+ (lastIndex < text size and: [(text at: lastIndex) = Character cr and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1].
- (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1].
  line stop: lastIndex.
  spaceX := destX.
  line paddingWidth: rightMargin - spaceX.
  ^true!

Item was changed:
  ----- Method: MultiCompositionScanner>>endOfRun (in category 'stop conditions') -----
  endOfRun
  "Answer true if scanning has reached the end of the paragraph.
  Otherwise step conditions (mostly install potential new font) and answer
  false."
 
  | runLength |
  lastIndex = text size
  ifTrue: [line stop: lastIndex.
  spaceX := destX.
  line paddingWidth: rightMargin - destX.
  ^true]
  ifFalse: [
- "(text at: lastIndex) charCode = 32 ifTrue: [destX := destX + spaceWidth]."
  runLength := (text runLengthFor: (lastIndex := lastIndex + 1)).
  runStopIndex := lastIndex + (runLength - 1).
  self setStopConditions.
  ^false]
  !

Item was removed:
- ----- Method: MultiCompositionScanner>>isBreakableAt:in:in: (in category 'multilingual scanning') -----
- isBreakableAt: index in: sourceString in: encodingClass
-
- ^ encodingClass isBreakableAt: index in: sourceString.
- !

Item was removed:
- ----- Method: MultiCompositionScanner>>setFont (in category 'stop conditions') -----
- setFont
- super setFont.
- breakAtSpace := false.!