Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.63.mcz
==================== Summary ====================
Name: TrueType-mt.63
Author: mt
Time: 5 February 2022, 7:51:30.426366 pm
UUID: 30e76ca2-1832-f442-9463-e9168ba20851
Ancestors: TrueType-mt.62
Let TrueType fonts report accurately on #minCodePoint and #maxCodePoint. We might want to make both a quick-return. Hmm...
=============== Diff against TrueType-mt.62 ===============
Item was changed:
AbstractFont subclass: #TTCFont
+ instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent colorToCacheMap lineGap lineGapSlice minCodePoint maxCodePoint'
- instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent maxAscii colorToCacheMap lineGap lineGapSlice'
classVariableNames: 'GlyphCacheData GlyphCacheIndex GlyphCacheReady GlyphCacheSize NamesToIndexes Registry Scale ShutdownList'
poolDictionaries: ''
category: 'TrueType-Fonts'!
!TTCFont commentStamp: 'nk 4/2/2004 11:32' prior: 0!
I represent a font that uses TrueType derived glyph. Upon a request for glyph for a character through a call to #formOf: (or #widthOf:), I first search corresponding glyph in the cache. If there is not, it creates a 32bit depth form with the glyph.
The cache is weakly held. The entries are zapped at full GC.
Structure:
ttcDescription TTFontDescription -- The Squeak data structure for a TrueType font data file.
pointSize Number -- Nominal Em size in points. Conversion to pixel sizes depends on the definition of TextStyle class>>pixelsPerInch.
foregroundColor Color -- So far, this font need to know the glyph color in cache.
cache WeakArray of <Color -> <Array(256) of glyph>>
derivatives Array -- stores the fonts in the same family but different emphasis.
!
Item was added:
+ ----- Method: TTCFont>>isSymbolFont (in category 'testing') -----
+ isSymbolFont
+
+ ^ (self hasGlyphOf: $a) not!
Item was changed:
----- Method: TTCFont>>maxCodePoint (in category 'accessing') -----
maxCodePoint
+ ^ maxCodePoint ifNil: [maxCodePoint := ((ttcDescription size - 1 to: 0 by: -1)
+ detect: [:ea | (ttcDescription at: ea) isFallback not] ifNone: [0])]!
- ^maxAscii ifNil: [ttcDescription size - 1]!
Item was added:
+ ----- Method: TTCFont>>minCodePoint (in category 'accessing') -----
+ minCodePoint
+
+ ^ minCodePoint ifNil: [minCodePoint := (0 to: ttcDescription size - 1)
+ detect: [:ea | (ttcDescription at: ea) isFallback not] ifNone: [1]]!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.986.mcz
==================== Summary ====================
Name: Collections-mt.986
Author: mt
Time: 5 February 2022, 5:48:06.324947 pm
UUID: 843f8169-dc62-4847-b3eb-49233199a905
Ancestors: Collections-cmm.985
Adds a cheap way to lookup the font at a character index in a text without having to have a text style at hand. This is useful for TextFontReference. See #fontAt:withStyle:.
=============== Diff against Collections-cmm.985 ===============
Item was added:
+ ----- Method: Text>>fontAt:withDefault: (in category 'emphasis') -----
+ fontAt: characterIndex withDefault: aFont
+ "Answer the font for characters in the run beginning at characterIndex."
+
+ | attributes font |
+ self size = 0 ifTrue: [^ aFont]. "null text tolerates access"
+ attributes := runs atPin: characterIndex.
+ font := aFont. "default"
+ attributes do: [:att | att forFontInStyle: nil do: [:f | font := f]].
+ ^ font!
Item was changed:
----- Method: TextFontChange>>forFontInStyle:do: (in category 'private') -----
+ forFontInStyle: aTextStyleOrNil do: aBlock
+
+ ^ aTextStyleOrNil ifNotNil: [aBlock value: (aTextStyleOrNil fontAt: fontNumber)]!
- forFontInStyle: aTextStyle do: aBlock
- aBlock value: (aTextStyle fontAt: fontNumber)!
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.293.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.293
Author: mt
Time: 5 February 2022, 4:22:47.953491 pm
UUID: 51aa77d7-6bc2-cf41-a8f9-ec8ab4142d32
Ancestors: ToolBuilder-Morphic-mt.292
First try to fix position of help text in text fields. There is still something wrong with the vertical offset, which you will notice at some #uiScaleFactor's.
=============== Diff against ToolBuilder-Morphic-mt.292 ===============
Item was changed:
----- Method: PluggableTextMorphPlus>>drawBalloonTextOn: (in category 'drawing') -----
drawBalloonTextOn: aCanvas
"Show balloon text in the text morph if it has no contents."
textMorph contents ifNotEmpty: [ ^ self ].
([ self balloonText ]
on: Error
do: [ : err | 'error in balloonText' ]) ifNotNil:
+ [ : text | | font box |
+ font := self userInterfaceTheme balloonTextFont ifNil: [TextStyle defaultFont].
+ box := self bounds insetBy: (self textMorph margins ifNil: [0]).
+ box := box insetBy: (0 @ font lineGapSlice corner: 0@0).
+ aCanvas
+ drawString: text
+ in: box
+ font: font
+ color: (self userInterfaceTheme balloonTextColor ifNil: [Color gray: 0.7]) ]!
- [ : text | aCanvas
- drawString: text
- in: (self innerBounds insetBy: (5 @ 2 corner: 0 @ 0))
- font: (self userInterfaceTheme balloonTextFont ifNil: [TextStyle defaultFont])
- color: (self userInterfaceTheme balloonTextColor ifNil: [Color gray: 0.7]) ]!