Font Class Documentation

classFont : SystemIDisposable

Namespace:Datalogics::PDFL

Inherits from:
SystemIDisposable

Detailed Description

Represents a font. Defines the typeface, size, style (bold, italic), Unicode values, and other details.

The Font class represents a font installed on the system.

Constructor & Destructor Documentation

Font

Font(Fontrhs, InternalConstructsignifier)

Parameters

rhs: Font
signifier: InternalConstruct

Font

Font(stringfontName)

Parameters

fontName: string

Find a font with the specified name, and construct a Font object from it.

Otherwise, it makes a font with the default encoding (MacRomanEncoding on Macs, WinAnsiEncoding elsewhere, or for symbol fonts, their own custom encoding). There is not a way to specify another encoding for the font.

When setting text, it checks to see if the text is representable in the font's encoding. If it is not, then DLE makes a "unicode font" with an Identity-H encoding and uses that to set the text. For non-Type0 fonts, this may result in two versions of a font in the output document.

PDFL enforces the following requirements on fonts:

TrueTypes used as CID fonts must be embedded.

All CID fonts that are embedded must be subsetted.

CID fonts that are marked as embedded get their DoNotEmbed flag turned off (or else PDFL won't make a PDEFont from the SysFont).

Font

Font(stringfontName, FontCreateFlagscreateFlags)

Parameters

fontName: string

the name of the font to create

createFlags: FontCreateFlags

flags specifying embedding and other options for the use of a font in the document

Find a font with the specified name, and construct a Font object from it.

Otherwise, it makes a font with the default encoding (MacRomanEncoding on Macs, WinAnsiEncoding elsewhere, or for symbol fonts, their own custom encoding). There is not a way to specify another encoding for the font.

When setting text, it checks to see if the text is representable in the font's encoding. If it is not, then DLE makes a "unicode font" with an Identity-H encoding and uses that to set the text. For non-Type0 fonts, this may result in two versions of a font in the output document.

PDFL enforces the following requirements on fonts:

TrueTypes used as CID fonts must be embedded.

All CID fonts that are embedded must be subsetted.

CID fonts that are marked as embedded get their DoNotEmbed flag turned off (or else PDFL won't make a PDEFont from the SysFont).

Font

Font(stringfontName, FontCreateFlagscreateFlags, WritingModewrMode)

Parameters

fontName: string

the name of the font to create

createFlags: FontCreateFlags

flags specifying embedding and other options for the use of a font in the document

wrMode: WritingMode

determines whether text will be printed horizontally or vertically

Find a font with the specified name, and construct a Font object from it.

Otherwise, it makes a font with the default encoding (MacRomanEncoding on Macs, WinAnsiEncoding elsewhere, or for symbol fonts, their own custom encoding). There is not a way to specify another encoding for the font.

When setting text, it checks to see if the text is representable in the font's encoding. If it is not, then DLE makes a "unicode font" with an Identity-H or Identity-V encoding and uses that to set the text. For non-Type0 fonts, this may result in two versions of a font in the output document.

PDFL enforces the following requirements on fonts:

TrueTypes used as CID fonts must be embedded.

All CID fonts that are embedded must be subsetted.

CID fonts that are marked as embedded get their DoNotEmbed flag turned off (or else PDFL won't make a PDEFont from the SysFont).

~Font

~Font()

Destructor.

Property Documentation

Ascent

doubleAscent[get]

AvgWidth

doubleAvgWidth[get]

BBox

RectBBox[get]

CapHeight

doubleCapHeight[get]

CidFontType

stringCidFontType[get]

Descent

doubleDescent[get]

Embedded

boolEmbedded[get]

Encoding

stringEncoding[get]

EncodingInfo

EncodingInfoEncodingInfo[get]

Flags

FontFlagsFlags[get]

FontList

static System.Collections.Generic.IList< Font >FontList[get]

FullName

stringFullName[get]

ItalicAngle

doubleItalicAngle[get]

Leading

doubleLeading[get]

MaxWidth

doubleMaxWidth[get]

MissingWidth

doubleMissingWidth[get]

Name

stringName[get]

PDFDict

PDFDictPDFDict[get]

StemH

doubleStemH[get]

StemV

doubleStemV[get]

Type

stringType[get]

WritingMode

WritingModeWritingMode[get]

XHeight

doubleXHeight[get]

Member Function Documentation

ConstructorRetrieve

static FontConstructorRetrieve(System.IntPtrignored)

Parameters

ignored: System.IntPtr

Returns:

Font

Dispose

voidDispose()

Returns:

void

DisposeChildren

voidDisposeChildren()

Returns:

void

EmbedNow

voidEmbedNow(Documentdoc)

Parameters

doc: Document

the Document the Font is embedded into

Returns:

void

Embeds the Font.

FindIndexOfFirstUnrepresentableChar

uintFindIndexOfFirstUnrepresentableChar(stringtext)

Parameters

text: string

the text to check

Returns:

The index of the first character that cannot be represented in this font.

Find the index of the first character that cannot be represented in this font. This will return the index of the first character in the string for which the font has no glyph. If all characters can be represented (i.e. if IsTextRepresentable() would return true), this will return the length of the string.

IsFromDoc

boolIsFromDoc()

Returns:

bool

IsTextRepresentable

boolIsTextRepresentable(stringtext)

Parameters

text: string

the text to check

Returns:

bool

Is this text representable in this font?

MeasureTextWidth

doubleMeasureTextWidth(stringtext, doublefontSize)

Parameters

text: string

the Text to be measured

fontSize: double

the Font size to be used

Returns:

double

Measures the width of the specified text in points, using the Font at the specified size.