DL Logo

PDSysFont Enumerations

PDSysFontMatchFlags

Header: PDSysFontExpT.h:76

Description

Font matching flags for PDFindSysFontForPDEFont() and PDFindSysFont().

Enum Constants

kPDSysFontMatchNameAndCharSet=0x0001
Match the font name and character set.
kPDSysFontMatchFontType=0x0002
Match the font type.
kPDSysFontMatchWritingMode=0x0004
Match the writing mode (horizontal or vertical).

PDSysFontPackageType

Header: PEExpT.h:2031

Enum Constants

kPDSysFontUnknown=0
kPDSysFontType1
kPDSysFontTrueType
kPDSysFontCID
kPDSysFontATC
kPDSysFontOCF
kPDSysFontOpenTypeCFF
kPDSysFontOpenTypeCID
kPDSysFontOpenTypeTT

PDSysFont Typedefs

ATSFontFamilyRef

Header: PDSysFontExpT.h:39

Syntax

typedef UInt32 ATSFontFamilyRef;

Used In

ATSFontRef

Header: PDSysFontExpT.h:38

Syntax

typedef UInt32 ATSFontRef;

Used In

PDSysFont

Header: PDSysFontExpT.h:70

Description

A reference to a font installed in the host system. PDSysFont methods allow you to list the fonts available in the host system and to find a font in the system that matches a PDEFont, if it is present.

Syntax

typedef struct _t_PDSysFont *PDSysFont;

Returned From

Used By

PDSysFontFID

Header: PDSysFontExpT.h:56

Syntax

typedef FMFontFamily PDSysFontFID;

PDSysFontFRef

Header: PDSysFontExpT.h:52

Syntax

typedef ATSFontRef PDSysFontFRef;

PDSysFontFStyle

Header: PDSysFontExpT.h:58

Syntax

typedef ASInt16 PDSysFontFStyle;

PDSysFontFontFamilyRef

Header: PDSysFontExpT.h:54

Syntax

typedef ATSFontFamilyRef PDSysFontFontFamilyRef;

PDSysFontMode

Header: PDSysFontExpT.h:49

Syntax

typedef ASInt16 PDSysFontMode;

Used In

PDSysFont Callback Signatures

PDSysFontEnumProc

Header: PDSysFontExpT.h:184

Description

A callback for PDEnumSysFonts(). It is called once for each system font.

Syntax

ASBool PDSysFontEnumProc(PDSysFont sysFont, void *clientData);

Parameters

sysFont
IN/OUT The system font.
clientData
IN/OUT User-supplied data that was specified in the call to PDEnumSysFonts().

Returns

true to continue enumeration, false to halt enumeration.

Used By

PDSysFont Structures

_t_PDSysFontPlatData

Header: PDSysFontExpT.h:113

Description

PDSysFontPlatData for Windows.

Syntax

struct _t_PDSysFontPlatData {
ASSize_t size;
This must be sizeof(PDSysFontPlatData).
LOGFONTA *lf;
(Windows only) The Windows LOGFONTA structure defining font attributes.
ASPathName fontPath;
(Optional) Sets the pathname with fontfile name
ASPathName afmPath;
(Optional) This is only set if LOGFONTA is not present.
LOGFONTW *lfw;
(Windows only) The Windows LOGFONTW structure defining font attributes. Whenever * * we return a valid LOGFONTA, we return a valid LOGFONTW.
} PDSysFontPlatData, *PDSysFontPlatDataP;

_t_PDSysFontPlatData

Header: PDSysFontExpT.h:133

Description

PDSysFontPlatData for Mac.

Syntax

struct _t_PDSysFontPlatData {
ASSize_t size;
This must be sizeof(PDSysFontPlatData).
PDSysFontFID fontID;
The font ID. deprecated: Clients should not use this field, Instead use the ATSFontRef returned back in fontRef.
PDSysFontFStyle fontStyle;
The style value within that font. deprecated: Clients should not use this field, Instead use the ATSFontRef returned back in fontRef.
PDSysFontFRef fontRef;
} PDSysFontPlatData, *PDSysFontPlatDataP;

_t_PDSysFontPlatData

Header: PDSysFontExpT.h:159

Description

PDSysFontPlatData for Unix.

Syntax

