org.pdfclown.documents.contents.fonts.Font Class Reference

Abstract font [PDF:1.6:5.4]. More...

Inheritance diagram for org.pdfclown.documents.contents.fonts.Font:
org.pdfclown.objects.PdfObjectWrapper< PdfDictionary > org.pdfclown.documents.contents.fonts.CompositeFont org.pdfclown.documents.contents.fonts.SimpleFont org.pdfclown.documents.contents.fonts.Type0Font org.pdfclown.documents.contents.fonts.Type2Font org.pdfclown.documents.contents.fonts.TrueTypeFont org.pdfclown.documents.contents.fonts.Type1Font org.pdfclown.documents.contents.fonts.Type3Font org.pdfclown.documents.contents.fonts.MMType1Font org.pdfclown.documents.contents.fonts.StandardType1Font

List of all members.

Public Types

enum  FlagsEnum {
  FixedPitch = 0x1, Serif = 0x2, Symbolic = 0x4, Script = 0x8,
  Nonsymbolic = 0x20, Italic = 0x40, AllCap = 0x10000, SmallCap = 0x20000,
  ForceBold = 0x40000
}
 

Font descriptor flags [PDF:1.6:5.7.1].

More...

Public Member Functions

virtual object Clone (Document context)
 Gets a clone of the object, registered inside the given document context.
string Decode (byte[] code)
 Gets the text from the given internal representation.
virtual bool Delete ()
 Removes the object from its document context.
byte[] Encode (string text)
 Gets the internal representation of the given text.
override bool Equals (object obj)
double GetAscent (double size)
 Gets the vertical offset from the baseline to the ascender line (ascent), scaled to the given font size. The value is a positive number.
double GetDescent (double size)
 Gets the vertical offset from the baseline to the descender line (descent), scaled to the given font size. The value is a negative number.
override int GetHashCode ()
double GetHeight (string text, double size)
 Gets the height of the given text, scaled to the given font size.
double GetHeight (string text)
 Gets the unscaled height of the given text.
double GetHeight (char textChar, double size)
 Gets the height of the given character, scaled to the given font size.
double GetHeight (char textChar)
 Gets the unscaled height of the given character.
double GetKernedWidth (string text, double size)
 Gets the width (kerning inclusive) of the given text, scaled to the given font size.
double GetKerning (string text, double size)
 Gets the kerning width inside the given text, scaled to the given font size.
int GetKerning (string text)
 Gets the unscaled kerning width inside the given text.
int GetKerning (char textChar1, char textChar2)
 Gets the unscaled kerning width between two given characters.
double GetLineHeight (double size)
 Gets the line height, scaled to the given font size.
double GetWidth (string text, double size)
 Gets the width (kerning exclusive) of the given text, scaled to the given font size.
int GetWidth (string text)
 Gets the unscaled width (kerning exclusive) of the given text.
double GetWidth (char textChar, double size)
 Gets the width of the given character, scaled to the given font size.
int GetWidth (char textChar)
 Gets the unscaled width of the given character.

Static Public Member Functions

static Font Get (Document context, IInputStream fontData)
 Creates the representation of a font.
static Font Get (Document context, string path)
 Creates the representation of a font.
static PdfDirectObject GetBaseObject (PdfObjectWrapper wrapper)
 Gets the PDF object backing the specified wrapper.
static double GetScalingFactor (double size)
 Gets the scaling factor to be applied to unscaled metrics to get actual measures.
static Font Wrap (PdfDirectObject baseObject)
 Wraps a font reference into a font object.

Protected Member Functions

void CheckCompatibility (object feature)
 Checks whether the specified feature is compatible with the document's conformance version.
 Font (PdfDirectObject baseObject)
 Loads an existing font structure.
 Font (Document context)
 Creates a new font structure within the given document context.
void Load ()
 Loads font information from existing PDF font structure.
abstract void OnLoad ()
 Notifies the loading of font information from an existing PDF font structure.
virtual PdfString RetrieveName ()
 Retrieves the name possibly associated to this object, walking through the document's name dictionary.
PdfDirectObject RetrieveNamedBaseObject ()
 Retrieves the object name, if available; otherwise, behaves like PdfObjectWrapper.BaseObject.

Protected Attributes

BiDictionary< ByteArray, int > codes
 Unicodes by character code.
int defaultGlyphWidth
 Default glyph width.
