The Trunk: TrueType-fbs.24.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: TrueType-fbs.24.mcz

commits-2
Frank Shearar uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-fbs.24.mcz

==================== Summary ====================

Name: TrueType-fbs.24
Author: fbs
Time: 23 July 2013, 8:03:21.427 pm
UUID: eda594ba-709d-044f-a262-d4ebf17ffd90
Ancestors: TrueType-fbs.23

Make TrueType sit above (and extend) Graphics, thus breaking the cyclic dependency.

The decoupling is pretty rough. By all means make the division between these two packages cleaner!

=============== Diff against TrueType-fbs.23 ===============

Item was added:
+ ----- Method: CharacterScanner>>scanJapaneseCharactersFrom:to:in:rightX:stopConditions:kern: (in category '*TrueType') -----
+ scanJapaneseCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta
+
+ | ascii encoding f nextDestX startEncoding |
+ lastIndex := startIndex.
+ lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops endOfRun].
+ startEncoding := (sourceString at: startIndex) leadingChar.
+ font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at: 1].
+ ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet]) ifTrue: [
+ f := font fontArray at: startEncoding + 1.
+ spaceWidth := f widthOf: Space.
+ ].
+
+ [lastIndex <= stopIndex] whileTrue: [
+ encoding := (sourceString at: lastIndex) leadingChar.
+ encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops endOfRun].
+ ascii := (sourceString at: lastIndex) charCode.
+ (encoding = 0 and: [ascii < 256 and:[(stops at: ascii + 1) notNil]])
+ ifTrue: [^ stops at: ascii + 1].
+ nextDestX := destX + (font widthOf: (sourceString at: lastIndex)).
+ nextDestX > rightX ifTrue: [^ stops crossedX].
+ destX := nextDestX + kernDelta.
+ "destX printString displayAt: 0@(lastIndex*20)."
+ lastIndex := lastIndex + 1.
+ ].
+ lastIndex := stopIndex.
+ ^ stops endOfRun!

Item was added:
+ ----- Method: CharacterScanner>>scanMultiCharactersFrom:to:in:rightX:stopConditions:kern: (in category '*TrueType') -----
+ scanMultiCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta
+
+ | ascii encoding f nextDestX startEncoding |
+ lastIndex := startIndex.
+ lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops endOfRun].
+ startEncoding := (sourceString at: startIndex) leadingChar.
+ font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at: 1].
+ ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet]) ifTrue: [
+ f := font fontArray at: startEncoding + 1.
+ spaceWidth := f widthOf: Space.
+ ].
+
+ [lastIndex <= stopIndex] whileTrue: [
+ encoding := (sourceString at: lastIndex) leadingChar.
+ encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops endOfRun].
+ ascii := (sourceString at: lastIndex) charCode.
+ (encoding = 0 and: [ascii < 256 and:[(stops at: ascii + 1) notNil]])
+ ifTrue: [^ stops at: ascii + 1].
+ nextDestX := destX + (font widthOf: (sourceString at: lastIndex)).
+ nextDestX > rightX ifTrue: [^ stops crossedX].
+ destX := nextDestX + kernDelta.
+ "destX printString displayAt: 0@(lastIndex*20)."
+ lastIndex := lastIndex + 1.
+ ].
+ lastIndex := stopIndex.
+ ^ stops endOfRun!

Item was added:
+ ----- Method: HostFont class>>initForSubtitles (in category '*TrueType') -----
+ initForSubtitles
+ "
+ HostFont initForSubtitles
+ "
+
+ HostFont textStyleFrom: 'Verdana' sizes: #(18 20 22 24 26 28) ranges: HostFont defaultRanges.
+
+ StrikeFontSet installExternalFontFileName: 'greekFont.out' encoding: GreekEnvironment leadingChar encodingName: #Greek textStyleName: #DefaultMultiStyle.
+
+
+ TTCFontReader encodingTag: SimplifiedChineseEnvironment leadingChar.
+ TTCFontSet newTextStyleFromTTFile: 'C:\WINDOWS\Fonts\simhei.TTF'.
+
+ TTCFontReader encodingTag: JapaneseEnvironment leadingChar.
+ TTCFontSet newTextStyleFromTTFile: 'C:\WINDOWS\Fonts\msgothic.TTC'.
+
+ TTCFontReader encodingTag: KoreanEnvironment leadingChar.
+ TTCFontSet newTextStyleFromTTFile: 'C:\WINDOWS\Fonts\gulim.TTC'.
+ !

Item was added:
+ ----- Method: HostFont class>>unloadAsianTT (in category '*TrueType') -----
+ unloadAsianTT
+ "
+ self unloadAsianTT
+ "
+
+ TTCFontSet removeStyleName: 'MultiSimHei'.
+ TTCFontSet removeStyleName: 'MultiMSGothic'.
+ TTCFontSet removeStyleName: 'MultiGulim'.
+ !

Item was added:
+ ----- Method: TextStyle>>addLinedIfTT (in category '*TrueType') -----
+ addLinedIfTT
+
+ (fontArray first isKindOf: TTCFont) ifFalse: [^ self].
+
+ fontArray do: [:f |
+ f addLined.
+ ].
+ !