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

Marcel Taeumel marcel.taeumel at hpi.de
Sun Jan 30 20:16:07 UTC 2022


Am 30.01.2022 21:06:49 schrieb commits at source.squeak.org <commits at source.squeak.org>:
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.!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220130/94fdb308/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 80499 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220130/94fdb308/attachment-0001.png>


More information about the Squeak-dev mailing list