[squeak-dev] The Trunk: Graphics-mt.481.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 14 16:37:09 UTC 2022
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.481.mcz
==================== Summary ====================
Name: Graphics-mt.481
Author: mt
Time: 14 February 2022, 5:37:01.583304 pm
UUID: 4ac783b7-38f7-4444-93c4-c37f188236cf
Ancestors: Graphics-mt.480
Complements Tools-mt.1134.
=============== Diff against Graphics-mt.480 ===============
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 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]
+ ifFalse: [defaultFont asPointSize: preferredPointSize].
- exampleFont := 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', (tt isExternal ifFalse: [''] ifTrue: [' (extern)']), (defaultFont isSymbolFont ifFalse: [''] ifTrue: [' (symbols)'])])
- ((style isTTCStyle ifFalse: [''] ifTrue: [' TrueType', (tt isExternal ifFalse: [''] ifTrue: [' (extern)'])])
asText addAttribute: (TextColor color: ((self userInterfaceTheme get: #balloonTextColor for: #PluggableTextMorphPlus) ifNil: [Color gray])); yourself),
(style isTTCStyle ifFalse: [''] ifTrue: [ | eg |
' ... ' asText,
((' ', (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),
- ('browse' translated asText addAttribute: (PluggableTextAttribute evalBlock: [defaultFont browseAllGlyphs]); 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
|