Packageorg.purepdf.pdf.fonts
Classpublic class TrueTypeFontSubSet
InheritanceTrueTypeFontSubSet Inheritance Object



Protected Properties
 PropertyDefined By
  directoryOffset : int
TrueTypeFontSubSet
  fileName : String
TrueTypeFontSubSet
  fontPtr : int
TrueTypeFontSubSet
  glyfTableRealSize : int
TrueTypeFontSubSet
  glyphsInList : Vector.<int>
TrueTypeFontSubSet
  glyphsUsed : HashMap
TrueTypeFontSubSet
  includeCmap : Boolean
TrueTypeFontSubSet
  includeExtras : Boolean
TrueTypeFontSubSet
  locaShortTable : Boolean
TrueTypeFontSubSet
  locaTable : Vector.<int>
TrueTypeFontSubSet
  locaTableRealSize : int
TrueTypeFontSubSet
  newGlyfTable : Bytes
TrueTypeFontSubSet
  newLocaTable : Vector.<int>
TrueTypeFontSubSet
  newLocaTableOut : Bytes
TrueTypeFontSubSet
  outFont : Bytes
TrueTypeFontSubSet
  rf : ByteArray
TrueTypeFontSubSet
  tableDirectory : HashMap
TrueTypeFontSubSet
  tableGlyphOffset : int
TrueTypeFontSubSet
Public Methods
 MethodDefined By
  
TrueTypeFontSubSet($fileName:String, $rf:ByteArray, $glyphsUsed:HashMap, $directoryOffset:int, $includeCmap:Boolean, $includeExtras:Boolean)
Creates a new TrueTypeFontSubSet
TrueTypeFontSubSet
  
Does the actual work of subsetting the font.
TrueTypeFontSubSet
Protected Methods
 MethodDefined By
  
TrueTypeFontSubSet
  
TrueTypeFontSubSet
  
checkGlyphComposite(glyph:int):void
TrueTypeFontSubSet
  
TrueTypeFontSubSet
  
TrueTypeFontSubSet
  
flatGlyphs():void
TrueTypeFontSubSet
  
TrueTypeFontSubSet
  
readLoca():void
TrueTypeFontSubSet
  
readStandardString(length:int):String
TrueTypeFontSubSet
  
writeFontInt(n:int):void
TrueTypeFontSubSet
  
writeFontShort(n:int):void
TrueTypeFontSubSet
  
writeFontString(s:String):void
TrueTypeFontSubSet
Public Constants
 ConstantDefined By
  ARG_1_AND_2_ARE_WORDS : int = 1
[static]
TrueTypeFontSubSet
  entrySelectors : Vector.<int>
[static]
TrueTypeFontSubSet
  HEAD_LOCA_FORMAT_OFFSET : int = 51
[static]
TrueTypeFontSubSet
  MORE_COMPONENTS : int = 32
[static]
TrueTypeFontSubSet
  TABLE_CHECKSUM : int = 0
[static]
TrueTypeFontSubSet
  TABLE_LENGTH : int = 2
[static]
TrueTypeFontSubSet
  tableNamesCmap : Vector.<String>
[static]
TrueTypeFontSubSet
  tableNamesExtra : Vector.<String>
[static]
TrueTypeFontSubSet
  tableNamesSimple : Vector.<String>
[static]
TrueTypeFontSubSet
  TABLE_OFFSET : int = 1
[static]
TrueTypeFontSubSet
  WE_HAVE_AN_X_AND_Y_SCALE : int = 64
[static]
TrueTypeFontSubSet
  WE_HAVE_A_SCALE : int = 8
[static]
TrueTypeFontSubSet
  WE_HAVE_A_TWO_BY_TWO : int = 128
[static]
TrueTypeFontSubSet
Property Detail
directoryOffsetproperty
protected var directoryOffset:int

fileNameproperty 
protected var fileName:String

fontPtrproperty 
protected var fontPtr:int

glyfTableRealSizeproperty 
protected var glyfTableRealSize:int

glyphsInListproperty 
protected var glyphsInList:Vector.<int>

