Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1317.mcz
==================== Summary ====================
Name: System-mt.1317
Author: mt
Time: 2 March 2022, 11:55:00.421065 am
UUID: f005548a-6d1b-f244-b033-8bc84eba7121
Ancestors: System-mt.1316
Finally decouple #standardDefaultTextFont from how #scaleFactor is computed in RealEstateAgent.
=============== Diff against System-mt.1316 ===============
Item was changed:
----- Method: RealEstateAgent class>>scaleFactor (in category 'display scale') -----
scaleFactor
"Use the default font height to calculate some factor. Note that, in a distant future, we will be able to use a method that is not based on pixels once we only use TrueType fonts all over the image and have a rendering system other than BitBlt. Then, TextStyle class >> #pixelsPerInch will suffice, considering that 96 PPI represents a scale factor of 1.0. Until then, rendering is based on pixel geometry."
+ ^ ScaleFactor ifNil: [ScaleFactor := (TextStyle referenceHeight / StrikeFont referenceHeight)]!
- ^ ScaleFactor ifNil: [ScaleFactor := (TextStyle defaultFont height / StrikeFont referenceHeight)]!
Item was changed:
----- Method: UserInterfaceTheme class>>setFont:to: (in category 'tools - fonts') -----
setFont: symbolicName to: aFont
+ "Set symbolicName to aFont in all known UI themes. If aFont is a TrueType font, transform all themes into TTC-based ones."
- "Set symbolicName to aFont in all known UI themes. If aFont is a TrueType font, transform all themes into TTC-based ones and re-apply the current theme by name."
+ (symbolicName = #standardSystemFont and: [aFont isTTCFont])
+ ifTrue: [self makeAllTTCBased].
- | fontToUse |
- fontToUse := aFont.
- (symbolicName = #standardSystemFont and: [aFont isTTCFont]) ifTrue: [
- (self allThemes anySatisfy: [:uit | uit isTTCBased not])
- ifTrue: [
- self makeAllTTCBased.
- aFont pointSize ~= TTCFont referencePointSize ifTrue: [
- "Do not change current #scaleFactor by accident. Use standard point size."
- fontToUse := aFont asPointSize: TTCFont referencePointSize.
- self inform: ((('Your system is now using <b>TrueType</b> fonts. The point size you specified was reset to <b>{1}pt</b> to retain the system''s current scale factor of <b>{2}%.</b>\\You can repeat this if you really want to use <b>{3}pt</b>. However, it is advised to change the <b>system''s scale factor</b> if you want to make all fonts look smaller or larger on your current display.\See the menu <b>Extras > Scale Factor</b>.' translated withCRs format: {fontToUse pointSize. (Display relativeUiScaleFactor * 100) rounded. aFont pointSize}) withNoLineLongerThan: 70) copyReplaceAll: String cr with: '<br>') asTextFromHtml]]
- ifFalse: [ "The user tried to increase the system's overall font size. Increase the scale factor instead. See RealEstateAgent class >> #scaleFactor, which is what all client code uses if it does not scale through font metrics."
- | scaleFactorDelta |
- scaleFactorDelta := ((aFont pointSize asFloat / TTCFont referencePointSize) roundTo: 0.25) - 1.0.
- fontToUse := aFont asPointSize: TTCFont referencePointSize.
- scaleFactorDelta = 0 ifFalse: [
- Display uiScaleFactor: Display uiScaleFactor + scaleFactorDelta.
- self inform: ((('You tried to change the system''s standard font size from <b>{1}pt</b> to <b>{2}pt</b>, which is an increase of about <b>{3}%</b>. As a result, the system''s scale factor was changed to <b>{4}%</b>.\\Other fonts will now appear smaller or larger as well. The system''s standard font size remains at <b>{1}pt</b>. Note that you may also edit the font''s <b>extra glyph scale</b> to make it look smaller or larger at the same point size.'translated withCRs format: {TTCFont referencePointSize. aFont pointSize. (scaleFactorDelta * 100) rounded. (Display relativeUiScaleFactor * 100) rounded.}) withNoLineLongerThan: 70) copyReplaceAll: String cr with: '<br>') asTextFromHtml]] ].
self allThemes do: [:uit |
+ uit setFont: symbolicName to: aFont].!
- uit setFont: symbolicName to: fontToUse].!
Item was changed:
----- Method: UserInterfaceTheme class>>setSystemFontTo: (in category 'tools - fonts') -----
setSystemFontTo: aFont
"Establish the default text font and style"
aFont isTTCFont not ifTrue: [
Display uiScaleFactor = 1.0
ifFalse: [^ self error: 'You may only set a pre-rendered font for 100% scale factor'].
aFont height = StrikeFont referenceHeight
ifFalse: [^ self error: ('Incompatible pre-rendered font for 100% scale factor. Height must be {1} px' format: {StrikeFont referenceHeight})]].
- "Documentation only. Users can increase the default font size to any value. Yet, RealEstateAgent class >> #scaleFactor will change and the system effectively render stuff larger. So, it would be a good idea to keep #pixelSize/#height of system font, list font, and menu font similar.
-
- (aFont isTTCFont and: [aFont pointSize ~= TTCFont referencePointSize])
- ifTrue: [self notify: ('The standard system/text font should be {1} pt. If you want to increase the overall font size, please change the screen scale factor instead. You may proceed without harm.' format: {TTCFont referencePointSize})].
- "
self setFont: #standardSystemFont to: aFont.!
Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.79.mcz
==================== Summary ====================
Name: TrueType-mt.79
Author: mt
Time: 2 March 2022, 10:52:13.629269 am
UUID: 1de8388f-08db-7248-9cd3-136cf1308e9d
Ancestors: TrueType-mt.78
In TextConstants, organize known style names as symbol, not string.
=============== Diff against TrueType-mt.78 ===============
Item was changed:
----- Method: TTCFont class>>reorganizeForNewFontArray:name: (in category 'other') -----
reorganizeForNewFontArray: array name: styleName
| style existings regular altName |
(TextConstants includesKey: styleName) ifFalse: [
+ style := TextConstants at: styleName asSymbol put: (TextStyle fontArray: array).
- style := TextConstants at: styleName put: (TextStyle fontArray: array).
self register: array at: styleName. "Do this first to make #asPointSize: work"
style defaultFont asPointSize: TextStyle defaultFont pointSize. "May create new point size"
style defaultFontIndex: (style fontIndexOfPointSize: TextStyle defaultFont pointSize).
^ style
].
"There is a text style with the name I want to use. See if it is a TTC font..."
style := TextConstants at: styleName.
style isTTCStyle ifFalse: [
altName := ((array at: 1) name, 'TT') asSymbol.
^ self reorganizeForNewFontArray: array name: altName.
].
existings := (self getExistings: style fontArray), (Array with: array).
regular := existings detect: [:e | (e at: 1) isRegular] ifNone: [existings at: 1].
regular do: [:r |
r addLined: r.
].
"The existing array may be different in size than the new one."
existings do: [:e |
(e at: 1) isRegular ifFalse: [
regular do: [ :r | | f |
f := e detect: [ :ea | ea pointSize = r pointSize ] ifNone: [ ].
f ifNotNil: [ r derivativeFont: f ].
].
].
].
self register: regular at: styleName.
style newFontArray: regular.
style defaultFont asPointSize: TextStyle defaultFont pointSize. "May create new point size"
style defaultFontIndex: (style fontIndexOfPointSize: TextStyle defaultFont pointSize).
^ style.
!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1316.mcz
==================== Summary ====================
Name: System-mt.1316
Author: mt
Time: 2 March 2022, 9:44:47.386783 am
UUID: c1dc4939-f264-4c42-9022-1efe9da28147
Ancestors: System-mt.1315
Complements Morphic-mt.1918.
=============== Diff against System-mt.1315 ===============
Item was changed:
----- Method: UserInterfaceTheme class>>makeAllTTCBased (in category 'tools') -----
makeAllTTCBased
"Converts all known themes to only use TrueType fonts. Use #cleanUpAndReset if you want to undo this later."
+ (self allThemes allSatisfy: [:uit | uit isTTCBased])
+ ifTrue: [^ self].
+
self resetAfter: [
self allThemes copy do: [:uit | uit isGenuine ifFalse: [uit unregister]].
self allThemes do: [:uit | uit makeTTCBased]].!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.992.mcz
==================== Summary ====================
Name: Collections-eem.992
Author: eem
Time: 1 March 2022, 12:39:53.850609 pm
UUID: 677dd86e-ae58-41d3-b125-af837d2cdb61
Ancestors: Collections-mt.991
Add some missing features to the imfamous postcard.
=============== Diff against Collections-mt.991 ===============
Item was changed:
----- 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, byte array), uses the pseudo variables nil, true,
+ false, self, super, and thisContext, shows that within a literal array
+ nil, true and false are symbols not pseudo variables, and has sequence,
+ assignment, return, cascade, and tuple (array) creation. It has both
+ zero argument and one argument blocks, and has a block temporary."
- (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 nil true false), { #[65]. thisContext. nil. true. false }
+ do: [ :each | | class |
+ class := each class.
- #($a #a ''a'' "a" 1 1.0)
- do: [ :each |
Transcript
+ show: (class name);
- show: (each class name);
show: '' ''].
^ x < y'!
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]]]!