[]
        
(Showing Draft Content)

GrapeCity.Documents.Text.Font

Font Class

Represents a TrueType or OpenType font.

Inheritance
Font
Namespace: GrapeCity.Documents.Text
Assembly: DS.Documents.Imaging.dll
Syntax
public class Font
Public Class Font

Properties

Name Description
AvgCharWidth

Gets the Average Character Width parameter specifies the arithmetic average of the escapement (width) of all non-zero width glyphs in the font.

CanEmbed

Gets a value indicating whether this font can be embedded.

CanSubset

Gets a value indicating whether this font can be serialized as a subset of the source font data.

CapHeight

Gets the metric specifying the distance between the baseline and the approximate height of uppercase letters measured in FUnits.

Collection

Gets a value indicating if the font was loaded from .ttc or .otc font collection.

Compressed

Gets a value indicating if the font is in WOFF format.

EnableHinting

Gets or sets a value indicating if the TrueType glyph hinting instructions can be executed.

By default hinting instructions are enabled, but note that only some TrueType fonts include such instructions. For fonts that do not include glyph instructions, this property will always return false.

Also note that this property affects text drawing on GcBitmapGraphics only.

FamilyClass

Get the value classifying the font-family design.

FirstCharCode

Gets the minimum Unicode index (character code) in this font.

Flags

Gets the set of flags describing the font.

FontBold

Gets the value of the Bold flag from the OS/2 table data.

FontData

Gets the source font data (null, if the font loaded from file).

FontFamilyName

Get the font family name. Up to four faces can share the same font family name.

FontFileName

Gets the name of the associated font file.

FontItalic

Gets the value of the Italic flag from the OS/2 table data.

FontOblique

Gets the value of the Oblique flag from the OS/2 table data.

FontPath

Gets the path to the font file.

FontRevision

Gets the revision number set by font manufacturer.

FullFontName

Gets the full font name that reflects all family and relevant subfamily descriptors.

HangingBaseline

Gets the hanging baseline, which is used in scripts like Devanagari, in design units relative to the Roman baseline.

Hollow

Gets a value indicating if characters are hollow (outlined), otherwise they are solid.

HorizontalAscender

Gets the typographic or legacy ascender for this font.

HorizontalDescender

Gets the typographic or legacy descender for this font.

HorizontalHeight

Gets the sum of HorizontalAscender and HorizontalDescender.

HorizontalLineGap

Gets the typographic or legacy line gap for this font.

HorizontalLineSpacing

Gets the recommended line spacing for single-spaced horizontal text.

IdeographicCenteredBaseline

Gets the ideographic centered baseline, in design units relative to the Roman baseline.

IdeographicLowBaseline

Gets the ideographic low baseline, in design units relative to the Roman baseline.

IsColorFont

Gets a value indicating if this font contains color glyphs.

IsFixedPitch

False if the font is proportionally spaced, True if the font is not proportionally spaced (i.e. monospaced).

IsOrnamentalFont

Gets a value indicating whether the font-family design reflects the ISO Ornamental Class and the ISO Blackletter Class.

IsSansSerif

Gets a value indicating whether the font-family design reflects the ISO Sans Serif Class.

IsScriptFont

Gets a value indicating whether the font-family design reflects the ISO Script Class and Uncial Class.

IsSerifFont

Gets a value indicating whether the font-family design reflects any of the Serif classes, except Sans Serif.

IsSymbolicFont

Gets a value indicating whether this is a symbolic font suitable for Pi and special characters (icons, dingbats, technical symbols, etc.)

IsVerticalFont

Gets a value indicating if this is a vertical font.

ItalicAngle

Gets the italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).

LastCharCode

Gets the maximum Unicode index (character code) in this font.

LastResort

Gets a value indicating if the glyphs encoded in the cmap subtables are simply generic symbolic representations of code point ranges and don’t truly represent support for those code points.

LocalFamilyNames

Gets the array of localized font family names with associated language IDs.

LocalFullFontNames

Gets the array of localized font names reflecting all family and relevant subfamily descriptors, with associated language IDs.

LocalTypographicFamilyNames

Gets the array of localized names for the typographic family group, with associated language IDs.

MathBaseline

Gets the math baseline, in design units relative to the Roman baseline.

Negative

Gets a value indicating if characters have their foreground and background reversed.

NumGlyphs

Gets the number of glyphs in the Font.

Panose

Gets the 10-byte series of numbers that is used to describe the visual characteristics of a typeface.

PermissionToEmbedGranted

Gets or sets a value indicating that the developer of the software has obtained explicit permission from the legal owner of the font to embed it in documents produced by the software.

See https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fstype for details.

The default is false.

PostScript