struct _t_PDSysFontPlatData {
ASSize_t size;
This must be sizeof(PDSysFontPlatData).
ASPathName fontPath;
A path to the font file. It is set only if lf is not present.
ASPathName afmPath;
A path to the font AFM file. It is set only if lf is not present.
} PDSysFontPlatData, *PDSysFontPlatDataP;

Returned From

Used By

PDSysFont Functions

PDEmbedSysFontForPDEFont

Header: PDSysFont.h:331

Description

If there is a font on the system that matches this PDEFont, embed the full font regardless of whether it was subsetted or not embedded at all in the first place. This will not work for CID fonts, because they must be subsetted.

The matching is based on the PDSysFontMatchFlags.

Only the font object itself is modified; no content streams are changed.

Note: This method does not change the reference count of the font.

Syntax

void PDEmbedSysFontForPDEFont(IN PDEFont font, IN ASUns32 flags, IN CosDoc cosDoc);

Parameters

font
IN/OUT A PDEFont object returned from one of the PDEFontCreate methods.
flags
IN/OUT Flags from PDSysFontMatchFlags that determine matches.
cosDoc
IN/OUT Currently unused.

Exceptions

is raised if there is no system font that matches this PDEFont.
is raised if the PDEFont is a CID font.

PDEnumSysFonts

Header: PDSysFont.h:62

Description

Enumerates all of the system fonts with a user-supplied procedure.

The PDSysFont must be acquired during the enumeration if the font is needed beyond the enumProc.

Developers should not assume that the enumProc will be called. If no system fonts are found (for example, if the PSRESOURCEPATH environment variable is not set on UNIX platforms), enumProc is never called, and PDEnumSysFonts() does not raise an exception.

Syntax

void PDEnumSysFonts(IN PDSysFontEnumProc enumProc, IN void *clientData);

Parameters

enumProc
IN/OUT A user-supplied callback to call once for each system font. Enumeration continues until all fonts have been enumerated, or until enumProc returns false.
clientData
IN/OUT A pointer to user-supplied data to pass to enumProc each time it is called.

PDFindSysFont

Header: PDSysFont.h:80

Description

Finds a system font that matches the requested attributes.

The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it.

Syntax

PDSysFont PDFindSysFont(IN PDEFontAttrsP attrs, IN ASUns32 attrsSize, IN ASUns32 flags);

Parameters

attrs
IN/OUT A pointer to a PDEFontAttrs structure with the attributes of the font you are searching for.
attrsSize
IN/OUT The size of the attrs buffer in bytes.
flags
IN/OUT Flags from PDSysFontMatchFlags.

Returns

The desired system font.

PDFindSysFontEx

Header: PDSysFont.h:109

Description

Finds a system font that matches the requested attributes.

If the requested font is a multiple master font instance, the base font is returned, and the specified design vector is decoded and returned in mmDesignVector.

The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it.

Syntax

PDSysFont PDFindSysFontEx(IN PDEFontAttrsP attrs, IN ASUns32 attrsSize, IN ASUns32 flags, OUT ASFixed *mmDesignVector, OUT ASInt32 *designVecLength);

Parameters

attrs
IN/OUT A pointer to a PDEFontAttrs structure with the attributes of the font you are searching for.
attrsSize
IN/OUT The size of the attrs buffer in bytes.
flags
IN/OUT Flags from PDSysFontMatchFlags.
mmDesignVector
IN/OUT (Filled by the method) If the requested font is a Multiple Master font instance, the specified design vector is decoded and returned in mmDesignVector.
designVecLength
IN/OUT (Filled by the method) Pass the length of mmDesignVector. This parameter also returns the number of elements filled in mmDesignVector (the maximum is 4).

Returns

The desired system font.

PDFindSysFontForPDEFont

Header: PDSysFont.h:136

Description

Finds a system font that matches the requested PDEFont.

The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it.

Related Methods

Syntax

PDSysFont PDFindSysFontForPDEFont(IN PDEFont font, IN ASUns32 flags);

Parameters

font
IN/OUT A PDEFont whose matching system font is found.
flags

Returns

The system font corresponding to font.

Exceptions

PDSysFontAcquirePlatformData

Header: PDSysFont.h:281

Description

Acquires platform-specific data for use by user interface code. It must be released when finished by PDSysFontReleasePlatformData().

Syntax

PDSysFontPlatDataP PDSysFontAcquirePlatformData(IN PDSysFont sysFont);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font returned by either PDFindSysFont() or PDFindSysFontForPDEFont().

