[squeak-dev] The Trunk: TrueType-nice.15.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Mar 28 17:10:49 UTC 2010


Nicolas Cellier uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-nice.15.mcz

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

Name: TrueType-nice.15
Author: nice
Time: 28 March 2010, 7:10:44.962 pm
UUID: 6a8e5e5b-bcf5-4e58-8edf-6f5fa1f9f3c5
Ancestors: TrueType-nice.14

Authorize parsing of TTCF file version 2.
That certainly is not sufficient, but at least, that allows  (TTFileDescription installFamilyNamed: 'Arial') to work on Mac Snow Leopard.

=============== Diff against TrueType-nice.14 ===============

Item was changed:
  ----- Method: TTFileDescription class>>allFamilyNamesAndFiles (in category 'font paths') -----
  allFamilyNamesAndFiles
  	"Answer a dictionary of all known family names and their corresponding file names."
  	
  	AllFontsAndFiles ifNil:[
  		AllFontsAndFiles := Dictionary new.
+ 		Cursor wait showWhile:[self allFontsDo:[:font|
+ 			| names |
- 		Cursor wait showWhile:[self allFontsDo:[:font| | names |
  			names := AllFontsAndFiles at: font familyName 
  					ifAbsentPut:[OrderedCollection new].
  			names add: font fileName]]].
  	^AllFontsAndFiles !

Item was changed:
  ----- Method: TTFileDescription class>>allFontsAndFiles (in category 'font paths') -----
  allFontsAndFiles
  	"Answer a dictionary of all known family names and their corresponding file names."
  	
  	AllFontsAndFiles ifNil:[
  		AllFontsAndFiles := Dictionary new.
+ 		Cursor wait showWhile:[self allFontsDo:[:font|
+ 			| names |
- 		Cursor wait showWhile:[self allFontsDo:[:font| | names |
  			names := AllFontsAndFiles at: font familyName 
  					ifAbsentPut:[OrderedCollection new].
  			names add: font fileName]]].
  	^AllFontsAndFiles !

Item was changed:
  ----- Method: TTFileDescription class>>fontOffsetsInFile: (in category 'instance creation') -----
  fontOffsetsInFile: file
  	"Answer a collection of font offsets in the given file"
  	| tag version nFonts |
  	file position: 0.
  	tag := file next: 4.
+ 	tag caseOf: {
- 	tag caseOf:{
  		['true' asByteArray] -> ["Version 1.0 TTF file"
  			"http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html
  			The values 'true' (0x74727565) and 0x00010000 are recognized by the Mac OS 
  			as referring to TrueType fonts."
  			^Array with: 0 "only one font"
  		].
  		[#[0 1 0 0]] -> ["Version 1.0 TTF file"
  			^Array with: 0 "only one font"
  		].
  		['ttcf' asByteArray]	-> ["TTC file"
  			version := file next: 4.
+ 			(version = #[0 1 0 0] or: [version = #[0 2 0 0]]) ifFalse: [^self error: 'Unsupported TTC version'].
- 			version = #(0 1 0 0) asByteArray ifFalse:[^self error: 'Unsupported TTC version'].
  			nFonts := file nextNumber: 4.
+ 			^(1 to: nFonts) collect: [:i | file nextNumber: 4].
- 			^(1 to: nFonts) collect:[:i| file nextNumber: 4].
  		].
  	} otherwise:[
  		self error: 'This is not a valid Truetype file'.
  	].!




More information about the Squeak-dev mailing list