Squeak Class Documentation category index | class index  
 
TTFontReader
  category: Balloon-TrueType Support
  superclass: Object
  subclasses:

No comment. Sorry.

instance methods
  private
  decodeCmapFmtTable:
getGlyphFlagsFrom:size:
getTableDirEntry:from:
readGlyphXCoords:glyph:nContours:flags:endPoints:
readGlyphYCoords:glyph:nContours:flags:endPoints:
warn:
winToMac:

  processing
  processCharMap:
processCharacterMappingTable:
processCompositeGlyph:contours:from:
processFontHeaderTable:
processGlyphDataTable:offsets:
processHorizontalHeaderTable:
processHorizontalMetricsTable:length:
processIndexToLocationTable:format:
processKerningTable:
processMaximumProfileTable:
processNamingTable:
processSimpleGlyph:contours:from:

  public
  readFrom:

class methods
  class initialization
 

  instance creation
  installTTF:asTextStyle:sizes:
parseFileNamed:
readFrom:

instance methods
  private top  
 

decodeCmapFmtTable:


 

getGlyphFlagsFrom:size:

Read in the flags for this glyph. The outer loop gathers the flags that
are actually contained in the table. If the repeat bit is set in a flag
then the next byte is read from the table; this is the number of times
to repeat the last flag. The inner loop does this, incrementing the
outer loops index each time.


 

getTableDirEntry:from:

Find the table named tagString in fontData and return a table directory entry for it.


 

readGlyphXCoords:glyph:nContours:flags:endPoints:

Read the x coordinates for the given glyph from the font file.


 

readGlyphYCoords:glyph:nContours:flags:endPoints:

Read the y coordinates for the given glyph from the font file.


 

warn:


 

winToMac:


  processing top  
 

processCharMap:

Process the given character map


 

processCharacterMappingTable:

Read the font's character to glyph index mapping table.
If an appropriate mapping can be found then return an association
with the format identifier and the contents of the table


 

processCompositeGlyph:contours:from:

Read a composite glyph from the font data. The glyph passed into this method contains some state variables that must be copied into the resulting composite glyph.


 

processFontHeaderTable:

Value Data Type Description
unitsPerEm USHORT Granularity of the font's em square.
xMax USHORT Maximum X-coordinate for the entire font.
xMin USHORT Minimum X-coordinate for the entire font.
yMax USHORT Maximum Y-coordinate for the entire font.
yMin USHORT Minimum Y-coordinate for the entire font.
indexToLocFormat SHORT Used when processing the Index To Loc Table.


 

processGlyphDataTable:offsets:

Read the actual glyph data from the font.
offsetArray contains the start offsets in the data for each glyph.


 

processHorizontalHeaderTable:


ascender SHORT Typographic ascent.
descender SHORT Typographic descent.
lineGap SHORT Typographic lineGap.
numberOfHMetrics USHORT Number hMetric entries in the HTMX
Table; may be smaller than the total
number of glyphs.


 

processHorizontalMetricsTable:length:

Extract the advance width, left side bearing, and right
side bearing for each glyph from the Horizontal Metrics Table.


 

processIndexToLocationTable:format:

glyphOffset ULONG[numGlyphs] An array that contains each glyph's
offset into the Glyph Data Table.


 

processKerningTable:

Extract the kerning information for pairs of glyphs.


 

processMaximumProfileTable:


numGlyphs USHORT The number of glyphs in the font.


 

processNamingTable:

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.


 

processSimpleGlyph:contours:from:


  public top  
 

readFrom:

Read the raw font byte data


class methods
  class initialization top  

  instance creation top  
 

installTTF:asTextStyle:sizes:

TTFontReader
installTTF: 'F:\fonts\amazon__.TTF'
asTextStyle: #Amazon
sizes: #(24 60)


 

parseFileNamed:

TTFontReader parseFileNamed:'c:\windows\arial.ttf'


 

readFrom:

Create an object based on the contents of aStream.