Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.186.mcz ==================== Summary ==================== Name: Multilingual-nice.186 Author: nice Time: 9 October 2013, 1:29:52.094 am UUID: d699f7f6-a017-4d13-90e6-08528dd86a82 Ancestors: Multilingual-tpr.185 Give some StrikeFont extensions back to *Multilingual =============== Diff against Multilingual-tpr.185 =============== Item was added: + ----- Method: StrikeFont class>>fixForISO8859From: (in category '*Multilingual-Display') ----- + fixForISO8859From: aStrikeFont + + ^aStrikeFont copy fixForISO8859From: aStrikeFont. + ! Item was added: + ----- Method: StrikeFont class>>newForJapaneseFromEFontBDFFile:name:overrideWith: (in category '*Multilingual-Display') ----- + newForJapaneseFromEFontBDFFile: fileName name: aString overrideWith: otherFileName + + | n | + n := self new. + n readEFontBDFForJapaneseFromFile: fileName name: aString overrideWith: otherFileName. + ^ n. + ! Item was added: + ----- Method: StrikeFont class>>newForKoreanFromEFontBDFFile:name:overrideWith: (in category '*Multilingual-Display') ----- + newForKoreanFromEFontBDFFile: fileName name: aString overrideWith: otherFileName + + | n | + n := self new. + n readEFontBDFForKoreanFromFile: fileName name: aString overrideWith: otherFileName. + ^ n. + ! Item was added: + ----- Method: StrikeFont class>>newFromEFontBDFFile:name:ranges: (in category '*Multilingual-Display') ----- + newFromEFontBDFFile: fileName name: aString ranges: ranges + + | n | + n := self new. + n readEFontBDFFromFile: fileName name: aString ranges: ranges. + ^ n. + ! Item was added: + ----- Method: StrikeFont class>>newFromEFontBDFFile:name:startRange:endRange: (in category '*Multilingual-Display') ----- + newFromEFontBDFFile: aFileName name: aString startRange: start endRange: end + + | n | + n := self new. + n readEFontBDFFromFile: aFileName name: aString rangeFrom: start to: end. + ^n. + + "TextConstants at: #Helvetica put: (TextStyle fontArray: {StrikeFont newFromBDFFile: 'helvR12.bdf' name: 'Helvetica12'})" + "TextConstants at: #Lucida put: (TextStyle fontArray: {StrikeFont newFromBDFFile: 'luRS12.bdf' name: 'Lucida'})" + "TextStyle default fontAt: 5 put: (StrikeFont new readFromStrike2: 'helv12.sf2')." + + ! Item was added: + ----- Method: StrikeFont class>>newFromF12File: (in category '*Multilingual-Display') ----- + newFromF12File: aFileName + "StrikeFont newFromF12File: 'kaname.f12'" + + | file n | + ('*.F12' match: aFileName) ifFalse: ["self halt. " "likely incompatible"]. + file := FileStream readOnlyFileNamed: aFileName. + file binary. + n := self new. + n name: (FileDirectory baseNameFor: (FileDirectory localNameFor: aFileName)). + n readF12FromStream: file. + ^ n. + ! Item was added: + ----- Method: StrikeFont>>fixForISO8859From: (in category '*Multilingual-Display') ----- + fixForISO8859From: aStrikeFont + + | fixer m mappingTable | + fixer := StrikeFontFixer newOn: aStrikeFont. + self reset. + xTable := aStrikeFont xTable copy. + glyphs := Form extent: aStrikeFont glyphs extent. + maxAscii := 255. + minAscii := 0. + mappingTable := fixer mappingTable. + "stopConditions := nil." + + 0 to: 255 do: [:i | + (m := mappingTable at: i+1) ~= nil ifTrue: [ + self characterFormAt: (Character value: i) + put: (aStrikeFont characterFormAt: (Character value: m)). + ] ifFalse: [ + self characterFormAt: (Character value: i) + put: (aStrikeFont characterFormAt: (Character space)). + ] + ]. + ^self. + ! Item was added: + ----- Method: StrikeFont>>readEFontBDFForJapaneseFromFile:name:overrideWith: (in category '*Multilingual-Display') ----- + readEFontBDFForJapaneseFromFile: fileName name: aString overrideWith: otherFileName + + | fontReader stream | + fontReader := EFontBDFFontReaderForRanges readOnlyFileNamed: fileName. + stream := ReadStream on: (fontReader readRanges: fontReader rangesForJapanese overrideWith: otherFileName otherRanges: {Array with: 8481 with: 12320} additionalOverrideRange: fontReader additionalRangesForJapanese). + xTable := stream next. + glyphs := stream next. + minAscii := stream next. + maxAscii := stream next. + maxWidth := stream next. + ascent := stream next. + descent := stream next. + pointSize := stream next. + name := aString. + type := 0. "no one see this" + superscript := ascent - descent // 3. + subscript := descent - ascent // 3. + emphasis := 0. + self reset. + ! Item was added: + ----- Method: StrikeFont>>readEFontBDFForKoreanFromFile:name:overrideWith: (in category '*Multilingual-Display') ----- + readEFontBDFForKoreanFromFile: fileName name: aString overrideWith: otherFileName + + | fontReader stream | + fontReader := EFontBDFFontReaderForRanges readOnlyFileNamed: fileName. + stream := ReadStream on: (fontReader readRanges: fontReader rangesForKorean overrideWith: otherFileName otherRanges: {Array with: 8481 with: 12320} additionalOverrideRange: fontReader additionalRangesForKorean). + xTable := stream next. + glyphs := stream next. + minAscii := stream next. + maxAscii := stream next. + maxWidth := stream next. + ascent := stream next. + descent := stream next. + pointSize := stream next. + name := aString. + type := 0. "no one see this" + superscript := ascent - descent // 3. + subscript := descent - ascent // 3. + emphasis := 0. + self reset. + ! Item was added: + ----- Method: StrikeFont>>readEFontBDFFromFile:name:rangeFrom:to: (in category '*Multilingual-Display') ----- + readEFontBDFFromFile: fileName name: aString rangeFrom: startRange to: endRange + + | fontReader stream | + fontReader := EFontBDFFontReader readOnlyFileNamed: fileName. + stream := ReadStream on: (fontReader readFrom: startRange to: endRange). + xTable := stream next. + glyphs := stream next. + minAscii := stream next. + maxAscii := stream next. + maxWidth := stream next. + ascent := stream next. + descent := stream next. + pointSize := stream next. + name := aString. + type := 0. "no one see this" + superscript := ascent - descent // 3. + subscript := descent - ascent // 3. + emphasis := 0. + self reset. + ! Item was added: + ----- Method: StrikeFont>>readEFontBDFFromFile:name:ranges: (in category '*Multilingual-Display') ----- + readEFontBDFFromFile: fileName name: aString ranges: ranges + + | fontReader stream | + fontReader := EFontBDFFontReaderForRanges readOnlyFileNamed: fileName. + stream := ReadStream on: (fontReader readRanges: ranges). + xTable := stream next. + glyphs := stream next. + minAscii := stream next. + maxAscii := stream next. + maxWidth := stream next. + ascent := stream next. + descent := stream next. + pointSize := stream next. + name := aString. + type := 0. "no one see this" + superscript := ascent - descent // 3. + subscript := descent - ascent // 3. + emphasis := 0. + self reset. + ! Item was added: + ----- Method: StrikeFont>>readF12FromStream: (in category '*Multilingual-Display') ----- + readF12FromStream: aStream + + | box blt | + minAscii := 0. + maxAscii := 94*94. + ascent := 12. + descent := 0. + pointSize := 12. + superscript := 0. + subscript := 0. + emphasis := 0. + maxWidth := 12. + + box := Form extent: 12@12. + glyphs := Form extent: (94*94*12)@12. + blt := BitBlt toForm: glyphs. + xTable := XTableForFixedFont new. + xTable maxAscii: maxAscii + 3. + xTable width: 12. + 1 to: 256 do: [:index | + 1 to: 12 do: [:i | + aStream next. + ]. + ]. + (minAscii + 1 to: 94*94) do: [:index | + self readCharacter: (box bits) from: aStream. + blt copy: ((12*(index-1))@0 extent: 12@12) from: 0@0 in: box. + ]. + ! |
Free forum by Nabble | Edit this page |