[squeak-dev] The Trunk: Graphics-mt.532.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 11 08:50:33 UTC 2022


Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.532.mcz

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

Name: Graphics-mt.532
Author: mt
Time: 11 August 2022, 10:50:27.946716 am
UUID: 17ac3673-2a80-f14a-8fc0-600139584858
Ancestors: Graphics-mt.531

Fixes (and polishes) font preview for symbol fonts such as "Segoe UI Emoji" or "Wingdings".

=============== Diff against Graphics-mt.531 ===============

Item was changed:
  ----- Method: AbstractFont>>symbolSample (in category 'example') -----
  symbolSample
  	"Variation of Text class >> #symbolSample, which uses the receiver's available code points. This is important for fonts such as Wingdings."
  	
+ 	^ String streamContents: [:stream | | codePoint lineLength maxLineLength character numLines |
+ 		lineLength := numLines := 0.
+ 		codePoint := self minCodePoint max: 16r1000.
+ 		maxLineLength := (TextStyle defaultFont widthOf: $x) * 45.
+ 		[numLines > 20 or: [codePoint > self maxCodePoint]] whileFalse: [
- 	^ String streamContents: [:stream | | start lineLength character |
- 		lineLength := 0.
- 		(start := self minCodePoint max: 33) to: (self maxCodePoint min: start + 200) do: [:codePoint |
  			(self hasGlyphOf: (character := Character value: codePoint))
+ 				ifTrue: [
+ 					stream nextPut: character.
+ 					((lineLength := lineLength + (self widthOf: character)) > maxLineLength) ifTrue: [
- 				ifTrue: [stream nextPut: character.
- 					((lineLength := lineLength + 1) > 30) ifTrue: [
  						lineLength := 0.
+ 						numLines := numLines + 1.
+ 						stream cr]].
+ 			codePoint := codePoint + 1 ]]!
- 						stream cr]]]]!



More information about the Squeak-dev mailing list