Dictionary< int, int > glyphIndexes
 Glyph indexes by unicode.
Dictionary< int, int > glyphKernings
 Glyph kernings by (left-right) glyph index pairs.
Dictionary< int, int > glyphWidths
 Glyph widths by glyph index.
bool symbolic = true
 Whether the font encoding is custom (that is non-Unicode).
HashSet< int > usedCodes
 Used unicodes.

Properties

virtual double Ascent [get]
 Gets the unscaled vertical offset from the baseline to the ascender line (ascent). The value is a positive number.
virtual PdfDirectObject BaseObject [get, set]
PdfIndirectObject Container [get]
 Gets the indirect object containing the base object.
PdfIndirectObject DataContainer [get]
 Gets the indirect object containing the base data object.
virtual double Descent [get]
 Gets the unscaled vertical offset from the baseline to the descender line (descent). The value is a negative number.
abstract PdfDictionary Descriptor [get]
 Gets the font descriptor.
Document Document [get]
 Gets the document context.
File File [get]
 Gets the file context.
virtual FlagsEnum Flags [get]
 Gets the font descriptor flags.
double LineHeight [get]
 Gets the unscaled line height.
string Name [get]
 Gets the PostScript name of the font.
bool Symbolic [get]
 Gets whether the font encoding is custom (that is non-Unicode).

Abstract font [PDF:1.6:5.4].


Member Enumeration Documentation

Font descriptor flags [PDF:1.6:5.7.1].

Enumerator:
FixedPitch 

All glyphs have the same width.

Serif 

Glyphs have serifs.

Symbolic 

Font contains glyphs outside the Adobe standard Latin character set.

Script 

Glyphs resemble cursive handwriting.

Nonsymbolic 

Font uses the Adobe standard Latin character set.

Italic 

Glyphs have dominant vertical strokes that are slanted.

AllCap 

Font contains no lowercase letters.

SmallCap 

Font contains both uppercase and lowercase letters.

ForceBold 

Thicken bold glyphs at small text sizes.


Constructor & Destructor Documentation

org.pdfclown.documents.contents.fonts.Font.Font ( Document  context  )  [protected]

Creates a new font structure within the given document context.

org.pdfclown.documents.contents.fonts.Font.Font ( PdfDirectObject  baseObject  )  [protected]

Loads an existing font structure.


Member Function Documentation

void org.pdfclown.objects.PdfObjectWrapper.CheckCompatibility ( object  feature  )  [protected, inherited]

Checks whether the specified feature is compatible with the document's conformance version.

Parameters:
feature Entity whose compatibility has to be checked. Supported types:

virtual object org.pdfclown.objects.PdfObjectWrapper.Clone ( Document  context  )  [virtual, inherited]

Gets a clone of the object, registered inside the given document context.

Parameters:
context Which document the clone has to be registered in.
string org.pdfclown.documents.contents.fonts.Font.Decode ( byte[]  code  ) 

Gets the text from the given internal representation.

Parameters:
code Internal representation to decode.
virtual bool org.pdfclown.objects.PdfObjectWrapper.Delete (  )  [virtual, inherited]

Removes the object from its document context.

The object is no more usable after this method returns.

Returns:
Whether the object was actually decontextualized (only indirect objects can be decontextualize).

Reimplemented in org.pdfclown.documents.interaction.annotations.Annotation, org.pdfclown.documents.interaction.navigation.page.Article, and org.pdfclown.documents.interaction.navigation.page.ArticleElement.

byte [] org.pdfclown.documents.contents.fonts.Font.Encode ( string  text  ) 

Gets the internal representation of the given text.

Parameters:
text Text to encode.

Referenced by org.pdfclown.documents.contents.composition.PrimitiveComposer.ShowText().

override bool org.pdfclown.documents.contents.fonts.Font.Equals ( object  obj  ) 
static Font org.pdfclown.documents.contents.fonts.Font.Get ( Document  context,
IInputStream  fontData 
) [static]

Creates the representation of a font.

Reimplemented in org.pdfclown.documents.contents.fonts.CompositeFont.

static Font org.pdfclown.documents.contents.fonts.Font.Get ( Document  context,
string  path 
) [static]

Creates the representation of a font.

double org.pdfclown.documents.contents.fonts.Font.GetAscent ( double  size  ) 