Returns

A pointer to a platform-dependent structure, PDSysFontPlatData, containing information relating to a system font. It returns NULL if it is out of memory.

PDSysFontGetAttrs

Header: PDSysFont.h:174

Description

Gets the attributes of a system font.

The attributes will be returned in the buffer pointed to by attrsP.

No more than attrsSize bytes will be written to the buffer.

This call can be expensive to execute, as it may involve parsing the font in order to determine attributes.

Syntax

void PDSysFontGetAttrs(IN PDSysFont sysFont, OUT PDEFontAttrsP attrsP, IN ASUns32 attrsSize);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font whose attributes are obtained.
attrsP
IN/OUT (Filled by the method) A pointer to a PDEFontAttrs structure with the attributes of a system font.
attrsSize
IN/OUT The size of the attrsP buffer in bytes.

Exceptions

PDSysFontGetCIDSystemInfo

Header: PDSysFont.h:351

Description

Derives the registry, ordering, and supplement information of a multi-byte system font. This information can be used to create a PDEFont from a system font. For more information on CID fonts, see PDFontGetCIDSystemInfo().

Syntax

void PDSysFontGetCIDSystemInfo(IN PDSysFont sysFont, OUT ASAtom *registry, OUT ASAtom *ordering, OUT ASInt32 *supplement);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a multi-byte system font.
registry
IN/OUT (Filled by the method) The ASAtom representing the CIDFont's Registry information (for example, "Adobe").
ordering
IN/OUT (Filled by the method) The ASAtom representing the CIDFont's Ordering information (for example, "Japan1").
supplement
IN/OUT (Filled by the method) The SystemSupplement field from the CIDFont.

PDSysFontGetCreateFlags

Header: PEWProcs.h:2130

Description

This function returns a createFlags that can be passed to PDEFontCreateFromSysFontAndEncoding(). If the combination of sysFont and sysEnc is not allowed,-1 is returned.

Syntax

ASInt32 PDSysFontGetCreateFlags(IN PDSysFont sysFont, IN PDSysEncoding sysEnc);

Parameters

sysFont
IN/OUT An object of type PDSysFont.
sysEnc
IN/OUT An object of type PDSysEncoding.

Returns

See above.

Exceptions

PDSysFontGetEncoding

Header: PDSysFont.h:236

Description

Gets the encoding of a single byte encoded system font.

The returned encoding must be freed via a call to ASfree().

Syntax

Uns8 **PDSysFontGetEncoding(IN PDSysFont sysFont, OUT ASAtom *encodingNameP);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font whose encoding is obtained.
encodingNameP
IN/OUT (Filled by the method) An encoding name if the return value of PDSysFontGetEncoding() is zero. If encodingNameP is the NULL ASAtom, the font uses its default encoding.

Returns

An encoding array of 256 C strings. Each entry in the array either contains a glyph name or NULL. If it is NULL, the corresponding entry uses the font's built in encoding value.

If the return value is zero, encodingNameP contains the name of the encoding:

  • For a Type 1 font, the default encoding is that specified by the Encoding value in the font dictionary.
  • For a TrueType font, the default encoding is that specified in the single byte CMAP table.

PDSysFontGetInfo

Header: PDSysFont.h:252

Description

Gets high-level information about a system font.

Syntax

void PDSysFontGetInfo(IN PDSysFont sysFont, OUT PDEFontInfoP infoP, IN ASUns32 infoSize);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font whose information is obtained.
infoP
IN/OUT (Filled by the method) A pointer to PDEFontInfoRec structure to fill with font information for sysFont. No more than infoSize bytes are written to this buffer.
infoSize
IN/OUT The size of the infoP buffer in bytes.

PDSysFontGetName

Header: PDSysFont.h:266

Description

Gets the PostScript or TrueType styled name for a system font.

Syntax

ASAtom PDSysFontGetName(IN PDSysFont sysFont);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font whose name is obtained.

Returns

The ASAtom for the system font's name.

PDSysFontGetScript

Header: PDSysFont.h:300

Description

Returns a PDScript value for the specified PDSysFont.

Syntax

PDScript PDSysFontGetScript(IN PDSysFont sysFont);

Parameters

sysFont
The font from which to acquire the script.

PDSysFontGetType0Widths

Header: PDSysFont.h:411

Description

