Package | org.purepdf.pdf.fonts |
Class | public class BaseFont |
Inheritance | BaseFont it.sephiroth.utils.ObjectHash |
Subclasses | CJKFont, DocumentFont, TrueTypeFont, Type1Font |
Property | Defined By | ||
---|---|---|---|
builtinFonts14 : HashMap [static] [read-only] | BaseFont | ||
compressionLevel : int | BaseFont | ||
encoding : String [read-only] | BaseFont | ||
fontSpecific : Boolean | BaseFont | ||
fontType : int [read-only] | BaseFont | ||
subset : Boolean | BaseFont |
Property | Defined By | ||
---|---|---|---|
_builtinFonts14 : HashMap [static] | BaseFont | ||
charBBoxes : Vector.<Vector.<int>> | BaseFont | ||
_compressionLevel : int | BaseFont | ||
differences : Vector.<String> | BaseFont | ||
directTextToByte : Boolean = false | BaseFont | ||
embedded : Boolean | BaseFont | ||
_encoding : String | BaseFont | ||
fastWinansi : Boolean = false | BaseFont | ||
fontCache : HashMap [static] | BaseFont | ||
_fontSpecific : Boolean = true | BaseFont | ||
_fontType : int | BaseFont | ||
forceWidthsOutput : Boolean = false | BaseFont | ||
specialMap : Object | BaseFont | ||
_subset : Boolean = true | BaseFont | ||
subsetRanges : Vector.<Vector.<int>> | BaseFont | ||
unicodeDifferences : Vector.<int> | BaseFont | ||
widths : Vector.<int> | BaseFont |
Method | Defined By | ||
---|---|---|---|
BaseFont() | BaseFont | ||
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>> | BaseFont | ||
getFontDescriptor(key:int, fontSize:Number):Number | BaseFont | ||
BaseFont | |||
getKerning(char1:int, char2:int):int
Gets the kerning between two Unicode chars
| BaseFont | ||
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
Checks if the font has any kerning pairs
| BaseFont | ||
setKerning(char1:int, char2:int, kern:int):Boolean | BaseFont | ||
BaseFont |
Method | Defined By | ||
---|---|---|---|
_getWidthI(code:int):int | BaseFont | ||
_getWidthS(text:String):int | BaseFont | ||
createEncoding():void | BaseFont | ||
getBaseName(name:String):String [static]
Gets the fontname without the modifiers Bold, Italic or BoldItalic. | BaseFont | ||
getRawCharBBox(c:int, name:String):Vector.<int> | BaseFont | ||
getRawWidth(c:int, name:String):int
Gets the width from the font according to the Unicode char c
or the name
| BaseFont | ||
normalizeEncoding(enc:String):String [static]
Normalize the encoding name
| BaseFont |
Constant | Defined By | ||
---|---|---|---|
AdobeCNS1_UCS2 : String = Adobe-CNS1-UCS2 [static] | BaseFont | ||
AdobeGB1_UCS2 : String = Adobe-GB1-UCS2 [static] | BaseFont | ||
AdobeJapan1_UCS2 : String = Adobe-Japan1-UCS2 [static] | BaseFont | ||
AdobeKorea1_UCS2 : String = Adobe-Korea1-UCS2 [static] | BaseFont | ||
ASCENT : int = 1 [static] | BaseFont | ||
AWT_ASCENT : int = 9 [static] | BaseFont | ||
AWT_DESCENT : int = 10 [static] | BaseFont | ||
AWT_LEADING : int = 11 [static] | BaseFont | ||
AWT_MAXADVANCE : int = 12 [static] | BaseFont | ||
BBOXLLX : int = 5 [static] | BaseFont | ||
BBOXLLY : int = 6 [static] | BaseFont | ||
BBOXURX : int = 7 [static] | BaseFont | ||
BBOXURY : int = 8 [static] | BaseFont | ||
CACHED : Boolean = true [static] | BaseFont | ||
CAPHEIGHT : int = 2 [static] | BaseFont | ||
CHAR_RANGE_ARABIC : Vector.<int> [static] | BaseFont | ||
CHAR_RANGE_CYRILLIC : Vector.<int> [static] | BaseFont | ||
CHAR_RANGE_HEBREW : Vector.<int> [static] | BaseFont | ||
CHAR_RANGE_LATIN : Vector.<int> [static] | BaseFont | ||
CID_NEWLINE : String = U7fff [static] | BaseFont | ||
COURIER : String = Courier.afm [static] | BaseFont | ||
COURIER_BOLD : String = Courier-Bold.afm [static] | BaseFont | ||
COURIER_BOLDOBLIQUE : String = Courier-BoldOblique.afm [static] | BaseFont | ||
COURIER_OBLIQUE : String = Courier-Oblique.afm [static] | BaseFont | ||
CP1250 : String = Cp1250 [static] | BaseFont | ||
CP1252 : String = Cp1252 [static] | BaseFont | ||
CP1257 : String = Cp1257 [static] | BaseFont | ||
DESCENT : int = 3 [static] | BaseFont | ||
EMBEDDED : Boolean = true [static] | BaseFont | ||
FONT_TYPE_CJK : int = 2 [static] | BaseFont | ||
FONT_TYPE_DOCUMENT : int = 4 [static] | BaseFont | ||
FONT_TYPE_T1 : int = 0 [static] | BaseFont | ||
FONT_TYPE_T3 : int = 5 [static] | BaseFont | ||
FONT_TYPE_TT : int = 1 [static] | BaseFont | ||
FONT_TYPE_TTUNI : int = 3 [static] | BaseFont | ||
HELVETICA : String = Helvetica.afm [static] | BaseFont | ||
HELVETICA_BOLD : String = Helvetica-Bold.afm [static] | BaseFont | ||
HELVETICA_BOLDOBLIQUE : String = Helvetica-BoldOblique.afm [static] | BaseFont | ||
HELVETICA_OBLIQUE : String = Helvetica-Oblique.afm [static] | BaseFont | ||
IDENTITY_H : String = Identity-H [static] | BaseFont | ||
IDENTITY_V : String = Identity-V [static] | BaseFont | ||
ITALICANGLE : int = 4 [static] | BaseFont | ||
MACROMAN : String = MacRoman [static] | BaseFont | ||
NOT_CACHED : Boolean = false [static] | BaseFont | ||
notdef : String = .notdef [static] | BaseFont | ||
NOT_EMBEDDED : Boolean = false [static] | BaseFont | ||
RESOURCE_PATH : String = fonts/ [static] | BaseFont | ||
STRIKETHROUGH_POSITION : int = 15 [static] | BaseFont | ||
STRIKETHROUGH_THICKNESS : int = 16 [static] | BaseFont | ||
SUBSCRIPT_OFFSET : int = 18 [static] | BaseFont | ||
SUBSCRIPT_SIZE : int = 17 [static] | BaseFont | ||
SUPERSCRIPT_OFFSET : int = 20 [static] | BaseFont | ||
SUPERSCRIPT_SIZE : int = 19 [static] | BaseFont | ||
SYMBOL : String = Symbol.afm [static] | BaseFont | ||
TIMES_BOLD : String = Times-Bold.afm [static] | BaseFont | ||
TIMES_BOLDITALIC : String = Times-BoldItalic.afm [static] | BaseFont | ||
TIMES_ITALIC : String = Times-Italic.afm [static] | BaseFont | ||
TIMES_ROMAN : String = Times-Roman.afm [static] | BaseFont | ||
UNDERLINE_POSITION : int = 13 [static] | BaseFont | ||
UNDERLINE_THICKNESS : int = 14 [static] | BaseFont | ||
UniCNS_UCS2_H : String = UniCNS-UCS2-H [static] | BaseFont | ||
UniCNS_UCS2_V : String = UniCNS-UCS2-V [static] | BaseFont | ||
UniGB_UCS2_H : String = UniGB-UCS2-H [static] | BaseFont | ||
UniGB_UCS2_V : String = UniGB-UCS2-V [static] | BaseFont | ||
UniJIS_UCS2_H : String = UniJIS-UCS2-H [static] | BaseFont | ||
UniJIS_UCS2_HW_H : String = UniJIS-UCS2-HW-H [static] | BaseFont | ||
UniJIS_UCS2_HW_V : String = UniJIS-UCS2-HW-V [static] | BaseFont | ||
UniJIS_UCS2_V : String = UniJIS-UCS2-V [static] | BaseFont | ||
UniKS_UCS2_H : String = UniKS-UCS2-H [static] | BaseFont | ||
UniKS_UCS2_V : String = UniKS-UCS2-V [static] | BaseFont | ||
WINANSI : String = Cp1252 [static] | BaseFont | ||
ZAPFDINGBATS : String = ZapfDingbats.afm [static] | BaseFont |
_builtinFonts14 | property |
protected static var _builtinFonts14:HashMap
_compressionLevel | property |
protected var _compressionLevel:int
_encoding | property |
protected var _encoding:String
_fontSpecific | property |
protected var _fontSpecific:Boolean = true
_fontType | property |
protected var _fontType:int
_subset | property |
protected var _subset:Boolean = true
builtinFonts14 | property |
builtinFonts14:HashMap
[read-only] public static function get builtinFonts14():HashMap
charBBoxes | property |
protected var charBBoxes:Vector.<Vector.<int>>
compressionLevel | property |
compressionLevel:int
public function get compressionLevel():int
public function set compressionLevel(value:int):void
differences | property |
protected var differences:Vector.<String>
directTextToByte | property |
protected var directTextToByte:Boolean = false
embedded | property |
protected var embedded:Boolean
encoding | property |
encoding:String
[read-only] public function get encoding():String
fastWinansi | property |
protected var fastWinansi:Boolean = false
fontCache | property |
protected static var fontCache:HashMap
fontSpecific | property |
fontSpecific:Boolean
public function get fontSpecific():Boolean
public function set fontSpecific(value:Boolean):void
fontType | property |
fontType:int
[read-only] public function get fontType():int
forceWidthsOutput | property |
protected var forceWidthsOutput:Boolean = false
specialMap | property |
protected var specialMap:Object
subset | property |
subset:Boolean
public function get subset():Boolean
public function set subset(value:Boolean):void
subsetRanges | property |
protected var subsetRanges:Vector.<Vector.<int>>
unicodeDifferences | property |
protected var unicodeDifferences:Vector.<int>
widths | property |
protected var widths:Vector.<int>
BaseFont | () | Constructor |
public function BaseFont()
_getWidthI | () | method |
protected function _getWidthI(code:int):int
Parameters
code:int |
int |
_getWidthS | () | method |
protected function _getWidthS(text:String):int
Parameters
text:String |
int |
addSubsetTange | () | method |
public function addSubsetTange(range:Vector.<int>):void
Parameters
range:Vector.<int> |
charExists | () | method |
public function charExists(c:int):Boolean
Parameters
c:int |
Boolean |
convertToByte | () | method |
public function convertToByte(char1:int):Bytes
Converts a char to a Bytes according to the font's encoding.
Parameters
char1:int |
Bytes |
convertToBytes | () | method |
public function convertToBytes(char1:String):Bytes
Converts a char to a Bytes according to the font's encoding.
Parameters
char1:String |
Bytes |
createEncoding | () | method |
protected function createEncoding():void
createFont | () | method |
public static function createFont(name:String, encoding:String, embedded:Boolean, cached:Boolean, ttfAfm:Vector.<int> = null, pfb:Vector.<int> = null, noThrow:Boolean = false, forceRead:Boolean = false):BaseFont
Creates a new font. This font can be one of the 14 built in types, a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier appended to the name. These modifiers are: Bold, Italic and BoldItalic. An example would be "STSong-Light,Bold". Note that this modifiers do not work if the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". This would get the second font (indexes start at 0), in this case "MS PGothic".
Parameters
name:String | |
encoding:String | |
embedded:Boolean (default = NaN )
| |
cached:Boolean (default = NaN )
| |
ttfAfm:Vector.<int> (default = null )
| |
pfb:Vector.<int> (default = null )
| |
noThrow:Boolean (default = false )
| |
forceRead:Boolean (default = false )
|
BaseFont |
DocumentError
| |
IOError
|
createSubsetPrefix | () | method |
public static function createSubsetPrefix():String
Creates a unique subset prefix to be added to the font name when the font is embedded and subset.
ReturnsString — the subset prefix
|
getBaseName | () | method |
protected static function getBaseName(name:String):String
Gets the fontname without the modifiers Bold, Italic or BoldItalic.
Parameters
name:String |
String |
getCharBBox | () | method |
public function getCharBBox(c:int):Vector.<int>
Parameters
c:int |
Vector.<int> |
getFamilyFontName | () | method |
public function getFamilyFontName():Vector.<Vector.<String>>
ReturnsVector.<Vector.<String>> |
getFontDescriptor | () | method |
public function getFontDescriptor(key:int, fontSize:Number):Number
Parameters
key:int | |
fontSize:Number |
Number |
getFullFontStream | () | method |
getKerning | () | method |
public function getKerning(char1:int, char2:int):int
Gets the kerning between two Unicode chars
Parameters
char1:int | |
char2:int |
int |
getPostscriptFontName | () | method |
public function getPostscriptFontName():String
ReturnsString |
getRawCharBBox | () | method |
protected function getRawCharBBox(c:int, name:String):Vector.<int>
Parameters
c:int | |
name:String |
Vector.<int> |
getRawWidth | () | method |
protected function getRawWidth(c:int, name:String):int
Gets the width from the font according to the Unicode char c or the name
Parameters
c:int | |
name:String |
int |
getUnicodeDifferences | () | method |
public function getUnicodeDifferences(index:int):int
Parameters
index:int |
int |
getUnicodeEquivalent | () | method |
public function getUnicodeEquivalent(c:int):int
Parameters
c:int |
int |
getWidth | () | method |
public function getWidth(code:Object):int
Gets the width of a char in normalized 1000 units Possible input parameters are: String,int
Parameters
code:Object — Allowed values are int, String
|
int |
getWidthPoint | () | method |
public function getWidthPoint(code:Object, fontSize:Number):Number
Gets the width of a char in points.
Parameters
code:Object — Allowed values are int, String
| |
fontSize:Number |
Number |
getWidthPointKerned | () | method |
public function getWidthPointKerned(text:String, fontSize:Number):Number
Gets the width of a string in points taking kerning into account
Parameters
text:String | |
fontSize:Number |
Number |
hasKernPairs | () | method |
public function hasKernPairs():Boolean
Checks if the font has any kerning pairs
ReturnsBoolean |
normalizeEncoding | () | method |
protected static function normalizeEncoding(enc:String):String
Normalize the encoding name
Parameters
enc:String |
String |
setKerning | () | method |
public function setKerning(char1:int, char2:int, kern:int):Boolean
Parameters
char1:int | |
char2:int | |
kern:int |
Boolean |
writeFont | () | method |
public function writeFont(writer:PdfWriter, ref:PdfIndirectReference, params:Vector.<Object>):void
Parameters
writer:PdfWriter | |
ref:PdfIndirectReference | |
params:Vector.<Object> |
DocumentError
| |
IOError
|
AdobeCNS1_UCS2 | Constant |
public static const AdobeCNS1_UCS2:String = Adobe-CNS1-UCS2
AdobeGB1_UCS2 | Constant |
public static const AdobeGB1_UCS2:String = Adobe-GB1-UCS2
AdobeJapan1_UCS2 | Constant |
public static const AdobeJapan1_UCS2:String = Adobe-Japan1-UCS2
AdobeKorea1_UCS2 | Constant |
public static const AdobeKorea1_UCS2:String = Adobe-Korea1-UCS2
ASCENT | Constant |
public static const ASCENT:int = 1
AWT_ASCENT | Constant |
public static const AWT_ASCENT:int = 9
AWT_DESCENT | Constant |
public static const AWT_DESCENT:int = 10
AWT_LEADING | Constant |
public static const AWT_LEADING:int = 11
AWT_MAXADVANCE | Constant |
public static const AWT_MAXADVANCE:int = 12
BBOXLLX | Constant |
public static const BBOXLLX:int = 5
BBOXLLY | Constant |
public static const BBOXLLY:int = 6
BBOXURX | Constant |
public static const BBOXURX:int = 7
BBOXURY | Constant |
public static const BBOXURY:int = 8
CACHED | Constant |
public static const CACHED:Boolean = true
CAPHEIGHT | Constant |
public static const CAPHEIGHT:int = 2
CHAR_RANGE_ARABIC | Constant |
public static const CHAR_RANGE_ARABIC:Vector.<int>
CHAR_RANGE_CYRILLIC | Constant |
public static const CHAR_RANGE_CYRILLIC:Vector.<int>
CHAR_RANGE_HEBREW | Constant |
public static const CHAR_RANGE_HEBREW:Vector.<int>
CHAR_RANGE_LATIN | Constant |
public static const CHAR_RANGE_LATIN:Vector.<int>
CID_NEWLINE | Constant |
public static const CID_NEWLINE:String = U7fff
COURIER | Constant |
public static const COURIER:String = Courier.afm
COURIER_BOLD | Constant |
public static const COURIER_BOLD:String = Courier-Bold.afm
COURIER_BOLDOBLIQUE | Constant |
public static const COURIER_BOLDOBLIQUE:String = Courier-BoldOblique.afm
COURIER_OBLIQUE | Constant |
public static const COURIER_OBLIQUE:String = Courier-Oblique.afm
CP1250 | Constant |
public static const CP1250:String = Cp1250
CP1252 | Constant |
public static const CP1252:String = Cp1252
CP1257 | Constant |
public static const CP1257:String = Cp1257
DESCENT | Constant |
public static const DESCENT:int = 3
EMBEDDED | Constant |
public static const EMBEDDED:Boolean = true
FONT_TYPE_CJK | Constant |
public static const FONT_TYPE_CJK:int = 2
FONT_TYPE_DOCUMENT | Constant |
public static const FONT_TYPE_DOCUMENT:int = 4
FONT_TYPE_T1 | Constant |
public static const FONT_TYPE_T1:int = 0
FONT_TYPE_T3 | Constant |
public static const FONT_TYPE_T3:int = 5
FONT_TYPE_TT | Constant |
public static const FONT_TYPE_TT:int = 1
FONT_TYPE_TTUNI | Constant |
public static const FONT_TYPE_TTUNI:int = 3
HELVETICA | Constant |
public static const HELVETICA:String = Helvetica.afm
HELVETICA_BOLD | Constant |
public static const HELVETICA_BOLD:String = Helvetica-Bold.afm
HELVETICA_BOLDOBLIQUE | Constant |
public static const HELVETICA_BOLDOBLIQUE:String = Helvetica-BoldOblique.afm
HELVETICA_OBLIQUE | Constant |
public static const HELVETICA_OBLIQUE:String = Helvetica-Oblique.afm
IDENTITY_H | Constant |
public static const IDENTITY_H:String = Identity-H
IDENTITY_V | Constant |
public static const IDENTITY_V:String = Identity-V
ITALICANGLE | Constant |
public static const ITALICANGLE:int = 4
MACROMAN | Constant |
public static const MACROMAN:String = MacRoman
NOT_CACHED | Constant |
public static const NOT_CACHED:Boolean = false
NOT_EMBEDDED | Constant |
public static const NOT_EMBEDDED:Boolean = false
notdef | Constant |
public static const notdef:String = .notdef
RESOURCE_PATH | Constant |
public static const RESOURCE_PATH:String = fonts/
STRIKETHROUGH_POSITION | Constant |
public static const STRIKETHROUGH_POSITION:int = 15
STRIKETHROUGH_THICKNESS | Constant |
public static const STRIKETHROUGH_THICKNESS:int = 16
SUBSCRIPT_OFFSET | Constant |
public static const SUBSCRIPT_OFFSET:int = 18
SUBSCRIPT_SIZE | Constant |
public static const SUBSCRIPT_SIZE:int = 17
SUPERSCRIPT_OFFSET | Constant |
public static const SUPERSCRIPT_OFFSET:int = 20
SUPERSCRIPT_SIZE | Constant |
public static const SUPERSCRIPT_SIZE:int = 19
SYMBOL | Constant |
public static const SYMBOL:String = Symbol.afm
TIMES_BOLD | Constant |
public static const TIMES_BOLD:String = Times-Bold.afm
TIMES_BOLDITALIC | Constant |
public static const TIMES_BOLDITALIC:String = Times-BoldItalic.afm
TIMES_ITALIC | Constant |
public static const TIMES_ITALIC:String = Times-Italic.afm
TIMES_ROMAN | Constant |
public static const TIMES_ROMAN:String = Times-Roman.afm
UNDERLINE_POSITION | Constant |
public static const UNDERLINE_POSITION:int = 13
UNDERLINE_THICKNESS | Constant |
public static const UNDERLINE_THICKNESS:int = 14
UniCNS_UCS2_H | Constant |
public static const UniCNS_UCS2_H:String = UniCNS-UCS2-H
UniCNS_UCS2_V | Constant |
public static const UniCNS_UCS2_V:String = UniCNS-UCS2-V
UniGB_UCS2_H | Constant |
public static const UniGB_UCS2_H:String = UniGB-UCS2-H
UniGB_UCS2_V | Constant |
public static const UniGB_UCS2_V:String = UniGB-UCS2-V
UniJIS_UCS2_H | Constant |
public static const UniJIS_UCS2_H:String = UniJIS-UCS2-H
UniJIS_UCS2_HW_H | Constant |
public static const UniJIS_UCS2_HW_H:String = UniJIS-UCS2-HW-H
UniJIS_UCS2_HW_V | Constant |
public static const UniJIS_UCS2_HW_V:String = UniJIS-UCS2-HW-V
UniJIS_UCS2_V | Constant |
public static const UniJIS_UCS2_V:String = UniJIS-UCS2-V
UniKS_UCS2_H | Constant |
public static const UniKS_UCS2_H:String = UniKS-UCS2-H
UniKS_UCS2_V | Constant |
public static const UniKS_UCS2_V:String = UniKS-UCS2-V
WINANSI | Constant |
public static const WINANSI:String = Cp1252
ZAPFDINGBATS | Constant |
public static const ZAPFDINGBATS:String = ZapfDingbats.afm