# org.pdfclown.documents.contents.fonts.MMType1Font Class Reference

Multiple Master Type 1 font [PDF:1.6:5.5.1]. More...

Inheritance diagram for org.pdfclown.documents.contents.fonts.MMType1Font:

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.
virtual IDictionary< ByteArray, int > | GetNativeEncoding ()
void | Load ()
| Loads font information from existing PDF font structure.
override void | LoadEncoding ()
void | LoadEncodingDifferences (PdfDictionary encodingDictionary, IDictionary< ByteArray, int > codes)
| Loads the encoding differences into the given collection.
override 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.
AfmParser.FontMetrics | metrics
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.
override 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).

##

Multiple Master Type 1 font [PDF:1.6:5.5.1].

## Member Enumeration Documentation

enum org::pdfclown::documents::contents::fonts::Font::FlagsEnum`[inherited]`

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.

## 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: VersionEnum Property name resolvable to an annotated getter method MemberInfo

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 | ) | `[inherited]`

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 | ) | `[inherited]`

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 | ) | `[inherited]`

Reimplemented from org.pdfclown.objects.PdfObjectWrapper< PdfDictionary >.

static Font org.pdfclown.documents.contents.fonts.Font.Get | ( | Document | context,
|  | IInputStream | fontData |
| ) |  |  | `[static, inherited]`

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, inherited]`

Creates the representation of a font.

double org.pdfclown.documents.contents.fonts.Font.GetAscent | ( | double | size | ) | `[inherited]`

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 | ) | `[inherited]`

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 | ( |  | ) | `[inherited]`

Reimplemented from org.pdfclown.objects.PdfObjectWrapper< PdfDictionary >.

double org.pdfclown.documents.contents.fonts.Font.GetHeight | ( | string | text,
|  | double | size |
| ) |  |  | `[inherited]`

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 | ) | `[inherited]`

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 |
| ) |  |  | `[inherited]`

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 | ) | `[inherited]`

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 |
| ) |  |  | `[inherited]`

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 |
| ) |  |  | `[inherited]`

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 | ) | `[inherited]`

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 |
| ) |  |  | `[inherited]`

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 | ) | `[inherited]`

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().

virtual IDictionary<ByteArray,int> org.pdfclown.documents.contents.fonts.Type1Font.GetNativeEncoding | ( |  | ) | `[protected, virtual, inherited]`

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

References org.pdfclown.objects.PdfStream.Body, org.pdfclown.objects.PdfDictionary.ContainsKey(), org.pdfclown.objects.PdfStream.Header, org.pdfclown.documents.contents.fonts.PfbParser.Parse(), and org.pdfclown.objects.PdfDictionary.Resolve().

static double org.pdfclown.documents.contents.fonts.Font.GetScalingFactor | ( | double | size | ) | `[static, inherited]`

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 |
| ) |  |  | `[inherited]`

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 | ) | `[inherited]`

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 |
| ) |  |  | `[inherited]`

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 | ) | `[inherited]`

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, inherited]`

Loads font information from existing PDF font structure.

References org.pdfclown.objects.PdfStream.Body, org.pdfclown.util.ByteArray.Data, and org.pdfclown.documents.contents.fonts.CMapParser.Parse().

override void org.pdfclown.documents.contents.fonts.Type1Font.LoadEncoding | ( |  | ) | `[protected, virtual, inherited]`

Implements org.pdfclown.documents.contents.fonts.SimpleFont.

void org.pdfclown.documents.contents.fonts.SimpleFont.LoadEncodingDifferences | ( | PdfDictionary | encodingDictionary,
|  | IDictionary< ByteArray, int > | codes |
| ) |  |  | `[protected, inherited]`

Loads the encoding differences into the given collection.

Parameters:

  | encodingDictionary | Encoding dictionary.
  | codes | Encoding to alter applying differences.

References org.pdfclown.objects.PdfDictionary.Resolve().

override void org.pdfclown.documents.contents.fonts.SimpleFont.OnLoad | ( |  | ) | `[protected, virtual, inherited]`

Notifies the loading of font information from an existing PDF font structure.

Implements org.pdfclown.documents.contents.fonts.Font.

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

References org.pdfclown.objects.IPdfNumber.IntValue.

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, inherited]`

Wraps a font reference into a font object.

Parameters:

  | baseObject | Font base object.

Returns:
  Font object associated to the reference.

References org.pdfclown.objects.PdfDictionary.ContainsKey(), org.pdfclown.objects.PdfReference.DataObject, org.pdfclown.files.File.Document, org.pdfclown.objects.PdfIndirectObject.File, org.pdfclown.objects.PdfReference.IndirectObject, and org.pdfclown.objects.PdfDictionary.Resolve().

## Member Data Documentation

BiDictionary<ByteArray,int> org.pdfclown.documents.contents.fonts.Font.codes`[protected, inherited]`

Unicodes by character code.

When this map is populated,

    symbolic

variable shall accordingly be set.

int org.pdfclown.documents.contents.fonts.Font.defaultGlyphWidth`[protected, inherited]`

Default glyph width.

Dictionary<int,int> org.pdfclown.documents.contents.fonts.Font.glyphIndexes`[protected, inherited]`

Glyph indexes by unicode.

Dictionary<int,int> org.pdfclown.documents.contents.fonts.Font.glyphKernings`[protected, inherited]`

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

Dictionary<int,int> org.pdfclown.documents.contents.fonts.Font.glyphWidths`[protected, inherited]`

Glyph widths by glyph index.

AfmParser.FontMetrics org.pdfclown.documents.contents.fonts.Type1Font.metrics`[protected, inherited]`

bool org.pdfclown.documents.contents.fonts.Font.symbolic = true`[protected, inherited]`

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

HashSet<int> org.pdfclown.documents.contents.fonts.Font.usedCodes`[protected, inherited]`

Used unicodes.

## Property Documentation

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

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, inherited]`

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.

override PdfDictionary org.pdfclown.documents.contents.fonts.SimpleFont.Descriptor`[get, protected, inherited]`

Gets the font descriptor.

Reimplemented from org.pdfclown.documents.contents.fonts.Font.

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, inherited]`

Gets the font descriptor flags.

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

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

Gets the unscaled line height.

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

Gets the PostScript name of the font.

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

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.