Package | org.purepdf.pdf.fonts |
Class | public class TrueTypeFont |
Inheritance | TrueTypeFont BaseFont it.sephiroth.utils.ObjectHash |
Subclasses | TrueTypeFontUnicode |
Property | Defined By | ||
---|---|---|---|
allNameEntries : Vector.<Vector.<String>> | TrueTypeFont | ||
bboxes : Vector.<Vector.<int>> | TrueTypeFont | ||
_builtinFonts14 : HashMap [static] | BaseFont | ||
cff : Boolean = false | TrueTypeFont | ||
cffLength : int = 0 | TrueTypeFont | ||
cffOffset : int = 0 | TrueTypeFont | ||
charBBoxes : Vector.<Vector.<int>> | BaseFont | ||
cmap10 : HashMap | TrueTypeFont | ||
cmap31 : HashMap | TrueTypeFont | ||
cmapExt : HashMap | TrueTypeFont | ||
_compressionLevel : int | BaseFont | ||
differences : Vector.<String> | BaseFont | ||
directoryOffset : int = 0 | TrueTypeFont | ||
directTextToByte : Boolean = false | BaseFont | ||
embedded : Boolean | BaseFont | ||
_encoding : String | BaseFont | ||
familyName : Vector.<Vector.<String>> | TrueTypeFont | ||
fastWinansi : Boolean = false | BaseFont | ||
fileName : String | TrueTypeFont | ||
fontCache : HashMap [static] | BaseFont | ||
fontName : String | TrueTypeFont | ||
_fontSpecific : Boolean = true | BaseFont | ||
_fontType : int | BaseFont | ||
forceWidthsOutput : Boolean = false | BaseFont | ||
fullName : Vector.<Vector.<String>> | TrueTypeFont | ||
GlyphWidths : Vector.<int> | TrueTypeFont | ||
head : FontHeader | TrueTypeFont | ||
hhea : HorizontalHeader | TrueTypeFont | ||
isFixedPitch : Boolean = false | TrueTypeFont | ||
italicAngle : Number = 0 | TrueTypeFont | ||
justNames : Boolean = false | TrueTypeFont | ||
kerning : Dictionary | TrueTypeFont | ||
kerning_size : int = 0 | TrueTypeFont | ||
os_2 : WindowsMetrics | TrueTypeFont | ||
rf : ByteArray | TrueTypeFont | ||
specialMap : Object | BaseFont | ||
style : String | TrueTypeFont | ||
_subset : Boolean = true | BaseFont | ||
subsetRanges : Vector.<Vector.<int>> | BaseFont | ||
tables : HashMap | TrueTypeFont | ||
ttcIndex : String | TrueTypeFont | ||
underlinePosition : int = 0 | TrueTypeFont | ||
underlineThickness : int = 0 | TrueTypeFont | ||
unicodeDifferences : Vector.<int> | BaseFont | ||
widths : Vector.<int> | BaseFont |
Method | Defined By | ||
---|---|---|---|
TrueTypeFont | |||
addSubsetTange(range:Vector.<int>):void | BaseFont | ||
charExists(c:int):Boolean | BaseFont | ||
convertToByte(char1:int):Bytes
Converts a char to a Bytes according to the font's encoding. | BaseFont | ||
convertToBytes(char1:String):Bytes
Converts a char to a Bytes according to the font's encoding. | BaseFont | ||
createFont(name:String, encoding:String, embedded:Boolean, cached:Boolean, ttfAfm:Vector.<int> = null, pfb:Vector.<int> = null, noThrow:Boolean = false, forceRead:Boolean = false):BaseFont [static]
Creates a new font. | BaseFont | ||
createSubsetPrefix():String [static] Creates a unique subset prefix to be added to the font name when the font is embedded and subset. | BaseFont | ||
getCharBBox(c:int):Vector.<int> | BaseFont | ||
getFamilyFontName():Vector.<Vector.<String>> [override] | TrueTypeFont | ||
getFontDescriptor(key:int, fontSize:Number):Number [override] Gets the font parameter identified by key. | TrueTypeFont | ||
BaseFont | |||
getKerning(char1:int, char2:int):int
Gets the kerning between two Unicode chars
| BaseFont | ||
getMetricsTT(c:int):Vector.<int>
Gets the glyph index and metrics for a character. | TrueTypeFont | ||
getPostscriptFontName():String | BaseFont | ||
getUnicodeDifferences(index:int):int | BaseFont | ||
getUnicodeEquivalent(c:int):int | BaseFont | ||
getWidth(code:Object):int
Gets the width of a char in normalized 1000 units
Possible input parameters are: String,int
| BaseFont | ||
getWidthPoint(code:Object, fontSize:Number):Number
Gets the width of a char in points. | BaseFont | ||
getWidthPointKerned(text:String, fontSize:Number):Number
Gets the width of a string in points taking kerning
into account
| BaseFont | ||
hasKernPairs():Boolean [override] | TrueTypeFont | ||
init($ttFile:String, $enc:String, $emb:Boolean, $ttfAfm:Vector.<int>, $justNames:Boolean, $forceRead:Boolean):void Creates a new TrueType font. | TrueTypeFont | ||
setKerning(char1:int, char2:int, kern:int):Boolean [override] | TrueTypeFont | ||
[override] | TrueTypeFont |
Method | Defined By | ||
---|---|---|---|
_getWidthI(code:int):int | BaseFont | ||
_getWidthS(text:String):int | BaseFont | ||
addRangeUni(longTag:HashMap, includeMetrics:Boolean, subsetp:Boolean):void | TrueTypeFont | ||
compactRanges(ranges:Vector.<Vector.<int>>):Vector.<int> [static] | TrueTypeFont | ||
createEncoding():void | BaseFont | ||
getBaseName(name:String):String [static]
Gets the fontname without the modifiers Bold, Italic or BoldItalic. | BaseFont | ||
getFontBaseType(fontDescriptor:PdfIndirectReference, subsetPrefix:String, firstChar:int, lastChar:int, shortTag:Vector.<int>):PdfDictionary
Generates the font dictionary for this font. | TrueTypeFont | ||
getFontDescriptorRef(fontStream:PdfIndirectReference, subsetPrefix:String, cidset:PdfIndirectReference):PdfDictionary
Generates the font descriptor for this font. | TrueTypeFont | ||
TrueTypeFont | |||
getGlyphWidth(glyph:int):int
Gets width of a glyph
| TrueTypeFont | ||
getRawCharBBox(c:int, name:String):Vector.<int> [override] | TrueTypeFont | ||
getRawWidth(c:int, name:String):int [override] | TrueTypeFont | ||
getTTCName(name:String):String [static]
Gets the name from a composed TTC file name. | TrueTypeFont | ||
normalizeEncoding(enc:String):String [static]
Normalize the encoding name
| BaseFont | ||
process(preload:Boolean):void
Read the font data
| TrueTypeFont | ||
TrueTypeFont | |||
readGlyphWidths():void
Reads the glyphs widths. | TrueTypeFont | ||
readStandardString(length:int):String
Reads a String from the font file as bytes using the Cp1252 encoding
| TrueTypeFont | ||
readUnicodeString(length:int):String | TrueTypeFont |
allNameEntries | property |
protected var allNameEntries:Vector.<Vector.<String>>
bboxes | property |
protected var bboxes:Vector.<Vector.<int>>
cff | property |
protected var cff:Boolean = false
cffLength | property |
protected var cffLength:int = 0
cffOffset | property |
protected var cffOffset:int = 0
cmap10 | property |
protected var cmap10:HashMap
cmap31 | property |
protected var cmap31:HashMap
cmapExt | property |
protected var cmapExt:HashMap
directoryOffset | property |
protected var directoryOffset:int = 0
familyName | property |
protected var familyName:Vector.<Vector.<String>>
fileName | property |
protected var fileName:String
fontName | property |
protected var fontName:String
fullName | property |
protected var fullName:Vector.<Vector.<String>>
GlyphWidths | property |
protected var GlyphWidths:Vector.<int>
head | property |
protected var head:FontHeader
hhea | property |
protected var hhea:HorizontalHeader
isFixedPitch | property |
protected var isFixedPitch:Boolean = false
italicAngle | property |
protected var italicAngle:Number = 0
justNames | property |
protected var justNames:Boolean = false
kerning | property |
protected var kerning:Dictionary
kerning_size | property |
protected var kerning_size:int = 0
os_2 | property |
protected var os_2:WindowsMetrics
rf | property |
protected var rf:ByteArray
style | property |
protected var style:String
tables | property |
protected var tables:HashMap
ttcIndex | property |
protected var ttcIndex:String
underlinePosition | property |
protected var underlinePosition:int = 0
underlineThickness | property |
protected var underlineThickness:int = 0
TrueTypeFont | () | Constructor |
public function TrueTypeFont()
addRangeUni | () | method |
protected function addRangeUni(longTag:HashMap, includeMetrics:Boolean, subsetp:Boolean):void
Parameters
longTag:HashMap | |
includeMetrics:Boolean | |
subsetp:Boolean |
compactRanges | () | method |
protected static function compactRanges(ranges:Vector.<Vector.<int>>):Vector.<int>
Parameters
ranges:Vector.<Vector.<int>> |
Vector.<int> |
getFamilyFontName | () | method |
override public function getFamilyFontName():Vector.<Vector.<String>>
ReturnsVector.<Vector.<String>> |
getFontBaseType | () | method |
protected function getFontBaseType(fontDescriptor:PdfIndirectReference, subsetPrefix:String, firstChar:int, lastChar:int, shortTag:Vector.<int>):PdfDictionary
Generates the font dictionary for this font.
Parameters
fontDescriptor:PdfIndirectReference | |
subsetPrefix:String | |
firstChar:int | |
lastChar:int | |
shortTag:Vector.<int> |
PdfDictionary — the PdfDictionary containing the font dictionary
|
getFontDescriptor | () | method |
override public function getFontDescriptor(key:int, fontSize:Number):Number
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
and ITALICANGLE
.
Parameters
key:int — the parameter to be extracted
| |
fontSize:Number — the font size in points
|
Number — the parameter in points
|
getFontDescriptorRef | () | method |
protected function getFontDescriptorRef(fontStream:PdfIndirectReference, subsetPrefix:String, cidset:PdfIndirectReference):PdfDictionary
Generates the font descriptor for this font.
Parameters
fontStream:PdfIndirectReference | |
subsetPrefix:String | |
cidset:PdfIndirectReference |
PdfDictionary |
getFullFont | () | method |
getGlyphWidth | () | method |
protected function getGlyphWidth(glyph:int):int
Gets width of a glyph
Parameters
glyph:int |
int |
getMetricsTT | () | method |
public function getMetricsTT(c:int):Vector.<int>
Gets the glyph index and metrics for a character.
Parameters
c:int |
Vector.<int> |
getRawCharBBox | () | method |
override protected function getRawCharBBox(c:int, name:String):Vector.<int>
Parameters
c:int | |
name:String |
Vector.<int> |
getRawWidth | () | method |
override protected function getRawWidth(c:int, name:String):int
Parameters
c:int | |
name:String |
int |
getTTCName | () | method |
protected static function getTTCName(name:String):String
Gets the name from a composed TTC file name.
Parameters
name:String |
String |
hasKernPairs | () | method |
override public function hasKernPairs():Boolean
ReturnsBoolean |
init | () | method |
public function init($ttFile:String, $enc:String, $emb:Boolean, $ttfAfm:Vector.<int>, $justNames:Boolean, $forceRead:Boolean):void
Creates a new TrueType font.
Parameters
$ttFile:String — the encoding to be applied to this font
| |
$enc:String — true if the font is to be embedded in the PDF
| |
$emb:Boolean | |
$ttfAfm:Vector.<int> | |
$justNames:Boolean | |
$forceRead:Boolean |
DocumentError
| |
IOError
|
process | () | method |
protected function process(preload:Boolean):void
Read the font data
Parameters
preload:Boolean |
DocumentError
| |
IOError
|
readCffFont | () | method |
readGlyphWidths | () | method |
protected function readGlyphWidths():void
Reads the glyphs widths. The widths are extracted from the table 'hmtx'. The glyphs are normalized to 1000 units.
DocumentError
| |
EOFError
|
readStandardString | () | method |
protected function readStandardString(length:int):String
Reads a String from the font file as bytes using the Cp1252 encoding
Parameters
length:int |
String |
IOError
|
readUnicodeString | () | method |
protected function readUnicodeString(length:int):String
Parameters
length:int |
String |
EOFError
|
setKerning | () | method |
override public function setKerning(char1:int, char2:int, kern:int):Boolean
Parameters
char1:int | |
char2:int | |
kern:int |
Boolean |
writeFont | () | method |
override public function writeFont(writer:PdfWriter, ref:PdfIndirectReference, params:Vector.<Object>):void
Parameters
writer:PdfWriter | |
ref:PdfIndirectReference | |
params:Vector.<Object> |