glyphsUsedproperty 
protected var glyphsUsed:HashMap

includeCmapproperty 
protected var includeCmap:Boolean

includeExtrasproperty 
protected var includeExtras:Boolean

locaShortTableproperty 
protected var locaShortTable:Boolean

locaTableproperty 
protected var locaTable:Vector.<int>

locaTableRealSizeproperty 
protected var locaTableRealSize:int

newGlyfTableproperty 
protected var newGlyfTable:Bytes

newLocaTableproperty 
protected var newLocaTable:Vector.<int>

newLocaTableOutproperty 
protected var newLocaTableOut:Bytes

outFontproperty 
protected var outFont:Bytes

rfproperty 
protected var rf:ByteArray

tableDirectoryproperty 
protected var tableDirectory:HashMap

tableGlyphOffsetproperty 
protected var tableGlyphOffset:int

Constructor Detail
TrueTypeFontSubSet()Constructor
public function TrueTypeFontSubSet($fileName:String, $rf:ByteArray, $glyphsUsed:HashMap, $directoryOffset:int, $includeCmap:Boolean, $includeExtras:Boolean)

Creates a new TrueTypeFontSubSet

Parameters
$fileName:String
 
$rf:ByteArray
 
$glyphsUsed:HashMap
 
$directoryOffset:int
 
$includeCmap:Boolean
 
$includeExtras:Boolean
Method Detail
assembleFont()method
protected function assembleFont():void


Throws
EOFError
calculateChecksum()method 
protected function calculateChecksum(b:Bytes):int

Parameters

b:Bytes

Returns
int
checkGlyphComposite()method 
protected function checkGlyphComposite(glyph:int):void

Parameters

glyph:int


Throws
EOFError
createNewGlyphTables()method 
protected function createNewGlyphTables():void


Throws
EOFError
createTableDirectory()method 
protected function createTableDirectory():void


Throws
DocumentError
 
EOFError
flatGlyphs()method 
protected function flatGlyphs():void


Throws
DocumentError
 
EOFError
locaTobytes()method 
protected function locaTobytes():void

process()method 
public function process():Bytes

Does the actual work of subsetting the font.

Returns
Bytes — the subset font

Throws
IOException — on error
 
DocumentException — on error
readLoca()method 
protected function readLoca():void


Throws
DocumentError
 
EOFError
readStandardString()method 
protected function readStandardString(length:int):String

Parameters

length:int

Returns
String
writeFontInt()method 
protected function writeFontInt(n:int):void

Parameters

n:int

writeFontShort()method 
protected function writeFontShort(n:int):void

Parameters

n:int

writeFontString()method 
protected function writeFontString(s:String):void

Parameters

s:String

Constant Detail
ARG_1_AND_2_ARE_WORDSConstant
public static const ARG_1_AND_2_ARE_WORDS:int = 1

entrySelectorsConstant 
public static const entrySelectors:Vector.<int>

HEAD_LOCA_FORMAT_OFFSETConstant 
public static const HEAD_LOCA_FORMAT_OFFSET:int = 51

MORE_COMPONENTSConstant 
public static const MORE_COMPONENTS:int = 32

TABLE_CHECKSUMConstant 
public static const TABLE_CHECKSUM:int = 0

TABLE_LENGTHConstant 
public static const TABLE_LENGTH:int = 2

TABLE_OFFSETConstant 
public static const TABLE_OFFSET:int = 1

tableNamesCmapConstant 
public static const tableNamesCmap:Vector.<String>

tableNamesExtraConstant 
public static const tableNamesExtra:Vector.<String>

tableNamesSimpleConstant 
public static const tableNamesSimple:Vector.<String>

WE_HAVE_A_SCALEConstant 
public static const WE_HAVE_A_SCALE:int = 8

WE_HAVE_A_TWO_BY_TWOConstant 
public static const WE_HAVE_A_TWO_BY_TWO:int = 128

WE_HAVE_AN_X_AND_Y_SCALEConstant 
public static const WE_HAVE_AN_X_AND_Y_SCALE:int = 64