[squeak-dev] The Trunk: Tools-mt.1120.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jan 30 20:06:38 UTC 2022


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

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

Name: Tools-mt.1120
Author: mt
Time: 30 January 2022, 9:06:35.692695 pm
UUID: 9ae6768f-fa92-2a42-846e-335169a65751
Ancestors: Tools-ct.1119

Adds a small tool to browse all available glyphs in a font.

Try this:
TextStyle defaultFont browseAllGlyphs.
TextStyle defaultFixedFont browseAllGlyphs.

=============== Diff against Tools-ct.1119 ===============

Item was added:
+ ----- Method: AbstractFont>>browseAllGlyphs (in category '*Tools-Browsing') -----
+ browseAllGlyphs
+ 
+ 	^ self browseGlyphsFrom: self minCodePoint to: self maxCodePoint!

Item was added:
+ ----- Method: AbstractFont>>browseGlyphsFrom:to: (in category '*Tools-Browsing') -----
+ browseGlyphsFrom: firstCodePoint to: lastCodePoint
+ 	"Browse all glyphs in the given range of code points. Use a fall-back character if an inner code point does not have a glyph. DO NOT TRANSLATE!!"
+ 
+ 	| contents |
+ 	contents := String streamContents: [:s |
+ 		| first last fallbackChar |
+ 		first := firstCodePoint max: (self minCodePoint max: 32+1 "first printable after space").
+ 		last := lastCodePoint min: self maxCodePoint.
+ 		fallbackChar := Character space.
+ 		first to: last do: [:codePoint | | char |
+ 			(self hasGlyphOf: (char := Character value: codePoint))
+ 				ifTrue: [s nextPut: char]
+ 				ifFalse: [s nextPut: fallbackChar]]].
+ 	contents := contents asText addAttribute: (TextFontReference toFont: self); yourself.
+ 	contents := (('    Family name: {1}\       Emphasis: {2}\     Point size: {3}\Pixels per inch: {4}\     Pixel size: {5}\\' withCRs asText format: { self familyName asText addAttribute: (PluggableTextAttribute evalBlock: [self explore]); yourself. self emphasisString. self pointSize. self pixelsPerInch. self pixelSize }) addAttribute: (TextFontReference toFont: TextStyle defaultFixedFont); yourself),
+ 		contents.
+ 	contents editWithLabel: self printString.!



More information about the Squeak-dev mailing list