Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.471.mcz
==================== Summary ====================
Name: Compiler-nice.471
Author: nice
Time: 10 March 2022, 10:06:12.445899 am
UUID: ebc43c86-7bbc-764d-9bbb-6c9ecfb21a10
Ancestors: Compiler-mt.470
Workaround VM bug https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/618
We avoid using extend B bytecode (225) + push character bytecode (233) when character value > 16r7FFF.
In this case, the character literal will be accessed thru traditional genPushLiteral: bytecode.
=============== Diff against Compiler-mt.470 ===============
Item was changed:
----- Method: EncoderForSistaV1>>genPushCharacter: (in category 'bytecode generation') -----
genPushCharacter: aCharacterOrCode
"233 11101001 i i i i i i i i Push Character #iiiiiiii (+ Extend B * 256)"
"Why restrict the range to 16 bits when we could encode arbitrarily 32-bit Characters?
Well, 16 bits requires 4 bytes (extB + byte, 78 + byte) and so beyond this range we
lose space verses a single-byte pushLiteral and a 4 byte Character literal on 32-bits.
And generating the same bytecode on 64-bit and 32-bit is important if we want to be
able to load binary code from one to the other (e.g. via Fuel)."
| code |
code := aCharacterOrCode isInteger ifTrue: [aCharacterOrCode] ifFalse: [aCharacterOrCode asInteger].
+ "Note: due to a bug at VM side, Character above 16r8000 are reconstructed with a negative value.
+ This is because extend B is interpreted as signed integer.
+ See https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/618
+ For compatibility with old VM, we restrict usage of push character bytecode to safe cases extB < 16r80."
+ (code < 0 or: [code > 16r7FFF]) ifTrue:
+ [^self outOfRangeError: 'character' index: code range: 0 to: 16r7FFF].
- (code < 0 or: [code > 65535]) ifTrue:
- [^self outOfRangeError: 'character' index: code range: 0 to: 65535].
(code > 255) ifTrue:
[self genUnsignedSingleExtendB: (code bitShift: -8)].
stream
nextPut: 233;
nextPut: (code bitAnd: 255)!
Item was changed:
----- Method: EncoderForSistaV1>>isSpecialLiteralForPush: (in category 'special literal encodings') -----
isSpecialLiteralForPush: literal
^literal isInteger
ifFalse:
[literal isCharacter
ifFalse:
[false == literal
or: [true == literal
or: [nil == literal]]]
ifTrue:
+ ["Restrict character range due to VM bug at character value reconstruction
+ See https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/618"
+ literal asInteger between: 0 and: 16r7FFF]]
- [literal asInteger between: 0 and: 65535]]
ifTrue:
[literal between: -32768 and: 32767]!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.494.mcz
==================== Summary ====================
Name: Graphics-mt.494
Author: mt
Time: 9 March 2022, 9:14:55.14746 am
UUID: 2d79f751-96ed-6c4f-9a7c-6f61717bd265
Ancestors: Graphics-mt.493
Fixes color in glyphs when font is used as a fallback font.
=============== Diff against Graphics-mt.493 ===============
Item was added:
+ ----- Method: AbstractFont>>displayString:on:from:to:at:kern:from:baselineY: (in category 'displaying') -----
+ displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta from: fromFont baselineY: baselineY
+ "I am used as a fallback for fromFont. I should install myself on aBitBlt. The default implementation does not do that but directly uses my usual displaying method."
+
+ self flag: #subclassResponsibility. "mt: Something like #installStrikeFont: or #installTTCFont:."
+ ^ self displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY!
Item was added:
+ ----- Method: AbstractFont>>foregroundColor (in category 'displaying') -----
+ foregroundColor
+
+ ^ Color black!
Item was added:
+ ----- Method: AbstractFont>>foregroundColor: (in category 'displaying') -----
+ foregroundColor: fgColor
+ "Install the given foreground color. This does nothing for other than TrueType fonts. In StrikeFonts, color installation is bound to BitBlt."!
Item was added:
+ ----- Method: BitBlt>>installStrikeFont: (in category 'private') -----
+ installStrikeFont: aStrikeFont
+
+ ^ self installStrikeFont: aStrikeFont foregroundColor: Color black backgroundColor: Color transparent!
Item was added:
+ ----- Method: BitBlt>>installTTCFont: (in category 'private') -----
+ installTTCFont: aTTCFont
+
+ ^ self installTTCFont: aTTCFont foregroundColor: Color black backgroundColor: Color transparent!
Item was added:
+ ----- Method: FixedFaceFont>>foregroundColor (in category 'displaying') -----
+ foregroundColor
+
+ ^ baseFont foregroundColor!
Item was added:
+ ----- Method: FixedFaceFont>>foregroundColor: (in category 'displaying') -----
+ foregroundColor: fgColor
+
+ baseFont foregroundColor: fgColor.!
Item was added:
+ ----- Method: StrikeFont>>displayString:on:from:to:at:kern:from:baselineY: (in category 'displaying') -----
+ displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta from: fromFont baselineY: baselineY
+ "I am used as a fallback for fromFont, which is most likely a StrikeFont."
+
+ aBitBlt installStrikeFont: self.
+ ^ self displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1928.mcz
==================== Summary ====================
Name: Morphic-mt.1928
Author: mt
Time: 7 March 2022, 11:32:59.261569 am
UUID: b744f763-6518-bf43-8ffb-3324ea8141c3
Ancestors: Morphic-mt.1927
In the font chooser, inform the user why a custom point size is not available for pre-rendered fonts.
Thanks to Lauren (lrnp) for the tip!
=============== Diff against Morphic-mt.1927 ===============
Item was changed:
----- Method: FontChooserTool>>selectedFont (in category 'font list') -----
selectedFont
"Generate missing pointSIze only if TrueType font."
| style |
^ (style := self selectedTextStyle) isTTCStyle
ifTrue: [ style fontArray size = 1 "Font not yet installed..."
ifTrue: [style defaultFont]
ifFalse: [TTCFont familyName: self selectedFontFamily pointSize: pointSize emphasized: emphasis]]
ifFalse: [
| font |
font := (style fontOfPointSize: pointSize) emphasized: emphasis.
+ pointSize ~= font pointSize ifTrue: [
+ self inform: ('The point size you requested is not available for this pre-rendered font. Please choose a TrueType font, where you can add custom point sizes.' translated withNoLineLongerThan: 45).
+ pointSize := font pointSize].
- pointSize := font pointSize. "Can be different for StrikeFont."
self changed: #selectedPointSizeIndex.
font]!