Gets width information from a Type 0 system font. This information can be used to create a PDEFont from a system font.

Note: In general, you are discouraged from using this method. Instead use PDEFontCreateFromSysFontAndEncoding() followed by PDEFontCreateWidthsNow() to create the W entry in a font.

Syntax

void PDSysFontGetType0Widths(IN PDSysFont sysFont, IN ASAtom ordering, OUT ASBool *hasDW, OUT ASInt32 *dw, OUT CosObj *w, OUT ASBool *hasDW2, OUT ASInt32 *dw2, OUT CosObj *w2);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a multibyte system font.
ordering
IN/OUT An ASAtom representing the CIDFont's Ordering information. It is used to get a CMap object for sysFont.
hasDW
IN/OUT (Filled by the method) true if sysFont has a valid dw value; false otherwise.
dw

IN/OUT (Filled by the method) The default width for glyphs in a CIDFont. Currently, it is always 1000. See the description of CIDFontType 0 in "Composite Fonts" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.

You can find this document on the web store of the International Standards Organization (ISO).

w

IN/OUT (Filled by the method) A Cos array of a set of lists that define the widths for the glyphs in the CIDFont. Each list can specify individual widths for consecutive CIDs, or one width for a range of CIDs. For information on the format of this array, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.

You can find this document on the web store of the International Standards Organization (ISO).

hasDW2
IN/OUT (Filled by the method) true if sysFont has a valid dw2 value. The default is false.
dw2

IN/OUT (Filled by the method) The default metrics for writing mode 1. This entry is an array of two ASInt32 numbers: the y component of the position vector and the y component of the displacement vector for writing mode 1. The x component of the position vector is always half the width of the character. The x component of the displacement vector is always 0. The default value is [880-1000]. For information on writing mode 1, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.

You can find this document on the web store of the International Standards Organization (ISO).

w2

IN/OUT (Filled by the method) A Cos array defining the metrics for vertical writing. Its format is similar to the format of the array in w. It defines the x and y components of the position vector, and the y component of the displacement vector. The x component of the displacement vector is always 0. For information on the format of this array, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.

You can find this document on the web store of the International Standards Organization (ISO).

PDSysFontGetWidths

Header: PDSysFont.h:188

Description

Gets the widths of a single byte encoded system font.

Syntax

void PDSysFontGetWidths(IN PDSysFont sysFont, OUT ASInt16 *widthsP);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font whose widths are obtained.
widthsP
IN/OUT (Filled by the method) A pointer to the widths array. widthsP must have room for 256 entries.

Exceptions

PDSysFontGetWidthsEx

Header: PDSysFont.h:205

Description

Gets the widths of a single byte encoded system font.

Syntax

void PDSysFontGetWidthsEx(IN PDSysFont sysFont, OUT ASInt16 *widthsP, IN ASFixed *mmDesignVector);

Parameters

sysFont
IN/OUT A PDSysFont object referencing a system font whose widths are obtained.
widthsP
IN/OUT (Filled by the method) A pointer to the widths array. widthsP must have room for 256 entries.
mmDesignVector
IN/OUT If sysFont is a multiple master font, it points to the design vector, whose length must equal the number of design axes of sysFont.

Exceptions

PDSysFontReleasePlatformData

Header: PDSysFont.h:292

Description

Releases platform-specific data for the specified PDSysFont.

Related Methods

PDSysFontAcquirePlatformData Creates a new attribute object with the specified owner.

Syntax

void PDSysFontReleasePlatformData(IN PDSysFontPlatDataP platDataP);

Parameters

platDataP
IN/OUT A pointer to a PDSysFontPlatDataP structure containing platform-specific data.

PDSysFontVerifyEncoding

Header: PEWProcs.h:2145

Description

Similar to PDSysFontGetCreateFlags but avoids compatibility issues with changing PDSysFontGetCreateFlags. If the combination of sysFont and sysEnc is not allowed,-1 is returned. If the combination is ok, then 0 is returned. If the combination only works if the font is embedded, kPDEFontCreateEmbedded is returned.

Syntax

ASInt32 PDSysFontVerifyEncoding(IN PDSysFont sysFont, IN PDSysEncoding sysEnc);

Parameters

sysFont
IN/OUT An object of type PDSysFont.
sysEnc
IN/OUT An object of type PDSysEncoding.

Returns

See above.

Exceptions