Gets the vertical offset from the baseline to the ascender line (ascent), scaled to the given font size. The value is a positive number.

Parameters:
size Font size.

Referenced by org.pdfclown.documents.contents.composition.PrimitiveComposer.ShowText(), org.pdfclown.documents.contents.composition.BlockComposer.ShowText(), and org.pdfclown.documents.contents.entities.EAN13Barcode.ToInlineObject().

static PdfDirectObject org.pdfclown.objects.PdfObjectWrapper.GetBaseObject ( PdfObjectWrapper< PdfDictionary wrapper  )  [static, inherited]

Gets the PDF object backing the specified wrapper.

Parameters:
wrapper Object to extract the base from.
double org.pdfclown.documents.contents.fonts.Font.GetDescent ( double  size  ) 

Gets the vertical offset from the baseline to the descender line (descent), scaled to the given font size. The value is a negative number.

Parameters:
size Font size.

Referenced by org.pdfclown.documents.contents.composition.PrimitiveComposer.ShowText().

override int org.pdfclown.documents.contents.fonts.Font.GetHashCode (  ) 
double org.pdfclown.documents.contents.fonts.Font.GetHeight ( string  text,
double  size 
)

Gets the height of the given text, scaled to the given font size.

Parameters:
text Text whose height has to be calculated.
size Font size.

References org.pdfclown.documents.contents.fonts.Font.GetHeight().

Referenced by org.pdfclown.documents.contents.fonts.Font.GetHeight().

double org.pdfclown.documents.contents.fonts.Font.GetHeight ( string  text  ) 

Gets the unscaled height of the given text.

Parameters:
text Text whose height has to be calculated.
double org.pdfclown.documents.contents.fonts.Font.GetHeight ( char  textChar,
double  size 
)

Gets the height of the given character, scaled to the given font size.

Parameters:
textChar Character whose height has to be calculated.
size Font size.

References org.pdfclown.documents.contents.fonts.Font.GetHeight().

Referenced by org.pdfclown.documents.contents.fonts.Font.GetHeight().

double org.pdfclown.documents.contents.fonts.Font.GetHeight ( char  textChar  ) 

Gets the unscaled height of the given character.

Parameters:
textChar Character whose height has to be calculated.
double org.pdfclown.documents.contents.fonts.Font.GetKernedWidth ( string  text,
double  size 
)

Gets the width (kerning inclusive) of the given text, scaled to the given font size.

Parameters:
text Text whose width has to be calculated.
size Font size.

Referenced by org.pdfclown.documents.contents.composition.PrimitiveComposer.ShowText().

double org.pdfclown.documents.contents.fonts.Font.GetKerning ( string  text,
double  size 
)

Gets the kerning width inside the given text, scaled to the given font size.

Parameters:
text Text whose kerning has to be calculated.
size Font size.

References org.pdfclown.documents.contents.fonts.Font.GetKerning().

Referenced by org.pdfclown.documents.contents.fonts.Font.GetKerning().

int org.pdfclown.documents.contents.fonts.Font.GetKerning ( string  text  ) 

Gets the unscaled kerning width inside the given text.

Parameters:
text Text whose kerning has to be calculated.
int org.pdfclown.documents.contents.fonts.Font.GetKerning ( char  textChar1,
char  textChar2 
)

Gets the unscaled kerning width between two given characters.

Parameters:
textChar1 Left character.
textChar2 Right character,
double org.pdfclown.documents.contents.fonts.Font.GetLineHeight ( double  size  ) 

Gets the line height, scaled to the given font size.

Parameters:
size Font size.

Referenced by org.pdfclown.documents.contents.composition.PrimitiveComposer.ShowText(), and org.pdfclown.documents.contents.composition.BlockComposer.ShowText().

static double org.pdfclown.documents.contents.fonts.Font.GetScalingFactor ( double  size  )  [static]

Gets the scaling factor to be applied to unscaled metrics to get actual measures.

double org.pdfclown.documents.contents.fonts.Font.GetWidth ( string  text,
double  size 
)

Gets the width (kerning exclusive) of the given text, scaled to the given font size.

Parameters:
text Text whose width has to be calculated.
size Font size.

References org.pdfclown.documents.contents.fonts.Font.GetWidth().

Referenced by org.pdfclown.documents.contents.fonts.Font.GetWidth().

