The Trunk: TrueType-topa.30.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-topa.30.mcz

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

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

Name: TrueType-topa.30
Author: topa
Time: 6 March 2015, 10:52:16.177 pm
UUID: cf2b3756-eef6-488c-9072-3b357b939970
Ancestors: TrueType-bf.29

Cope for some ttc fonts actually being PostScript-Based opentype fonts our TTF code cannot deal with.

Also: Include system fonts on OS X

=============== Diff against TrueType-bf.29 ===============

Item was changed:
  ----- Method: TTFileDescription class>>fontPathsDo: (in category 'font paths') -----
  fontPathsDo: aBlock
  "Evaluate aBlock with all of the font paths that should be searched on the current platform"
 
  "Start with the current directory"
  aBlock value: FileDirectory default pathName.
 
  "Then subdirectory 'fonts'"
  aBlock value: (FileDirectory default directoryNamed: 'fonts') pathName.
 
  "Platform specific directories"
  Smalltalk platformName caseOf:{
  ['Win32'] -> [
  "Standard Windows fonts directory"
  aBlock value: 'C:\Windows\Fonts'.
  ].
  ['Mac OS'] -> [
+ "Standard system fonts directories"
+ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir |
+ aBlock value: fontDir].
- "Standard system fonts directory"
- aBlock value: '/Library/Fonts'.
  ].
  ['unix'] -> [ | base |
  "Standard fonts are in /usr/share/fonts/*"
  base := '/usr/share/fonts'.
  (FileDirectory on: base) directoryNames
  do:[:dn| aBlock value: base, '/', dn].
  ].
  } otherwise:[].
  !

Item was changed:
  ----- Method: TTFileDescription>>on:offset: (in category 'initialize') -----
  on: aFileName offset: fontOffset
  "Initialize the receiver from a file name"
  fileName := aFileName.
  fileOffset := fontOffset.
  self withFileDo:[:fontFile|
+ "Some TTC fonts may actually be collection of PostScript-Based OpenType fonts"
+ (self findTable: 'CFF ' in: fontFile)
+ ifTrue: [^ nil]
+ ifFalse: [fontFile position: fileOffset "reset"].
  "Some bitmap fonts are called .ttf; skip anything that doesn't have a header"
  (self findTable: 'head' in: fontFile) ifFalse:[^nil].
  self processFontHeaderTable: fontFile.
  (self findTable: 'maxp' in: fontFile)
  ifFalse:[^self error: 'File does not have a profile table'].
  self processMaximumProfileTable: fontFile.
  (self findTable: 'name' in: fontFile)
  ifFalse:[^self error: 'File does not have a naming table'].
  self processNamingTable: fontFile.
  (self findTable: 'hhea' in: fontFile)
  ifFalse:[^self error: 'File does not have a horizontal header table'].
  self processHorizontalHeaderTable: fontFile.
  (self findTable: 'OS/2' in: fontFile)
  ifTrue:[self processOS2Table: fontFile].
  (self findTable: 'hmtx' in: fontFile)
  ifFalse:[^self error: 'File does not have a horizontal header table'].
  hmtxTableOffset := fontFile position.
  (self findTable: 'loca' in: fontFile)
  ifFalse:[^self error: 'File does not have a naming table'].
  indexToLocOffset := fontFile position.
  (self findTable: 'glyf' in: fontFile)
  ifFalse:[^self error: 'File does not have a naming table'].
  glyphTableOffset := fontFile position.
  (self findTable: 'cmap' in: fontFile)
  ifFalse:[^self error: 'File does not have a header table'].
  self processCharacterMappingTable: fontFile.
  ].!