[squeak-dev] The Trunk: TrueType-mt.79.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 2 09:52:15 UTC 2022
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.
!
More information about the Squeak-dev
mailing list
|