Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.991.mcz
==================== Summary ====================
Name: Collections-mt.991
Author: mt
Time: 1 March 2022, 5:39:24.888136 pm
UUID: f34c5b0e-4785-3045-b7ac-4d2913b6b3bb
Ancestors: Collections-mt.990
Complements Morphic-mt.1917
=============== Diff against Collections-mt.990 ===============
Item was added:
+ ----- Method: Text class>>codeSample (in category 'filler text') -----
+ codeSample
+
+ ^ 'exampleWithNumber: x
+ "A method that illustrates every part of Smalltalk method syntax
+ including primitives. It has unary, binary, and keyboard messages,
+ declares arguments and temporaries, accesses a global variable
+ (but not an instance variable), uses literals (array, character,
+ symbol, string, integer, float), uses the pseudo variables true,
+ false, nil, self, and super, and has sequence, assignment, return
+ and cascade. It has both zero argument and one argument blocks."
+ <primitive: ''primitiveCopyBits'' module: #BitBltPlugin error: ec>
+ | y |
+ true & false not & (nil isNil) ifFalse: [self halt].
+ y := self size + super size.
+ #($a #a ''a'' "a" 1 1.0)
+ do: [ :each |
+ Transcript
+ show: (each class name);
+ show: '' ''].
+ ^ x < y'!
Item was added:
+ ----- Method: Text class>>forssmanSample (in category 'filler text') -----
+ forssmanSample
+ "Detailtypografie. Friedrich Forssmann, Ralf de Jong. Verlag Hermann Schmidt. 2004. ISBN 978-3874395687. http://www.detailtypografie.de/"
+
+ ^ self fromString: 'Wien, Venedig, Ravenna? Also gut: Ravenna. Gleichmäßiger
+ Regen hüllt den Abend ein. Die Fassaden der Häuser haben ihr
+ Antlitz verloren. Ein korpulenter Polizist humpelt auf
+ Krücken zum Strand. Vergeblich halten wir Ausschau,
+ melancholisch spielt Frau Löwe mit ihrem Zirkel. Wir öffnen
+ die Tür. Wir sehen nichts. In der Ferne ein Gewitter. Früher
+ wägte man den Sinn und den Unsinn und entschied sich für den
+ Unsinn. Das war eine Geschmackssache. Wir liegen in Fesseln,
+ ach und in Feuchte. Frau Löwe malt ein vergangenes Bild der
+ Wissenschaft auf die bröcklige Leinwand der Herzen. Sie
+ verneigt sich und küßt uns die Augen. Wir finden keine Luft
+ mehr, wir halten uns nur noch auf dem laufenden. Gott im
+ Himmel, laß es ein Ende haben!! Gott im Himmel, erweiche dein
+ Herz!! Gott im Himmel schenk uns dein Fleisch!! Wir finden ...
+ Luft ... Das Leselicht erlischt. »Blind ist der Blinde nur
+ hinter der Binde.« Schiller & Goethe reichen sich die Hände.
+ »Na denn? Na denn!!«'!
Item was added:
+ ----- Method: Text class>>melvilleSample (in category 'filler text') -----
+ melvilleSample
+ "
+ https://en.wikipedia.org/wiki/Moby-Dick
+ "
+
+ ^ self fromString: 'Call me Ishmael. Some years ago - never mind how long
+ precisely - having little or no money in my purse, and
+ nothing particular to interest me on shore, I thought I
+ would sail about a little and see the watery part of the
+ world. It is a way I have of driving off the spleen and
+ regulating the circulation. Whenever I find myself growing
+ grim about the mouth; whenever it is a damp, drizzly
+ November in my soul; whenever I find myself involuntarily
+ pausing before coffin warehouses, and bringing up the rear
+ of every funeral I meet; and especially whenever my hypos
+ get such an upper hand of me, that it requires a strong
+ moral principle to prevent me from deliberately stepping
+ into the street, and methodically knocking people''s hats off
+ - then, I account it high time to get to sea as soon as I
+ can. This is my substitute for pistol and ball. With a
+ philosophical flourish Cato throws himself upon his sword; I
+ quietly take to the ship. There is nothing surprising in
+ this. If they but knew it, almost all men in their degree,
+ some time or other, cherish very nearly the same feelings
+ towards the ocean with me.
+
+ There now is your insular city of the Manhattoes, belted
+ round by wharves as Indian isles by coral reefs - commerce
+ surrounds it with her surf. Right and left, the streets take
+ you waterward. Its extreme down-town is the battery, where
+ that noble mole is washed by waves, and cooled by breezes,
+ which a few hours previous were out of sight of land. Look
+ at the crowds of water-gazers there.
+
+ -- Herman Melville'!
Item was changed:
----- Method: Text class>>symbolSample (in category 'filler text') -----
symbolSample
+ "Symbols are specific to a font family. We cannot know which code points are supported and how symbols will look like. Thus, you should ask the font of your choice to provide you with a #symbolSample."
+
+ ^ TextStyle defaultFont symbolSample!
-
- ^ self streamContents: [:stream | | lineLength character|
- lineLength := 0.
- 33 to: 255 do:[ :index |
- character := stream nextPut: (Character value: index).
- lineLength := lineLength + 1.
- (('@Z`z' includes: character) or: [lineLength >= 30])
- ifTrue: [
- lineLength :=0.
- stream cr]]]!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1138.mcz
==================== Summary ====================
Name: Tools-mt.1138
Author: mt
Time: 1 March 2022, 5:36:12.550136 pm
UUID: 18107322-ed21-a74d-8d0b-922e83e066c7
Ancestors: Tools-ct.1137
Complements TrueType-mt.78
=============== Diff against Tools-ct.1137 ===============
Item was changed:
----- Method: AbstractFont>>browseAllSymbols (in category '*Tools-Browsing') -----
browseAllSymbols
"This is a variation of #browseAllGlyphs that is optimized to show all available glyphs in a single run, even though their code points may be scattered all over the Unicode range. See #browseAllSymbolsByCategory."
+ "self isSymbolFont ifFalse: [self notify: 'This is not a symbol font: ', self familyName]."
- self isSymbolFont ifFalse: [self notify: 'This is not a symbol font: ', self familyName].
^ self
+ browseGlyphsOf: (((self minCodePoint max: 16r1000) to: self maxCodePoint) select: [:ea | self hasGlyphForCode: ea])
- browseGlyphsOf: ((self minCodePoint to: self maxCodePoint) select: [:ea | self hasGlyphForCode: ea])
label: 'All symbols in ', self familyName!
Item was added:
+ ----- Method: TTCFont>>browseAllGlyphsScaledToDisplay (in category '*Tools-Browsing') -----
+ browseAllGlyphsScaledToDisplay
+ "Overwritten to support not-yet-registered fonts, e.g. through the FontImporterTool."
+
+ ^ self isInstalled
+ ifTrue: [super browseAllGlyphsScaledToDisplay]
+ ifFalse: [self browseAllGlyphs]!
Item was added:
+ ----- Method: TTCFont>>browseGlyphsByCategoryOf:select:label: (in category '*Tools-Browsing') -----
+ browseGlyphsByCategoryOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil
+ "Overwritten to speed up browsing for remote fonts. We have to compose a paragraph with a lot of new glyphs in a paragraph ... even though we will not render all at the same time."
+
+ ttcDescription cacheGlyphDataDuring: [
+ ^ super browseGlyphsByCategoryOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil].!
Item was added:
+ ----- Method: TTCFont>>browseGlyphsOf:select:label: (in category '*Tools-Browsing') -----
+ browseGlyphsOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil
+ "Overwritten to speed up browsing for remote fonts. We have to compose a paragraph with a lot of new glyphs in a paragraph ... even though we will not render all at the same time."
+
+ ttcDescription cacheGlyphDataDuring: [
+ ^ super browseGlyphsOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil].!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.489.mcz
==================== Summary ====================
Name: Graphics-mt.489
Author: mt
Time: 1 March 2022, 4:52:26.923172 pm
UUID: 7699a405-9499-7549-9985-d0ef424ae0df
Ancestors: Graphics-mt.488
Some quality-of-life enhancements for fonts:
- Look up the regular version of any font instance you have at hand via #asRegular (complements #isRegular)
- Use #larger or #smaller to resize a font (like Color's #darker or #lighter)
- Offer a way to access a default style and font that definitely uses flexible TrueType data, which is not the case, e.g., for our 100% default where a pre-rendered StrikeFont is used
=============== Diff against Graphics-mt.488 ===============
Item was added:
+ ----- Method: AbstractFont>>asRegular (in category 'converting') -----
+ asRegular
+ "Try to lookup the receiver with normal emphasis. If the receiver itself looks bold face, this might be okay. Rely on what is registered on the font family's text style. Not that this is different from #emphasized: with 0, which does nothing."
+
+ self emphasis = 0 ifTrue: [^ self].
+ ^ self textStyleOrNil
+ ifNil: [self]
+ ifNotNil: [:style | style fontOfPointSize: self pointSize]!
Item was added:
+ ----- Method: AbstractFont>>larger (in category 'converting') -----
+ larger
+ "Answer a font that is about 20% larger than the receiver but has the same font family and emphasis. Round to 0.5 points to not yield so many different font instances."
+
+ ^ self asPointSize: ((self pointSize asFloat * 1.2) roundTo: 0.5)!
Item was added:
+ ----- Method: AbstractFont>>smaller (in category 'converting') -----
+ smaller
+ "Answer a font that is about 20% smaller than the receiver but has the same font family and emphasis. Round to 0.5 points to not yield so many different font instances."
+
+ ^ self asPointSize: ((self pointSize asFloat * 0.8) roundTo: 0.5)!
Item was added:
+ ----- Method: TextStyle class>>defaultTT (in category 'constants') -----
+ defaultTT
+ "Answer the default TrueType text style."
+
+ ^ self default isTTCStyle
+ ifTrue: [self default]
+ ifFalse: [self named: #BitstreamVeraSans]!
Item was added:
+ ----- Method: TextStyle class>>defaultTTFont (in category 'constants') -----
+ defaultTTFont
+
+ ^ self defaultTT defaultFont!
Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.77.mcz
==================== Summary ====================
Name: TrueType-mt.77
Author: mt
Time: 1 March 2022, 4:46:05.378172 pm
UUID: 295b5945-b51f-8946-b43e-254b9151ba2a
Ancestors: TrueType-mt.76
I forgot to commit 'familyName' instVar. Sorry for the noise. Nuke unused 'NamesToIndexes' and 'Scale' classVars.
=============== Diff against TrueType-mt.76 ===============
Item was changed:
AbstractFont subclass: #TTCFont
+ instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent colorToCacheMap lineGap lineGapSlice minCodePoint maxCodePoint extraGlyphScale extraLineGap familyName'
+ classVariableNames: 'GlyphCacheData GlyphCacheIndex GlyphCacheReady GlyphCacheSize Registry ShutdownList'
- instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent colorToCacheMap lineGap lineGapSlice minCodePoint maxCodePoint extraGlyphScale extraLineGap'
- 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.
!