[Cuis] Font Height Change?

Juan Vuletich juan at jvuletich.org
Mon Aug 31 07:54:20 CDT 2015


Hi Dan,

On 8/30/2015 8:01 PM, Dan Norton wrote:
> Aha! Game on again. It occurs when the font 'DejaVu Sans Mono' is installed and
> AnagramWindow>>cluesFont uses it for the text, but not always. Otherwise, it does not occur
> when the font is 'DejaVu' which is the default.
>
> Resizing the window reverses the close spacing. A couple more clicks of "More" can cause it
> to recur.

Found it! The problem is that in #atRandom and #permuted first you sent 
the contents to your morph, and then you modify them (without the morph 
really realizing of that). I'm not sure about the details of the 
behavior you found, but the attach is cleaner and fixes the problem.

Cheers,
Juan Vuletich
-------------- next part --------------
'From Cuis 4.2 of 25 July 2013 [latest update: #2464] on 30 August 2015 at 10:30:15.736488 pm'!

!Anagram methodsFor: 'operating' stamp: 'jmv 8/30/2015 22:29'!
atRandom
	"Display randomly selected clues"
	"estas poniendo el font despues de mandarle el texto al morph... El morph ni se entera...
	Asi, no ncecesitas cluesFont"
	| set temp |
	set _ Set new.
	self class cluesToDisplay timesRepeat: [set add: jmb shuffled].	"avoid duplicates"
	temp _ String new writeStream.
	set do: [:ea |
		temp
			nextPutAll: ea;
			nextPutAll: self separators].
	self board cluesString actualContents: (Text 
		initialFont: (AbstractFont familyName: 'DejaVu Sans Mono' aroundPointSize: 10)
		stringOrText: temp contents).
	count _ count + set size! !

!Anagram methodsFor: 'operating' stamp: 'jmv 8/30/2015 22:29'!
permuted
	"Display a set of permuted clues"
	| clueSet clue str |
	clue _ String new writeStream.
	clueSet _ Set new.
	(1 to: jmb size) permutationsDo: [ :letter |
		clue reset.
		(1 to: jmb size) do: [ :ix |
			clue nextPut: (jmb at: (letter at: ix))].
		clueSet add: clue contents].	"avoid duplicates"
	str _ String new writeStream.
	clueSet do: [:ea |
		str
			nextPutAll: ea;
			nextPutAll: self separators].
	self board cluesString actualContents: (Text 
		initialFont: (AbstractFont familyName: 'DejaVu Sans Mono' aroundPointSize: 10)
		stringOrText: str contents).
	count _ count + clueSet size! !

!methodRemoval: AnagramWindow #cluesFont!
AnagramWindow removeSelector: #cluesFont!


More information about the Cuis mailing list