[squeak-dev] The Trunk: Morphic-mt.1920.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Mar 3 07:44:43 UTC 2022
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].
^ ''!
More information about the Squeak-dev
mailing list
|