Gets a value indicating if the current font contains PostScript outlines.

PostScriptName

Gets the PostScript name for the font.

SmallXHeight

Gets the metric specifying the distance between the baseline and the approximate height of non-ascending lowercase letters measured in FUnits.

Strikeout

Gets a value indicating if characters are overstruck.

StrikethroughPosition

Gets the position of the top of the strikethrough stroke relative to the baseline in font design units.

StrikethroughThickness

Gets the thickness of the strikethrough stroke in font design units.

SubscriptYOffset

Gets the recommended vertical offset in font design units from the baseline for subscripts for this font.

SubscriptYSize

Gets the recommended vertical size in font design units for subscripts for this font.

SuperscriptYOffset

Gets the recommended vertical offset in font design units from the baseline for superscripts for this font.

SuperscriptYSize

The recommended vertical size in font design units for superscripts for this font.

Tag

Gets or sets the custom data associated with the Font.

TypographicFamilyName

Gets the typographic family grouping name.

The typographic family grouping doesn't impose any constraints on the number of faces within it, in contrast with the 4-style family grouping.

UnderlinePosition

Gets the suggested distance of the top of the underline from the baseline (negative values indicate below baseline).

UnderlineThickness

Gets the suggested value for the underline thickness.

Underscore

Gets a value indicating if characters are underscored.

UnitsPerEm

Gets the design units per Em, valid range is from 16 to 16384.

UseBitmapCache

Gets or sets a value indicating if the Bitmap Glyph Cache is enabled.

This property affects text drawing on GcBitmapGraphics only.

Version

Gets the version set by font manufacturer.

VerticalAscender

Gets the vertical typographic ascender for this font.

VerticalDescender

Gets the vertical typographic descender for this font.

VerticalLineGap

Gets the vertical typographic gap for this font.

VerticalLineSpacing

Gets the recommended line spacing for single-spaced vertical text.

VerticalWidth

Gets the sum of VerticalAscender and VerticalDescender.

WeightClass

Get the value indicating the visual weight (degree of blackness or thickness of strokes) of the characters in the font.

Values from 1 to 1000 are valid.

WidthClass

Get the value indicating a relative change from the normal aspect ratio (width to height ratio) for the glyphs in a font.

Values from 1 (UltraCondensed) to 9 (UltraExpanded) are expected.

Methods

Name Description
AddEudcFont(Font, float?)

Associates user-defined characters from the specified EUDC Font to the current font.

AddLinkedFont(Font, float?)

Adds a link to the specified Font.

Searches for an associated EUDC Font containing the given code point.

ChooseLinkedFont(int, bool)

Searches for a linked Font containing the given code point.

Clears the list of the associated EUDC Fonts.

ClearLinkedFonts()

Clears the list of the linked Fonts.

CollectionFromArray(byte[], List<Font>, bool)

Loads all Fonts from a byte array containing single font or a font collection.

CollectionFromFile(string, List<Font>, bool)

Loads all Fonts from a specified font file.

CollectionFromStream(Stream, List<Font>, int, bool)

Loads all Fonts from a specified stream containing single font or a font collection.

ContainsCodePoint(int)

Returns a value indicating whether the font can map the specified code point to a glyph.

CreateFontTables(params TableTag[])

Creates an instance of the FontTables class for this font with the specified set of OpenType tables. Used to access information contained in the font's OpenType tables.

FromArray(byte[], bool)

Loads the first Font from a byte array.

FromArray(byte[], string)

Loads a Font with given full font name from a byte array.

FromFile(string, bool)

Loads the first Font from a specified file.

FromFile(string, string)

Loads a Font with given full font name from a specified file.

FromStream(Stream, int, bool)

Loads a Font from the specified stream.

FromStream(Stream, string, int)

Loads a Font with given full font name from a specified stream.

Gets a snapshot of the internal list of links to the associated EUDC fonts.

GetLinkedFonts()

Gets a snapshot of the internal list of linked fonts.

GetLocalFamilyName(int)

Returns the localized version of font family name for the specified language ID.

Gets a value indicating whether the font has the associated EUDC Fonts.

HasLinkedFonts()

Gets a value indicating whether the font has linked Fonts.

MatchFontFamilyName(string)

Returns True if the specified string matches the font family name or its local equivalent.

RemoveEudcFont(Font)

Removes association to the specified EUDC Font from the current font.

RemoveLinkedFont(Font)

Removes a link to the specified Font.

TestCodePageRange(int)

Checks whether the specified code page character range is considered functional (see Os2CodePageRange).

TestUnicodeRange(int)

Checks whether the specified Unicode range is considered functional (see Os2UnicodeRange).

ToString()

Returns a string that represents the Font.