[squeak-dev] The Trunk: Multilingual-ar.45.mcz

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

[squeak-dev] The Trunk: Multilingual-ar.45.mcz

commits-2
Andreas Raab uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-ar.45.mcz

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

Name: Multilingual-ar.45
Author: ar
Time: 30 August 2009, 9:22:55 am
UUID: bd5e9df4-4981-674d-b9e1-45c5fa1c6dd0
Ancestors: Multilingual-ar.44

Merge back one of the fixes for TTC display that got overwritten by FreeTypePlus integration.

=============== Diff against Multilingual-ar.44 ===============

Item was changed:
  ----- Method: MultiDisplayScanner>>displayLine:offset:leftInRun: (in category 'scanning') -----
  displayLine: textLine offset: offset leftInRun: leftInRun
  "The call on the primitive (scanCharactersFrom:to:in:rightX:) will be interrupted according to an array of stop conditions passed to the scanner at which time the code to handle the stop condition is run and the call on the primitive continued until a stop condition returns true (which means the line has terminated).  leftInRun is the # of characters left to scan in the current run; when 0, it is time to call setStopConditions."
+ | done stopCondition nowLeftInRun startIndex string lastPos |
- | done stopCondition nowLeftInRun startIndex string lastPos underline strikeout |
  line := textLine.
  morphicOffset := offset.
  lineY := line top + offset y.
  lineHeight := line lineHeight.
  rightMargin := line rightMargin + offset x.
  lastIndex := line first.
  leftInRun <= 0 ifTrue: [self setStopConditions].
  leftMargin := (line leftMarginForAlignment: alignment) + offset x.
  destX := runX := leftMargin.
  fillBlt == nil ifFalse:
  ["Not right"
  fillBlt destX: line left destY: lineY
  width: line width left height: lineHeight; copyBits].
  lastIndex := line first.
  leftInRun <= 0
  ifTrue: [nowLeftInRun := text runLengthFor: lastIndex]
  ifFalse: [nowLeftInRun := leftInRun].
  baselineY := lineY + line baseline.
  destY := baselineY - font ascent.
  runStopIndex := lastIndex + (nowLeftInRun - 1) min: line last.
  spaceCount := 0.
  done := false.
  string := text string.
  [done] whileFalse:[
  startIndex := lastIndex.
  lastPos := destX@destY.
  stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex
  in: string rightX: rightMargin stopConditions: stopConditions
  kern: kern.
  lastIndex >= startIndex ifTrue:[
- underline := (emphasisCode bitAnd: 4) > 0.
- strikeout := (emphasisCode bitAnd: 16) > 0.
  font displayString: string on: bitBlt
+ from: startIndex
+ "XXXX: The following is an interesting bug. All stopConditions exept #endOfRun
+ have lastIndex past the last character displayed. #endOfRun sets it *on* the character.
+ If we display up until lastIndex then we will also display invisible characters like
+ CR and tab. This problem should be fixed in the scanner (i.e., position lastIndex
+ consistently) but I don't want to deal with the fallout right now so we keep the
+ fix minimally invasive."
+ to: (stopCondition == #endOfRun ifTrue:[lastIndex] ifFalse:[lastIndex-1])
+ at: lastPos kern: kern baselineY: baselineY].
+ (emphasisCode allMask: 4) ifTrue:[
+ font displayUnderlineOn: bitBlt from: lastPos x@baselineY to: destX@baselineY.
+ ].
+ (emphasisCode allMask: 16) ifTrue:[
+ font displayStrikeoutOn: bitBlt from: lastPos x@baselineY to: destX@baselineY.
+ ].
- from: startIndex to: lastIndex at: lastPos kern: kern baselineY: baselineY.
- underline
- ifTrue:[font displayUnderlineOn: bitBlt from: lastPos x@baselineY to: destX@baselineY].
- strikeout
- ifTrue:[font displayStrikeoutOn: bitBlt from: lastPos x@baselineY to: destX@baselineY ] ].
  "see setStopConditions for stopping conditions for displaying."
  done := self perform: stopCondition.
  "lastIndex > runStopIndex ifTrue: [done := true]."
  ].
  ^ runStopIndex - lastIndex   "Number of characters remaining in the current run"!

Item was changed:
  ----- Method: ShiftJISTextConverter>>nextFromStream: (in category 'conversion') -----
  nextFromStream: aStream
  | character1 character2 value1 value2 char1Value result |
  aStream isBinary ifTrue: [^ aStream basicNext].
  character1 := aStream basicNext.
  character1 isNil ifTrue: [^ nil].
  char1Value := character1 asciiValue.
  (char1Value < 16r81) ifTrue: [^ character1].
  (char1Value > 16rA0 and: [char1Value < 16rE0]) ifTrue: [^ self katakanaValue: char1Value].
 
  character2 := aStream basicNext.
  character2 = nil ifTrue: [^ nil "self errorMalformedInput"].
  value1 := character1 asciiValue.
  character1 asciiValue >= 224 ifTrue: [value1 := value1 - 64].
  value1 := value1 - 129 bitShift: 1.
  value2 := character2 asciiValue.
  character2 asciiValue >= 128 ifTrue: [value2 := value2 - 1].
  character2 asciiValue >= 158 ifTrue: [
  value1 := value1 + 1.
  value2 := value2 - 158
  ] ifFalse: [value2 := value2 - 64].
  result := Character leadingChar: self leadingChar code: value1 * 94 + value2.
+ ^ self toUnicode: !
- ^ self toUnicode: result
- !

Item was removed:
- ----- Method: ShiftJISTextConverter>>nextPut:toStream: (in category 'conversion') -----
- nextPut: aCharacter toStream: aStream
- | value leadingChar aChar |
- aStream isBinary ifTrue: [^aCharacter storeBinaryOn: aStream].
- aCharacter isTraditionalDomestic ifTrue: [
- aChar := aCharacter.
- value := aCharacter charCode.
- ] ifFalse: [
- value := aCharacter charCode.
- (16rFF61 <= value and: [value <= 16rFF9F]) ifTrue: [
- aStream basicNextPut: (self sjisKatakanaFor: value).
- ^ aStream
- ].
- aChar := JISX0208 charFromUnicode: value.
- aChar ifNil: [^ aStream].
- value := aChar charCode.
- ].
- leadin!