Font Class Documentation
classFont : SystemIDisposableNamespace: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: Fontsignifier: 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: stringthe name of the font to create
createFlags: FontCreateFlagsflags 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: stringthe name of the font to create
createFlags: FontCreateFlagsflags specifying embedding and other options for the use of a font in the document
wrMode: WritingModedetermines 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:
FontDispose
voidDispose()Returns:
voidDisposeChildren
voidDisposeChildren()Returns:
voidEmbedNow
voidEmbedNow(Documentdoc)Parameters
doc: Documentthe Document the Font is embedded into
Returns:
voidEmbeds the Font.
FindIndexOfFirstUnrepresentableChar
uintFindIndexOfFirstUnrepresentableChar(stringtext)Parameters
text: stringthe 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:
boolIsTextRepresentable
boolIsTextRepresentable(stringtext)Parameters
text: stringthe text to check
Returns:
boolIs this text representable in this font?
MeasureTextWidth
doubleMeasureTextWidth(stringtext, doublefontSize)Parameters
text: stringthe Text to be measured
fontSize: doublethe Font size to be used
Returns:
doubleMeasures the width of the specified text in points, using the Font at the specified size.