[Pkg] The Trunk: TrueType-topa.31.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 6 23:40:15 UTC 2015


Tobias Pape uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-topa.31.mcz

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

Name: TrueType-topa.31
Author: topa
Time: 7 March 2015, 12:39:53.513 am
UUID: 74ce9267-5c56-4766-b6c9-0ed574424565
Ancestors: TrueType-topa.30

In Fonts with multilingual names, prefer English

=============== Diff against TrueType-topa.30 ===============

Item was changed:
  ----- Method: TTFileDescription>>processNamingTable: (in category 'ttf tables') -----
  processNamingTable: fontFile
  "copyright         CHARPTR     The font's copyright notice.
  familyName        CHARPTR     The font's family name.
  subfamilyName     CHARPTR     The font's subfamily name.
  uniqueName        CHARPTR     A unique identifier for this font.
  fullName          CHARPTR     The font's full name (a combination of
                                            familyName and subfamilyName).
  versionName       CHARPTR     The font's version string.
  "
+ 	| nRecords initialOffset storageOffset  |
- 	| nRecords initialOffset storageOffset pID sID nID length offset string |
  	initialOffset := fontFile position.
  	fontFile skip: 2. "Skip format selector"
  	"Get the number of name records"
  	nRecords := fontFile nextNumber: 2.
  	"Offset from the beginning of this table"
  	storageOffset := (fontFile nextNumber: 2) + initialOffset.
+ 	1 to: nRecords do:[:i| |  pID sID lID nID length offset string |
- 	1 to: nRecords do:[:i|
  		fontFile position: initialOffset + 6 + ((i-1) * 12).
  		pID := fontFile nextNumber: 2.
  		sID := fontFile nextNumber: 2.
+ 		lID := fontFile nextNumber: 2.
- 		"lID := "fontFile nextNumber: 2.
  		nID := fontFile nextNumber: 2.
  		length := fontFile nextNumber: 2.
  		offset := fontFile nextNumber: 2.
  		"Read only Macintosh or Microsoft strings"
  		(pID = 1 or:[pID = 3 and:[sID = 1]]) ifTrue:[
  			"MS uses Unicode all others single byte"
  			"multiBytes := pID = 3."
  			fontFile position: storageOffset+offset.
  			string := (fontFile next: length) asString.
  			pID = 3 ifTrue:[ | keep |
  				keep := true.
  				string := string select:[:ch| keep := keep not].
  			].
  			nID caseOf: {
+ 				"Select only English names, prefer Macintosh"
  				"[0] -> [copyright := string]."
+ 				[1] -> [(lID = 0 and: [pID = 1 or:[familyName == nil]]) ifTrue:[familyName := string]].
+ 				[2] -> [(lID = 0 and: [pID = 1 or:[subfamilyName == nil]]) ifTrue:[subfamilyName := string]].
+ 				"[3] -> [(lID = 0 and: [pID = 1 or:[uniqueName == nil]]) ifTrue:[uniqueName := string]]."
+ 				"[4] -> [(lID = 0 and: [pID = 1 or:[fullName == nil]]) ifTrue:[fullName := string]]."
+ 				"[5] -> [(lID = 0 and: [pID = 1 or:[versionName == nil]]) ifTrue:[versionName := string]]."
+ 				"[6] -> [(lID = 0 and: [pID = 1 or:[postscriptName == ni]l]) ifTrue:[postscriptName := string]]."
+ 				"[7] -> [lpID = 0 and: [pID = 1 or:[trademark == nil]]) ifTrue:[trademark := string]]."
- 				[1] -> [(pID = 1 or:[familyName == nil]) ifTrue:[familyName := string]].
- 				[2] -> [(pID = 1 or:[subfamilyName == nil]) ifTrue:[subfamilyName := string]].
- 				"[3] -> [(pID = 1 or:[uniqueName == nil]) ifTrue:[uniqueName := string]]."
- 				"[4] -> [(pID = 1 or:[fullName == nil]) ifTrue:[fullName := string]]."
- 				"[5] -> [(pID = 1 or:[versionName == nil]) ifTrue:[versionName := string]]."
- 				"[6] -> [(pID = 1 or:[postscriptName == nil]) ifTrue:[postscriptName := string]]."
- 				"[7] -> [(pID = 1 or:[trademark == nil]) ifTrue:[trademark := string]]."
  			} otherwise:["ignore"].
  		].
  	].
  !

Item was changed:
  ----- Method: TTFontReader>>processNamingTable: (in category 'processing') -----
  processNamingTable: entry
  "copyright         CHARPTR     The font's copyright notice.
  familyName        CHARPTR     The font's family name.
  subfamilyName     CHARPTR     The font's subfamily name.
  uniqueName        CHARPTR     A unique identifier for this font.
  fullName          CHARPTR     The font's full name (a combination of
                                            familyName and subfamilyName).
  versionName       CHARPTR     The font's version string.
+ "	| nRecords initialOffset storageOffset  strings |
- "	| nRecords initialOffset storageOffset pID sID lID nID length offset multiBytes string strings |
  	strings := Array new: 8.
  	strings atAllPut:''.
  	initialOffset := entry offset.
  	entry skip: 2. "Skip format selector"
  	"Get the number of name records"
  	nRecords := entry nextUShort.
  	"Offset from the beginning of this table"
  	storageOffset := entry nextUShort + initialOffset.
+ 	1 to: nRecords do:[:i| | pID sID lID nID length offset multiBytes string |
- 	1 to: nRecords do:[:i|
  		pID := entry nextUShort.
  		sID := entry nextUShort.
  		lID := entry nextUShort.
  		nID := entry nextUShort.
  		length := entry nextUShort.
  		offset := entry nextUShort.
  		"Read only Macintosh or Microsoft strings"
  		(pID = 1 or:[pID = 3 and:[sID = 1]]) ifTrue:[
  			"MS uses Unicode all others single byte"
  			multiBytes := pID = 3.
  			string := entry stringAt: storageOffset + offset length: length multiByte: multiBytes.
  			"Put the name at the right location.
+ 			Note: We prefer Macintosh strings about everything else and use only English names."
- 			Note: We prefer Macintosh strings about everything else."
  			nID < strings size ifTrue:[
+ 				(lID = 0 and: [pID = 1 or:[(strings at: nID+1) = '']])
- 				(pID = 1 or:[(strings at: nID+1) = ''])
  					ifTrue:[strings at: nID+1 put: string].
  			].
  		].
  	].
  	fontDescription setStrings: strings.!



More information about the Packages mailing list