[squeak-dev] The Trunk: Graphics-mt.487.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Feb 25 09:32:19 UTC 2022
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.487.mcz
==================== Summary ====================
Name: Graphics-mt.487
Author: mt
Time: 25 February 2022, 10:32:11.90563 am
UUID: be4417fd-f7bd-7047-800d-6ab6ec40c0a7
Ancestors: Graphics-mt.486
Complements TrueType-mt.72
=============== Diff against Graphics-mt.486 ===============
Item was changed:
----- Method: TextStyle class>>fontSizeSummaryContents (in category 'utilities') -----
fontSizeSummaryContents
^ Text streamContents: [:aStream |
| knownStyles knownTTCStyles knownLegacyStyles defaultStyles printBlock |
knownStyles := self knownTextStylesWithoutDefault sorted.
defaultStyles := self defaultFamilyNames sorted.
aStream nextPutAll: ('This page lists all known text styles and for each style''s font the available point sizes. Most text fields offer the {1} where you can choose a different font or point size. Note that you can use any new point size for TrueType fonts. This is, however, not possible for our pre-rendred legacy fonts. If you need more fonts, use the {2} to import TrueType fonts from your current platform. Click {3} to browse all styles by example.\\'
translated withCRs asText format: {
'FontChooserTool' asText
addAttribute: (PluggableTextAttribute evalBlock: [FontChooserTool open]); yourself.
'FontImporterTool' asText
addAttribute: (PluggableTextAttribute evalBlock: [FontImporterTool open]); yourself.
'here' asText
addAttribute: (PluggableTextAttribute evalBlock: [TextStyle browseAllStyles])}).
defaultStyles do: [:styleName |
| style prefix |
style := self named: styleName.
prefix := (style isNil or: [(self named: style defaultFamilyName) == style]) ifTrue: [''] ifFalse: [' !! '].
aStream
nextPutAll: (((styleName padded: #left to: 24 with: Character space), ': ', prefix) asText addAttribute: (TextFontReference toFont: TextStyle defaultFixedFont); yourself);
nextPutAll: (style ifNil: ['-'] ifNotNil: [(style defaultFamilyName asText addAttribute: (TextFontReference toFont: style defaultFont); addAttribute: (PluggableTextAttribute evalBlock: [style explore]); yourself)]);
cr].
printBlock := [:styleName |
+ | style defaultFont preferredPointSize exampleFont |
- | style tt defaultFont preferredPointSize exampleFont |
style := self named: styleName.
preferredPointSize := TextStyle defaultFont pointSize. "system's current default"
defaultFont := style defaultFont. "style's current default"
exampleFont := defaultFont isSymbolFont
+ ifTrue: [TextStyle defaultFont "famiyl name should be legible"]
- ifTrue: [TextStyle defaultFont]
ifFalse: [defaultFont asPointSize: preferredPointSize].
aStream
nextPutAll: (styleName asText addAttribute: (TextFontReference toFont: exampleFont)).
styleName ~= style defaultFamilyName ifTrue: ["style alias"
aStream nextPutAll: ' (', style defaultFamilyName, ')'].
- tt := style isTTCStyle ifTrue: [style defaultFont ttcDescription].
aStream
nextPutAll: ((Text new,
+ ((style isTTCStyle ifFalse: [''] ifTrue: [' TrueType', (defaultFont isRemoteFont ifFalse: [''] ifTrue: [' (remote)']), (defaultFont isSymbolFont ifFalse: [''] ifTrue: [' (symbols)'])])
- ((style isTTCStyle ifFalse: [''] ifTrue: [' TrueType', (tt isExternal ifFalse: [''] ifTrue: [' (extern)']), (defaultFont isSymbolFont ifFalse: [''] ifTrue: [' (symbols)'])])
asText addAttribute: (TextColor color: ((self userInterfaceTheme get: #balloonTextColor for: #PluggableTextMorphPlus) ifNil: [Color gray])); yourself),
(style isTTCStyle ifFalse: [''] ifTrue: [ | eg |
' ... ' asText,
+ ((' ', (defaultFont extraGlyphScale * 100) rounded asString, '%') asText addAttribute: (PluggableTextAttribute evalBlock: [style chooseExtraScale]); yourself),
+ ((' ', ((eg := defaultFont extraLineGap) >= 0 ifTrue: ['+', eg asString] ifFalse: [eg asString])) asText addAttribute: (PluggableTextAttribute evalBlock: [style chooseExtraGap]); yourself) ]),
- ((' ', (tt extraScale * 100) rounded asString, '%') asText addAttribute: (PluggableTextAttribute evalBlock: [style chooseExtraScale]); yourself),
- ((' ', ((eg := tt extraGap) >= 0 ifTrue: ['+', eg asString] ifFalse: [eg asString])) asText addAttribute: (PluggableTextAttribute evalBlock: [style chooseExtraGap]); yourself) ]),
' ... ',
('explore' translated asText addAttribute: (PluggableTextAttribute evalBlock: [style explore]); yourself),
' ',
('browse' translated asText addAttribute: (PluggableTextAttribute evalBlock: [defaultFont browseAllGlyphs; browseAllGlyphsByCategory]); yourself),
' ') addAttribute: (TextFontReference toFont: Preferences standardButtonFont); yourself);
cr.
aStream nextPutAll: (((self fontPointSizesFor: styleName) inject: ' ' asText into: [:text :pointSize |
pointSize = defaultFont pointSize
ifFalse: [text, ((pointSize asFloat printShowingDecimalPlaces: 1) padded: #left to: 5 with: Character space)]
ifTrue: [text, (((pointSize asFloat printShowingDecimalPlaces: 1) padded: #left to: 5 with: Character space) asText addAttribute: TextEmphasis bold; yourself)]]) addAttribute: (TextFontReference toFont: TextStyle defaultFixedFont); yourself).
aStream cr; cr].
knownTTCStyles := knownStyles select: [:ea | (self named: ea) isTTCStyle].
knownLegacyStyles := knownStyles reject: [:ea | (self named: ea) isTTCStyle].
aStream cr.
knownTTCStyles do: printBlock.
aStream nextPutAll: ('The following pre-rendered legacy fonts are still available. Note that you can only choose from the point sizes that are listed here. Each point size has a pixel size for 96 PPI. The system scales currently for {1} PPI.' translated format: {TextStyle pixelsPerInch}) ; cr; cr.
knownLegacyStyles do: printBlock.
].!
More information about the Squeak-dev
mailing list
|