[etoys-dev] Etoys: Multilingual-Richo.9.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 30 18:43:12 EDT 2010


Ricardo Moran uploaded a new version of Multilingual to project Etoys:
http://source.squeak.org/etoys/Multilingual-Richo.9.mcz

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

Name: Multilingual-Richo.9
Author: Richo
Time: 30 May 2010, 5:09:38 pm
UUID: 73d74df2-e8db-8f4f-b1ca-bea53533f8ed
Ancestors: Multilingual-Richo.8

* Integrating true type font support by Andreas Raab

=============== Diff against Multilingual-Richo.8 ===============

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 |
+ 	line := textLine.
+ 	morphicOffset := offset.
+ 	lineY := line top + offset y.
+ 	lineHeight := line lineHeight.
+ 	rightMargin := line rightMargin + offset x.
+ 	lastIndex := line first.
- 	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.
- 	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.
- 	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.
- 		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 at destY.
+ 		stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex
- 		startIndex _ lastIndex.
- 		lastPos _ destX at destY.
- 		stopCondition _ self scanCharactersFrom: lastIndex to: runStopIndex
  						in: string rightX: rightMargin stopConditions: stopConditions
  						kern: kern.
  		lastIndex >= startIndex ifTrue:[
  			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].
- 				from: startIndex to: lastIndex at: lastPos kern: kern baselineY: baselineY].
  		"see setStopConditions for stopping conditions for displaying."
+ 		done := self perform: stopCondition.
+ 		"lastIndex > runStopIndex ifTrue: [done := true]."
- 		done _ self perform: stopCondition.
- 		"lastIndex > runStopIndex ifTrue: [done _ true]."
  	].
  	^ runStopIndex - lastIndex   "Number of characters remaining in the current run"!



More information about the etoys-dev mailing list