[squeak-dev] The Trunk: TrueType-mt.55.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Dec 21 17:08:47 UTC 2021
Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.55.mcz
==================== Summary ====================
Name: TrueType-mt.55
Author: mt
Time: 21 December 2021, 6:08:48.046727 pm
UUID: 6b9c0693-4654-4470-b6e4-f0f3a5bd4015
Ancestors: TrueType-tonyg.54
Complements EToys-mt.453.
=============== Diff against TrueType-tonyg.54 ===============
Item was added:
+ ----- Method: TTCFont class>>familyName:pointSize: (in category 'instance creation') -----
+ familyName: n pointSize: s
+
+ ^ self familyName: n pointSize: s emphasized: 0!
Item was changed:
----- Method: TTCFont class>>familyName:pointSize:emphasis: (in category 'instance creation') -----
familyName: n pointSize: s emphasis: code
+ ^ self familyName: n pointSize: s emphasized: code!
- "(TTCFont familyName: 'BitstreamVeraSans' pointSize: 12 emphasis: 0)"
- | t ret index |
- t := self registry at: n asSymbol ifAbsent: [#()].
- t isEmpty ifTrue: [
- t := (TextConstants at: #DefaultTextStyle) fontArray.
- ret := t first.
- ret pointSize >= s ifTrue: [^ ret emphasis: code].
- index := 2.
- [index <= t size and: [(t at: index) pointSize <= s]] whileTrue: [
- ret := t at: index.
- index := index + 1.
- ].
- ^ ret emphasis: code.
- ].
- ^ ((TextStyle named: n) addNewFontSize: s) emphasis: code.
- !
Item was added:
+ ----- Method: TTCFont class>>familyName:pointSize:emphasized: (in category 'instance creation') -----
+ familyName: n pointSize: s emphasized: code
+
+ "(TTCFont familyName: 'BitstreamVeraSans' pointSize: 12 emphasized: 0)"
+ | t ret index |
+ t := self registry at: n asSymbol ifAbsent: [#()].
+ t isEmpty ifTrue: [
+ t := (TextConstants at: #DefaultTextStyle) fontArray.
+ ret := t first.
+ ret pointSize >= s ifTrue: [^ ret emphasis: code].
+ index := 2.
+ [index <= t size and: [(t at: index) pointSize <= s]] whileTrue: [
+ ret := t at: index.
+ index := index + 1.
+ ].
+ ^ ret emphasis: code.
+ ].
+ ^ ((TextStyle named: n) addNewFontSize: s) emphasis: code.
+ !
Item was changed:
+ ----- Method: TTCFont class>>reorganizeForNewFontArray:name: (in category 'other') -----
- ----- Method: TTCFont class>>reorganizeForNewFontArray:name: (in category 'instance creation') -----
reorganizeForNewFontArray: array name: styleName
| style existings regular altName |
(TextConstants includesKey: styleName) ifFalse: [
TextConstants at: styleName put: (TextStyle fontArray: array).
^ TextConstants at: styleName.
].
"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 ].
].
].
].
style newFontArray: regular.
self register: regular at: styleName.
self recreateCache.
^ style.
!
Item was removed:
- ----- Method: TTCFont>>pixelSize (in category 'accessing') -----
- pixelSize
- "Make sure that we don't return a Fraction"
- ^(TextStyle pointsToPixels: pointSize) truncated!
Item was changed:
----- Method: TTCFont>>printOn: (in category 'printing') -----
printOn: aStream
+
+ super printOn: aStream.
+
+
+ aStream
+ nextPut: $(;
+ nextPutAll: self familyName;
+ space; nextPutAll: self subfamilyName;
+ space; print: self pointSize; nextPutAll: 'pt';
+ space; print: self pixelsPerInch; nextPutAll: 'ppi';
+ space; print: self height; nextPutAll: 'px';
- aStream nextPutAll: 'TTCFont(';
- nextPutAll: self familyName; space;
- print: self pointSize; space;
- nextPutAll: self subfamilyName;
nextPut: $)!
More information about the Squeak-dev
mailing list
|