Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1920.mcz
==================== Summary ====================
Name: Morphic-mt.1920
Author: mt
Time: 3 March 2022, 8:44:36.942874 am
UUID: 9f726572-570d-2849-a91c-1bae818fb7af
Ancestors: Morphic-mt.1919
In the font-importer tool, ensure readable error messages for the preview text.
=============== Diff against Morphic-mt.1919 ===============
Item was removed:
- ----- Method: FontImporterTool>>emphasis (in category 'accessing') -----
- emphasis
-
- ^ emphasis!
Item was removed:
- ----- Method: FontImporterTool>>emphasis: (in category 'accessing') -----
- emphasis: anObject
-
- emphasis := anObject!
Item was added:
+ ----- Method: FontImporterTool>>errorText: (in category 'preview text') -----
+ errorText: aString
+ "Style the error text in a font that can display the characters."
+
+ ^ Text
+ string: aString
+ attribute: (TextFontReference toFont: TextStyle defaultFont)!
Item was changed:
----- Method: FontImporterTool>>previewText (in category 'preview text') -----
previewText
"Answer the current preview text. Avoid using a text with font-reference attributes so that any not-yet-installed font does not get spreaded across the system. See #selectedFontTextStyle to learn how the preview is rendered using the selected font."
self selectedFont ifNil: [^ ''].
self customPreviewText ifNotEmpty: [:text | ^ text withCRs].
previewTextSelector = #fontSample ifTrue: [
^ self selectedFont ttcDescription sampleText
+ ifEmpty: [self errorText: 'This font does not provide a sample text.' translated]].
- ifEmpty: ['This font does not provide a sample text.' translated]].
(previewTextSelector ~= #textSample and: [self selectedFont isSymbolFont])
+ ifTrue: [^ self errorText: 'This symbol font does not support the preview text.\Please use ''Text/Symbol'' or type a custom text.' translated withCRs].
- ifTrue: [^ 'This symbol font does not support the preview text.\Please use ''Text/Symbol'' or type a custom text.' translated withCRs asText addAttribute: (TextFontReference toFont: TextStyle defaultFont); yourself].
self selectedFont isSymbolFont
ifTrue: [^ self selectedFont symbolSample asString].
(Text respondsTo: previewTextSelector)
ifTrue: [^ (Text perform: previewTextSelector) asString].
previewTextSelector = #widgetSample
ifTrue: [^ self widgetSample].
^ ''!
A new version of MorphicExtras was added to project The Inbox:
http://source.squeak.org/inbox/MorphicExtras-lrnp.308.mcz
==================== Summary ====================
Name: MorphicExtras-lrnp.308
Author: lrnp
Time: 2 March 2022, 9:53:05.152048 pm
UUID: aaa42c8a-2ead-42a8-ae9f-e7802c4b176f
Ancestors: MorphicExtras-mt.307
Put the book, not true, in the return position.
Must Do-It:
ScrapBook cleanUp: true.
when updating in-place.
=============== Diff against MorphicExtras-mt.307 ===============
Item was changed:
----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
scrapBook
| header aButton label |
^ book ifNil: [
book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
book addCornerGrips.
book color: Color yellow muchLighter.
book borderColor: Color darkGray; borderWidth: 2.
book removeEverything; showPageControls; insertPage.
header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
header setProperty: #header toValue: true.
header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
aButton target: book;
actionSelector: #delete;
setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' translated withCRs.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
label getSelector: #trashTitle; useStringFormat; step.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
aButton target: self;
actionSelector: #maybeEmptyTrash;
setBalloonText: 'Click here to empty the trash.' translated.
book currentPage
layoutPolicy: TableLayout new;
addMorph: (TextMorph new
contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' translated withCRs;
hResizing: #spaceFill).
book addMorphFront: header.
+ book setProperty: #scraps toValue: true.
+ book].!
- book setProperty: #scraps toValue: true].!
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]].!
Hi all,
PDFtalk is a PDF library for VisualWorks[1]. The library has been ported
successfully to Gemstone[2].
Now, there is interest from companies in a port to Squeak and VA Smalltalk.
The project[3] has started and we are making good progress.
The first step: porting the Values package.
This is easy, because there are no namespace issues.
The next step is to implement class renamings so that namespaced classes can
be renamed to global prefixed names.
Then PDFtalk with all its components, except for the UI, can be ported.
The porting approach is different to the traditional way of loading and
fixing.
The import files for other Smalltalks are generated from VisualWorks where
the code is transformed by declarative rules.
The approach is documented in [4].
I set up a GitHub organization for this project[5]. There, the fileouts for
each dialect are published (Gemstone, Squeak and VA Smalltalk so far), so
that people without VisualWorks can work with the code in their Smalltalk.
Also, I record and explain all steps of the porting process for Squeak in
great detail[6], so that people can follow it.
I would like to invite Smalltalkers from all dialects to take part in this
project.
The code transformations for Squeak will be quite similar to the ones needed
for Pharo and Cuis.
Therefore, each port to one Smalltalk will help the port to other
Smalltalks.
Any takers?
Happy hacking,
Christian
[1] https://wiki.pdftalk.de/doku.php?id=start
[2] https://wiki.pdftalk.de/doku.php?id=pdftalk4gemstone
[3] https://wiki.pdftalk.de/doku.php?id=pdftalknonnamespacefileout
[4] https://wiki.pdftalk.de/doku.php?id=smalltalktransform
[5] https://github.com/PortingPDFtalk
[6] https://wiki.pdftalk.de/doku.php?id=valuesportinglog