int org.pdfclown.documents.contents.fonts.Font.GetWidth ( string  text  ) 

Gets the unscaled width (kerning exclusive) of the given text.

Parameters:
text Text whose width has to be calculated.
double org.pdfclown.documents.contents.fonts.Font.GetWidth ( char  textChar,
double  size 
)

Gets the width of the given character, scaled to the given font size.

Parameters:
textChar Character whose height has to be calculated.
size Font size.

References org.pdfclown.documents.contents.fonts.Font.GetWidth().

Referenced by org.pdfclown.documents.contents.fonts.Font.GetWidth().

int org.pdfclown.documents.contents.fonts.Font.GetWidth ( char  textChar  ) 

Gets the unscaled width of the given character.

Parameters:
textChar Character whose width has to be calculated.

Referenced by org.pdfclown.documents.contents.composition.TextFitter.Fit(), and org.pdfclown.documents.contents.entities.EAN13Barcode.ToInlineObject().

void org.pdfclown.documents.contents.fonts.Font.Load (  )  [protected]
abstract void org.pdfclown.documents.contents.fonts.Font.OnLoad (  )  [protected, pure virtual]
virtual PdfString org.pdfclown.objects.PdfObjectWrapper.RetrieveName (  )  [protected, virtual, inherited]

Retrieves the name possibly associated to this object, walking through the document's name dictionary.

Reimplemented in org.pdfclown.documents.multimedia.Rendition.

PdfDirectObject org.pdfclown.objects.PdfObjectWrapper.RetrieveNamedBaseObject (  )  [protected, inherited]

Retrieves the object name, if available; otherwise, behaves like PdfObjectWrapper.BaseObject.

static Font org.pdfclown.documents.contents.fonts.Font.Wrap ( PdfDirectObject  baseObject  )  [static]

Member Data Documentation

Unicodes by character code.

When this map is populated,

variable shall accordingly be set.

Default glyph width.

Glyph indexes by unicode.

Glyph kernings by (left-right) glyph index pairs.

Glyph widths by glyph index.

Whether the font encoding is custom (that is non-Unicode).

Used unicodes.


Property Documentation

virtual double org.pdfclown.documents.contents.fonts.Font.Ascent [get]

Gets the unscaled vertical offset from the baseline to the ascender line (ascent). The value is a positive number.

Reimplemented in org.pdfclown.documents.contents.fonts.StandardType1Font, and org.pdfclown.documents.contents.fonts.Type3Font.

virtual PdfDirectObject org.pdfclown.objects.PdfObjectWrapper.BaseObject [get, set, inherited]

Gets the underlying reference object, if available; otherwise, gets the underlying data object.

PdfIndirectObject org.pdfclown.objects.PdfObjectWrapper.Container [get, inherited]

Gets the indirect object containing the base object.

PdfIndirectObject org.pdfclown.objects.PdfObjectWrapper.DataContainer [get, inherited]

Gets the indirect object containing the base data object.

virtual double org.pdfclown.documents.contents.fonts.Font.Descent [get]

Gets the unscaled vertical offset from the baseline to the descender line (descent). The value is a negative number.

Reimplemented in org.pdfclown.documents.contents.fonts.StandardType1Font, and org.pdfclown.documents.contents.fonts.Type3Font.

abstract PdfDictionary org.pdfclown.documents.contents.fonts.Font.Descriptor [get, protected]
Document org.pdfclown.objects.PdfObjectWrapper.Document [get, inherited]

Gets the document context.

File org.pdfclown.objects.PdfObjectWrapper.File [get, inherited]

Gets the file context.

virtual FlagsEnum org.pdfclown.documents.contents.fonts.Font.Flags [get]

Gets the font descriptor flags.

Reimplemented in org.pdfclown.documents.contents.fonts.StandardType1Font.

double org.pdfclown.documents.contents.fonts.Font.LineHeight [get]

Gets the unscaled line height.

string org.pdfclown.documents.contents.fonts.Font.Name [get]

Gets the PostScript name of the font.

bool org.pdfclown.documents.contents.fonts.Font.Symbolic [get]

Gets whether the font encoding is custom (that is non-Unicode).

Copyright 2006-2013 Stefano Chizzolini. For more information, please visit PDF Clown home page.

Generated on Sat Feb 9 21:08:32 2013 for PDF Clown 0.1.2 by  doxygen 1.6.3