Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2024.mcz
==================== Summary ====================
Name: Morphic-mt.2024
Author: mt
Time: 15 August 2022, 12:46:58.334306 pm
UUID: 2fd9a707-6be5-514a-8003-d9575eb99687
Ancestors: Morphic-mt.2023
Fixes minimal width of TextMorph. Adds more commentary to the relevant methods.
Thanks to Stef (spfa) for pointing this out!
I will backport this to Squeak 6.0.
=============== Diff against Morphic-mt.2023 ===============
Item was changed:
----- Method: TextMorph>>createParagraph (in category 'private') -----
createParagraph
self setProperty: #CreatingParagraph toValue: true.
[
self setDefaultContentsIfNil.
"...Code here to recreate the paragraph..."
paragraph := (self paragraphClass new textOwner: self owner).
paragraph wantsColumnBreaks: successor notNil.
paragraph
compose: text
style: textStyle
from: self startingIndex
in: self container.
wrapFlag ifFalse:
["Was given huge container at first... now adjust"
+ paragraph adjustRightX].
- paragraph adjustRightXDownTo: self minCompositionWidth].
paragraph focused: (self currentHand keyboardFocus == self).
paragraph
caretColor: self caretColor;
selectionColor: self selectionColor;
unfocusedSelectionColor: self unfocusedSelectionColor.
self fit.
] ensure: [self removeProperty: #CreatingParagraph].
^ paragraph!
Item was changed:
----- Method: TextMorph>>minCompositionHeight (in category 'layout') -----
minCompositionHeight
+ "Answer the minimal height for the receiver's composited contents. Without linebreaks, this height matches the default font's line grid. Note that we cannot use information from paragraph here, as it would require the text composition to have already happened."
^ (textStyle ifNil: [TextStyle default]) lineGrid!
Item was changed:
----- Method: TextMorph>>minCompositionWidth (in category 'layout') -----
minCompositionWidth
+ "Answer the minimal width for the receiver's composited contents. Without specific content, this width could be zero but matches the default font's example text to avoid composition issues. Note that we cannot use information from paragraph here, as it would require the text composition to have already happened."
+ self flag: #todo. "mt: Fix issues in CompositionScanner to allow for 0 or at least fit a specific character to match the single-line metric in #minCompositionHeight."
^ ((textStyle ifNil: [TextStyle default]) defaultFont widthOf: $x) * 2!
Item was changed:
----- Method: TextMorph>>minHeight (in category 'layout') -----
minHeight
+ "Answer the minimal height of the receiver to be used in Morphic layout policies. Avoid text composition if there is no paragraph yet to speed up overall layouting and avoid cyclic algorithmic dependencies. The minimal height is basically computed from text-composition metrics and extra decoration such as borders and margins."
| result |
result := (paragraph
ifNil: [self minCompositionHeight]
ifNotNil: [:para| para lines first lineHeight])
+ (self borderWidth*2).
margins ifNil: [^ result].
^ margins isRectangle
ifTrue: [result + margins top + margins bottom]
ifFalse: [margins isPoint
ifTrue: [result + margins y + margins y]
ifFalse: [result + (2*margins)]]!
Item was changed:
----- Method: TextMorph>>minWidth (in category 'layout') -----
minWidth
+ "Answer the minimal width of the receiver to be used in Morphic layout policies. Avoid text composition if there is no paragraph yet to speed up overall layouting and avoid cyclic algorithmic dependencies. The minimal width is basically computed from text-composition metrics and extra decoration such as borders and margins."
+
-
| result |
result := self minCompositionWidth + (self borderWidth*2).
margins ifNil: [^ result].
^ margins isRectangle
ifTrue: [result + margins left + margins right]
ifFalse: [margins isPoint
ifTrue: [result + margins x + margins x]
ifFalse: [result + (2*margins)]]!
Marcel Taeumel uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-mt.286.mcz
==================== Summary ====================
Name: Multilingual-mt.286
Author: mt
Time: 11 August 2022, 11:07:36.895716 am
UUID: 942929f9-099f-914a-925a-4b1eaaf4f425
Ancestors: Multilingual-mt.285
Updates some categories.
=============== Diff against Multilingual-mt.285 ===============
Item was changed:
+ ----- Method: GreekEnvironment class>>supportedLanguages (in category 'accessing') -----
- ----- Method: GreekEnvironment class>>supportedLanguages (in category 'subclass responsibilities') -----
supportedLanguages
"Return the languages that this class supports.
Any translations for those languages will use this class as their environment."
^#('el' )!
Item was changed:
+ ----- Method: Latin2Environment class>>clipboardInterpreterClass (in category 'accessing') -----
- ----- Method: Latin2Environment class>>clipboardInterpreterClass (in category 'subclass responsibilities') -----
clipboardInterpreterClass
(#('Win32') includes: Smalltalk platformName)
ifTrue: [^CP1250ClipboardInterpreter ].
^ ISO88592ClipboardInterpreter .
!
Item was changed:
+ ----- Method: Latin2Environment class>>inputInterpreterClass (in category 'accessing') -----
- ----- Method: Latin2Environment class>>inputInterpreterClass (in category 'subclass responsibilities') -----
inputInterpreterClass
(#('Win32') includes: Smalltalk platformName)
ifTrue: [^CP1250InputInterpreter ].
^ ISO88592InputInterpreter.
!
Item was changed:
+ ----- Method: Latin2Environment class>>supportedLanguages (in category 'accessing') -----
- ----- Method: Latin2Environment class>>supportedLanguages (in category 'subclass responsibilities') -----
supportedLanguages
"Return the languages that this class supports.
Any translations for those languages will use this class as their environment."
^#('cs' 'hu' 'ro' 'hr' 'sk' 'sl') "Sorbian languages don't have two char code?"
!
Item was changed:
+ ----- Method: RussianEnvironment class>>clipboardInterpreterClass (in category 'accessing') -----
- ----- Method: RussianEnvironment class>>clipboardInterpreterClass (in category 'subclass responsibilities') -----
clipboardInterpreterClass
^ UTF8ClipboardInterpreter.
!
Item was changed:
+ ----- Method: RussianEnvironment class>>inputInterpreterClass (in category 'accessing') -----
- ----- Method: RussianEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') -----
inputInterpreterClass
| platformName |
platformName := Smalltalk platformName.
platformName = 'Win32'
ifTrue: [^UTF32RussianInputInterpreter].
platformName = 'Mac OS'
ifTrue: [^ (((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc")
and: [(Smalltalk getSystemAttribute: 3) isNil])
ifTrue: [MacUnicodeInputInterpreter]
ifFalse: [MacRomanInputInterpreter]].
platformName = 'unix'
ifTrue: [^ UTF32RussianInputInterpreter].
^ MacRomanInputInterpreter!
Item was changed:
+ ----- Method: RussianEnvironment class>>supportedLanguages (in category 'accessing') -----
- ----- Method: RussianEnvironment class>>supportedLanguages (in category 'subclass responsibilities') -----
supportedLanguages
"Return the languages that this class supports.
Any translations for those languages will use this class as their environment."
^#('ru' )!
Item was changed:
+ ----- Method: RussianEnvironment class>>systemConverterClass (in category 'accessing') -----
- ----- Method: RussianEnvironment class>>systemConverterClass (in category 'subclass responsibilities') -----
systemConverterClass
^ UTF8TextConverter!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.533.mcz
==================== Summary ====================
Name: Graphics-mt.533
Author: mt
Time: 11 August 2022, 11:03:26.624716 am
UUID: b88c0a4b-3f7a-5d49-bc62-9bd70017a75f
Ancestors: Graphics-mt.532
Minor fix for "holes" in the xTable of (legacy) StrikeFonts. For example, the "JapaneseEnvironment new installFont" will load a StrikeFont with a lot of glyphs but holes in the xTable.
=============== Diff against Graphics-mt.532 ===============
Item was changed:
----- Method: StrikeFont>>hasGlyphForCode: (in category 'private') -----
hasGlyphForCode: aCharacterCode
"Note that missing glyphs are encoded as -1 in the xTable but to speed up the #widthOf: check, the next offset must be adjacent and thus be duplicated. For example: #(-1 -1 0 24 -1 -1 -1 24 48 -1 ...). Since aCharacterCode is 0-based, that codes offset is at +1 while its width needs to consult +2, too. See #widthOf:."
+ | here next |
(aCharacterCode between: self minAscii and: self maxAscii)
ifFalse: [^ false].
+ (here := xTable at: aCharacterCode + 1) >= 0
- (xTable at: aCharacterCode + 1) >= 0
ifFalse: [^ false].
+ (next := xTable at: aCharacterCode + 2) >= 0
- (xTable at: aCharacterCode + 2) >= 0
ifFalse: [^ false].
+ (next - here) > 0
+ ifFalse: [^ false].
^ true!