DL Logo

PDFont Definitions

PDFONTFLAGS_USEDBYFORM

Header: PDExpT.h:2206

Syntax

#define PDFONTFLAGS_USEDBYFORM 0x00000001

PDLastOneByteEncoding

Header: PDExpT.h:2300

Syntax

#define PDLastOneByteEncoding PDLastKnownEncoding

PDUnicodeEncoding

Header: PDExpT.h:2301

Syntax

#define PDUnicodeEncoding PDLastKnownEncoding

PD_ALL_CAP

Header: PDExpT.h:2250

Syntax

#define PD_ALL_CAP 0x00010000

PD_FIXED_WIDTH

Header: PDExpT.h:2244

Syntax

#define PD_FIXED_WIDTH 0x00000001

PD_FORCE_BOLD

Header: PDExpT.h:2252

Syntax

#define PD_FORCE_BOLD 0x00040000

PD_ITALIC

Header: PDExpT.h:2249

Syntax

#define PD_ITALIC 0x00000040

PD_PI

Header: PDExpT.h:2246

Syntax

#define PD_PI 0x00000004

PD_SCRIPT

Header: PDExpT.h:2247

Syntax

#define PD_SCRIPT 0x00000008

PD_SEGASCII

Header: PDExpT.h:2327

Syntax

#define PD_SEGASCII (( ASUns8 ) 1 )

PD_SEGBINARY

Header: PDExpT.h:2328

Syntax

#define PD_SEGBINARY (( ASUns8 ) 2 )

PD_SEGEOF

Header: PDExpT.h:2329

Syntax

#define PD_SEGEOF (( ASUns8 ) 3 )

PD_SERIF

Header: PDExpT.h:2245

Syntax

#define PD_SERIF 0x00000002

PD_SMALL_CAP

Header: PDExpT.h:2251

Syntax

#define PD_SMALL_CAP 0x00020000

PD_STD_ENCODING

Header: PDExpT.h:2248

Syntax

#define PD_STD_ENCODING 0x00000020

PSNAMESIZE

Header: PDExpT.h:2239

Syntax

#define PSNAMESIZE 128

PDFont Enumerations

PDFontEncodings

Header: PDExpT.h:2259

Description

An enumerated data type that specifies a font's encoding. To learn more about MacRoman Encoding, see:

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

Enum Constants

PDBuiltInEncoding=-1
The encoding specified internally in the font. In the case of a Type 1 or MMType 1 font, this is specified by the Encoding value in the font's fontdict. In the case of TrueType fonts, this is the encoding specified by the default one-byte CMap for the platform.
PDMacRomanEncoding=0
MacRomanEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
PDMacExpertEncoding=1
MacExpertEncoding, see Annex D, "Character Sets and Encodings," page 651.
PDWinAnsiEncoding=2
WinAnsiEncoding, see Annex D, "Character Sets and Encodings," page 651.
PDStdEncoding=3
StandardEncoding, see Annex D, "Character Sets and Encodings," page 651.
PDFDocEncoding=4
PDFDocEncoding, see Annex D, "Character Sets and Encodings," page 651. This will never be returned for a font; it is used internally.
PDLastKnownEncoding

PDFont Typedefs

PDCharProc

Header: PDExpT.h:2486

Syntax

typedef struct _t_PDCharProc *PDCharProc;

Used By

PDCharSet

Header: PDExpT.h:2324

Description

An enumerated data type that identifies the character set of a Type 1, Multiple Master Type 1, or TrueType font.

For value options see PDCharSets.

Syntax

typedef ASEnum8 PDCharSet;

Returned From

PDFont

Header: PDBasicExpT.h:107

Description

A font that is used to draw text on a page. It corresponds to a Font Resource in a PDF file. Applications can get a list of PDFont objects used on a PDPage or a range of PDPage objects. More than one PDPage may reference the same PDFont object. A PDFont has a number of attributes whose values can be read or set, including an array of widths, the character encoding, and the font's resource name.

Syntax

typedef struct _t_PDFont *PDFont;

Returned From

Used By

Used In

PDFontAngle

Header: PDExpT.h:77

Description

An italic angle value in degrees, for use in PDFontMetrics.

Syntax

typedef ASInt16 PDFontAngle;

Used In

PDFontEncoding

Header: PDExpT.h:2298

Description

An enumerated data type that specifies a font's encoding. To learn more about MacRoman Encoding, see:

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

Syntax

typedef ASEnum8 PDFontEncoding;

PDFontMetric

Header: PDExpT.h:72

Description

An unsigned measurement of a font characteristic (for example, width).

Syntax

typedef ASUns16 PDFontMetric;

PDFontOffset

Header: PDExpT.h:82

Description

A font offset value, for use in PDFontMetrics.

Syntax

typedef ASInt16 PDFontOffset;

Used In

PDiFontMetric

Header: PDExpT.h:87

Description

A font metric value (which is never negative), for use in PDFontMetrics.

Syntax

typedef ASInt16 PDiFontMetric;

Used In

PDFont Callback Signatures

PDCharProcEnumProc

Header: PDExpT.h:3085

Description

A callback for PDFontEnumCharProcs(). It is called once for each character in a Type 3 font.

Syntax

ASBool PDCharProcEnumProc(char *name, PDCharProc obj, void *clientData);

Parameters

name
IN/OUT The name of the current character.
obj
IN/OUT A stream Cos object containing the PDF drawing operators that draw the character.
clientData
IN/OUT User-supplied data that was passed in the call to PDFontEnumCharProcs().

Returns

true to continue enumerating, false to halt enumeration.

PDFontEnumProc

Header: PDExpT.h:2234

Description

A callback used by PDDocEnumFonts() and PDDocEnumLoadedFonts(). It is called once for each font.

Syntax

ASBool PDFontEnumProc(PDFont font, PDFontFlags *fontFlags, void *clientData);

Parameters

font
The font currently being enumerated.
fontFlags
PDFontFlags used when PDDocEnumFonts() was called.
clientData
User-supplied data passed in the call to PDDocEnumFonts() or PDDocEnumLoadedFonts().

Returns

true to continue enumeration, false to halt enumeration.

Used By

PDFont Structures

_t_PDFontFlags

Header: PDExpT.h:2213

Description

A data structure containing additional information about a font.

Related Methods

Syntax

struct _t_PDFontFlags {
ASInt32 notUsed;
Not used. For backward compatibility.
ASUns32 flags;
It must be an OR of the PDFONTFLAGS_ values. All unused flags must be off.
} PDFontFlags;

Used By

_t_PDFontMetrics

Header: PDExpT.h:2391

Description

A data structure containing information about a font's metrics. For more information about font metrics see the description of Font Descriptors in the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281.

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

You also can find information about Adobe Font Metrics (AFM) at https://www.adobe.com/devnet/font.html

Syntax

struct _t_PDFontMetrics {
ASFlagBits flags;
It must be an OR of the Font Flags values. All unused flags must be off.
ASFixedRect fontBBox;
A font bounding box in 1000 EM units. An EM is a typographic unit of measurement equal to the size of a font. In a 12-point font, an EM is 12 points.
PDiFontMetric missingWidth;
The width of the missing character (.notdef)
The vertical stem width.
The horizontal stem width.
PDiFontMetric capHeight;
The capital height.
PDiFontMetric xHeight;
The X height.
PDiFontMetric ascent;
The maximum ascender height.
PDiFontMetric descent;
The maximum descender depth.
PDiFontMetric leading;
The additional leading between lines.
PDiFontMetric maxWidth;
The maximum character width.
PDiFontMetric avgWidth;
The average character width.
PDFontAngle italicAngle;
The italic angle in degrees, if any.
PDFontStyles style;
The PANOSE and sFamily class values.
PDFontOffset baseLineAdj;
The baseline adjustment, which is a vertical adjustment for font baseline difference and writing mode 1 (vertical). This should only be used for CIDFontType 2 fonts with font substitution.
} PDFontMetrics, *PDFontMetricsP;

Used By

_t_PDFontStyles

Header: PDExpT.h:2344

Description

A data structure containing PANOSE and sFamily class values for a font. It is used in the PDFontMetrics structure. See the description of Panose in "Font Descriptors for CIDFonts" ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.8.3, page 285.

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

Syntax

struct _t_PDFontStyles {
ASUns8 sFamilyClassID;
A number that identifies the font family and determines the meaning of the remaining PANOSE digits. The possible families are Latin, Kanji, Hebrew, and so forth.
ASUns8 sFamilySubclassID;
A number to identify the kind of family: text, decorative, handwritten, symbols, and so on.
ASUns8 bFamilyType;
A number to identify the family type: text, decorative, handwritten, symbols, and so on.
ASUns8 bSerifStyle;
A number that specifies the font's serif style, such as cove, obtuse cove, square, bone, and so forth.
ASUns8 bWeight;
A number that specifies the font's weight, such as very light, heavy, black, and so on.
ASUns8 bProportion;
A number that specifies the font's proportions, such as modern, expanded, condensed, mono-spaced, and so on.
} PDFontStyles;

Used In

PDFont Functions

PDCharProcEnumWithParams

Header: PDProcs.h:10616

Description

Enumerates the graphic description of a single character procedure for a Type 3 font, for those contents that are visible in a given optional-content context. The parameters include both the monitor and data you would pass to PDCharProcEnum(), and an optional-content context that determines which contents are visible.

Syntax

void PDCharProcEnumWithParams(PDCharProc obj, PDGraphicEnumParams params);

Parameters

obj
The character procedure whose graphic descriptions are enumerated.
params
The parameters, including the optional-content context to use for content visibility.

Exceptions

PDFontAcquireEncodingArray

Header: PDProcs.h:2803

Description

Acquires a font's encoding array (the mapping of character codes to glyphs). When you are done with this array, call PDFontEncodingArrayRelease() to release it.

The array contains 256 pointers. If a pointer is not NULL, it points to a C string containing the name of the glyph for the code point corresponding to the index. If it is NULL, then the name of the glyph is unchanged from that specified by the font's built-in encoding.

For a Type 3 font, all glyph names will be present in the encoding array, and NULL entries correspond to un-encoded code points.

For non-Roman character set viewers, it is not appropriate to call this method.

Syntax

ASUns8 **PDFontAcquireEncodingArray(PDFont font);

Parameters

font
The font whose encoding array is obtained.

Returns

The font's encoding array. It returns NULL if there is no encoding array associated with the font.

PDFontAcquireEncodingArrayFull

Header: PDProcs.h:12925

Description

This function fills in the base encoding, differences, and standard encoding for a font. Acquires a font's encoding array (the mapping of character codes to glyphs). When you are done with this array, call PDFontEncodingArrayRelease() to release it.

The array contains 256 pointers. If a pointer is not NULL, it points to a C string containing the name of the glyph for the code point corresponding to the index. If it is NULL, then the name of the glyph is unchanged from that specified by the font's built-in encoding.

For a Type 3 font, all glyph names will be present in the encoding array, and NULL entries correspond to un-encoded code points.

For non-Roman character set viewers, it is not appropriate to call this method.

Syntax

ASUns8 **PDFontAcquireEncodingArrayFull(PDFont font);

Parameters

font
The font whose encoding array is obtained.

Returns

The font's encoding array. It returns NULL if there is no encoding array associated with the font.

PDFontAcquireXlateTable

Header: PDProcs.h:2999

Description

Increments the specified font's XlateTable reference count and also returns the XlateTable, which is a 256-entry table that maps characters from their encoding in the PDF file to host encoding. If a character cannot be mapped to host encoding, then the table entry will (for that character) contain-1. When you are done using the XlateTable, call PDFontXlateTableRelease() to release it.

For non-Roman character set viewers, it is not appropriate to call this method.

Syntax

ASInt16 *PDFontAcquireXlateTable(PDFont font);

Parameters

font
IN/OUT The font whose XlateTable is obtained.

Returns

A pointer to the font's XlateTable, if any. Otherwise it returns NULL.

PDFontEncodingArrayRelease

Header: PDProcs.h:2814

Description

Releases a font's encoding array (the mapping of character codes to glyphs). Call this method after you are done using an encoding array acquired using PDFontAcquireEncodingArray().

Syntax

void PDFontEncodingArrayRelease(ASUns8 **array);

Parameters

array
IN/OUT The encoding array to release.

PDFontFromCosObj

Header: PDProcs.h:7823

Description

Converts a dictionary Cos object to a font. This method does not copy the object, but is instead the logical equivalent of a type cast.

Syntax

PDFont PDFontFromCosObj(CosObj fontObj);

Parameters

fontObj
IN/OUT The dictionary Cos object for the font.

Returns

The PDFont for fontObj. It returns NULL if there is no CosDoc or PDDoc containing fontObj.

PDFontGetASTextName

Header: PDProcs.h:11165

Description

Fills in an ASText object with the font name, to be used in displaying lists or menus.

In PDF 1.5, the font name can be represented with a UTF8 byte sequence. In previous versions of Acrobat the name could also be represented by host encodings such as Shift- JIS, Big5, KSC, and so on. This routine tries to return a text object that uses the correct script, but cannot always do so.

The ASText object is owned by the caller.

Syntax

void PDFontGetASTextName(PDFont font, ASBool removePrefix, ASText nameToFill);

Parameters

font
The font whose name is obtained.
removePrefix
Whether to remove the subset prefix, if present. For example, when true, the name "ABCDEF+Myriad" is returned as "Myriad".
nameToFill
(Filled by the method) The ASText object for the font's name.

PDFontGetBBox

Header: PDProcs.h:2849

Description

Gets a Type 3 font's bounding box, which is the smallest rectangle that would enclose every character in the font if they were overlaid and painted.

Syntax

void PDFontGetBBox(PDFont font, ASFixedRect *bboxP);

Parameters

font
IN/OUT The font whose bounding box is obtained.
bboxP
IN/OUT (Filled by the method) A pointer to a rectangle specifying the font's bounding box.

PDFontGetCIDSystemInfo

Header: PDProcs.h:6348

Description

Gets an ASAtom representing Registry and Ordering for a CIDFont. This information resides in the CIDSystemInfo entry of the CIDFont dictionary, which describes a CIDFont.

PDFontGetCIDSystemInfo() takes either a Type 0 font or a descendant font (CIDType0 or CIDType2) as an argument. This information is always present for any Type 0 font; the actual registry ordering information is a part of the descendant font.

This method provides one way to identify a font's language.

The CIDSystemInfo entry uses three components to identify a character collection uniquely:

  • A registry name to identify an issuer of ordering information.
  • An ordering name to identify an ordered character collection.
  • A supplement number to indicate that the ordered character collection for a registry, ordering, and previous supplement has been changed to add new characters assigned CIDs beginning with the next available CID.

The PDFontGetCIDSystemInfo() method obtains the first two of these components.

A CIDFont is designed to contain a large number of glyph procedures. Instead of being accessed by a name, each glyph procedure is accessed by an integer known as a character identifier or CID. Instead of a font encoding, CIDFonts use a CMap with a Type 0 composite font to define the mapping from character codes to a font number and a character selector.

For more information on Type 0 fonts, CIDFonts, and CMaps, See the description of 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).

For detailed information on CIDFonts, see:

Technical Note #5092, CID-Keyed Font Technology Overview

https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5092.CID_Overview.pdf

Technical Note #5014, Adobe CMap and CIDFont Files Specification

https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf

Syntax

ASAtom PDFontGetCIDSystemInfo(PDFont font);

Parameters

font
IN/OUT The font whose Registry and Ordering information is obtained.

Returns

The ASAtom representing the CIDFont's Registry and Ordering information (for example, "Adobe-Japan1").

PDFontGetCIDSystemSupplement

Header: PDProcs.h:6402

Description

Gets the SystemSupplement number of a CIDFont. This field resides in the CIDSystemInfo entry of the CIDFont dictionary, which describes a CIDFont.

The CIDSystemInfo entry uses three components to identify a character collection uniquely:

  • A registry name to identify an issuer of orderings.
  • An ordering name to identify an ordered character collection.
  • A supplement number to indicate that the ordered character collection for a registry, ordering, and previous supplement has been changed to add new characters assigned CIDs beginning with the next available CID.

PDFontGetCIDSystemInfo() provides character collection information, and PDFontGetCIDSystemSupplement() specifies the version of the ordering.

A CIDFont is designed to contain a large number of glyph procedures. Instead of being accessed by a name, each glyph procedure is accessed by an integer known as a character identifier or CID. Instead of a font encoding, CIDFonts use a CMap with a Type 0 composite font to define the mapping from character codes to a font number and a character selector.

For more information on Type 0 fonts, CIDFonts, and CMaps, see the description of 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).

For detailed information on CIDFonts, see:

Technical Note #5092, CID-Keyed Font Technology Overview

https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5092.CID_Overview.pdf

Technical Note #5014, Adobe CMap and CIDFont Files Specification

https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf

Syntax

ASInt32 PDFontGetCIDSystemSupplement(PDFont font);

Parameters

font
IN/OUT The font whose SystemSupplement field is obtained.

Returns

The SystemSupplement field from the CIDFont.

PDFontGetCharSet

Header: PDProcs.h:2761

Description

Gets the font's character set. This is derived from the 'Uses Adobe standard encoding' bit in the font descriptor (if the font has a font descriptor) or from the font's name (if the font is one of the base 14 fonts and does not have a font descriptor).

For non-Roman character set viewers, call PDFontGetEncodingName() instead.

Related Methods

Syntax

PDCharSet PDFontGetCharSet(PDFont font);

Parameters

font
IN/OUT The font whose character set is obtained.

Returns

The font's character set. For non-Roman character set viewers, it returns PDUnknownCharSet.

PDFontGetCosObj

Header: PDProcs.h:3062

Description

Gets the Cos object for a font. This method does not copy the object, but is instead the logical equivalent of a type cast.

Related Methods

Syntax

CosObj PDFontGetCosObj(PDFont font);

Parameters

font
IN/OUT The font whose Cos object is obtained.

Returns

The dictionary Cos object for the font. The dictionary's contents may be enumerated with CosObjEnum().

PDFontGetDescendant

Header: PDProcs.h:6249

Description

Gets a Type 0 font's descendant, which may be a CIDType0 or CIDType2 font.

Type 0 fonts support single-byte or multi-byte encodings and can refer to one or more descendant fonts. These fonts are analogous to the Type 0 or composite fonts supported by Level 2 PostScript interpreters. However, PDF Type 0 fonts only support character encodings defined by a CMap. The CMap specifies the mappings between character codes and the glyphs in the descendant fonts.

For information about Type 0 fonts, see the description of 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).

For more information on CMAPS, see page 272 of the same document.

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

Syntax

PDFont PDFontGetDescendant(PDFont font);

Parameters

font
IN/OUT The font whose descendant is obtained.

Returns

The font's descendant font.

PDFontGetEncodingIndex

Header: PDProcs.h:2777

Description

Gets a font's encoding index.

For non-Roman character set viewers, call PDFontGetEncodingName() instead.

Syntax

ASInt32 PDFontGetEncodingIndex(PDFont font);

Parameters

font
IN/OUT The font whose encoding index is obtained.

Returns

A font encoding index. If the index is greater than PDLastKnownEncoding, it is a custom encoding, and is unique within the document. If the index is less than PDLastKnownEncoding, it must be one of the PDFontEncoding values.

PDFontGetEncodingName

Header: PDProcs.h:6286

Description

Gets a string representing a font's encoding.

Use PDFontGetEncodingIndex() to get encoding information for Roman viewers.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). See a list of predefined CMaps in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

In this case, the encoding string contains values such as "90ms-RKSJ-H", "90msp-RKSJ-H", "Identity-V", or "90pv-RKSJ-H"; it does not return a string like "Shift-JIS".

Syntax

const ASUns8 *PDFontGetEncodingName(PDFont font);

Parameters

font
The font whose encoding name is obtained.

Returns

The string representing the font's encoding.

PDFontGetMetrics

Header: PDProcs.h:2838

Description

Gets a font's metrics, which provide the information needed to create a substitute Multiple Master font when the original font is unavailable. See the description of Font Descriptors in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281.

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

Syntax

void PDFontGetMetrics(PDFont font, PDFontMetricsP metricsP, ASSize_t sizeMetrics);

Parameters

font
IN/OUT The font whose metrics are being obtained.
metricsP
IN/OUT (Filled by the method) A pointer to a PDFontMetrics structure containing the font's metrics. The font metric values may be patched before being returned. If the actual values in the PDF file are required, use Cos instead to get trustworthy metrics.
sizeMetrics
IN/OUT It must be sizeof(PDFontMetrics).

PDFontGetName

Header: PDProcs.h:2733

Description

Gets the name of a font. The behavior depends on the font type; for a Type 3 font it gets the value of the Name key in a PDF Font resource. See the description of font types in "Introduction to Font Data Structures" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.5, page 253.

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

For other types it gets the value of the BaseFont key in a PDF font resource.

Syntax

ASInt32 PDFontGetName(PDFont font, char *buffer, ASInt32 bufSize);

Parameters

font
IN/OUT The font whose name is obtained.
buffer
IN/OUT (Filled by the method) The buffer into which the font's name is stored. The client may pass in NULL to obtain the buffer size, excluding the terminating NULL, and then call the method with a buffer of the appropriate size. You must pass at least the bufSize + 1 as the buffer size
bufSize
IN/OUT The length of buffer in bytes. The maximum font name length that the Acrobat viewer will return is PSNAMESIZE (see PDExpT. h).

Returns

The number of characters in the font name. If the font name is too long to fit into buffer, bufSize- 1 bytes are copied into buffer, and buffer is NULL-terminated.

PDFontGetSubtype

Header: PDProcs.h:2744

Description

Gets a font's subtype.

Related Methods

Syntax

ASAtom PDFontGetSubtype(PDFont font);

Parameters

font
IN/OUT The font whose subtype is obtained.

Returns

The font's subtype. The ASAtom returned can be converted to a string using ASAtomGetString(). It must be one of the Font Subtypes.

PDFontGetWidths

Header: PDProcs.h:2875

Description

Gets the advance width of every glyph in a font. The advance width is the amount by which the current point advances when the glyph is drawn. The advance width may not correspond to the visible width of the glyph (for example, a glyph representing an accent mark might have an advance width of zero so that characters can be drawn under it). For this reason, the advance width cannot be used to determine the glyphs' bounding boxes.

For non-Roman character set viewers, this method gets the width for a single byte range ( 0 through 255).

Syntax

void PDFontGetWidths(PDFont font, ASInt16 *widths);

Parameters

font
IN/OUT The font whose glyph advance widths are obtained.
widths
IN/OUT (Filled by the method) An array of glyph advance widths, measured in character space units. Un-encoded code points will have a width of zero. For non-Roman character set viewers, an array for a single byte range ( 0 through 255).

PDFontIsEmbedded

Header: PDProcs.h:2927

Description

Tests whether the specified font is embedded in the PDF file, meaning that the font is stored as a font file, which is a stream embedded in the PDF file. Only Type 1 and TrueType fonts can be embedded.

Related Methods

Syntax

ASBool PDFontIsEmbedded(PDFont font);

Parameters

font
The font to test.

Returns

true if the font is embedded in the file, false otherwise.

PDFontSetMetrics

Header: PDProcs.h:3049

Description

Sets a font's metrics, which provide the information needed to create a substitute Multiple Master font when the original font is unavailable. See the description of Font Descriptors in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281.

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

This method can only be used on Type 1, Multiple Master Type 1, and TrueType fonts; it cannot be used on Type 3 fonts.

Related Methods

Syntax

void PDFontSetMetrics(PDFont font, PDFontMetricsP metricsP, ASSize_t sizeMetrics);

Parameters

font
IN/OUT The font whose metrics are being set.
metricsP
IN/OUT A pointer to a PDFontMetrics structure containing the font's metrics.
sizeMetrics
IN/OUT It must be sizeof(PDFontMetrics).

PDFontXlateString

Header: PDProcs.h:2978

Description

Translates a string from the PDFont's encoding into host encoding. If any characters cannot be represented in host encoding, they are replaced with space characters. If no XlateTable exists in the font, the function returns false and outP is not written.

For non-Roman character set viewers, it is not appropriate to call this method. Instead call one of the following: PDFontXlateToHost(), PDFontXlateToUCS(), PDXlateToHostEx(), or PDXlateToPDFDocEncEx().

Syntax

ASBool PDFontXlateString(PDFont font, ASUns8 *inP, ASUns8 *outP, ASInt32 len);

Parameters

font
The font (and hence, the encoding) that inP uses.
inP
The string to translate.
outP
(Filled by the method) The translated string. outP may point to the same buffer as inP, to allow in-place translation.
len
The length of inP and outP.

Returns

true if an XlateTable exists in the font, false otherwise. If no XlateTable exists in the font, outP is not written.

PDFontXlateTableRelease

Header: PDProcs.h:3013

Description

Decrements the specified font's XlateTable reference count. The XlateTable is a 256-entry table that maps characters from their encoding in the PDF file to host encoding. If a character cannot be mapped to host encoding, then the table entry will (for that character) contain-1.

Syntax

void PDFontXlateTableRelease(ASInt16 *table);

Parameters

table
IN/OUT The XlateTable to release.

PDFontXlateToHost

Header: PDProcs.h:6699

Description

Translates a string from the PDFont's encoding to host encoding. This is useful for converting the text from a PDWord into host encoding. In the same way that PDXlateToHostEx() converts text from bookmark titles to host encoding, PDFontXlateToHost() converts text from a page contents stream to host encoding. Use PDFontXlateToUCS() to translate from the PDFont's encoding to Unicode.

Non-Roman fonts, such as PostScript composite fonts, can be encoded in different ways, such as SHIFT-JIS, RKSJ, and so on. To use PDFontXlateToHost(), the caller does not need to know which encoding he is converting from, since that information is contained in the PDFont.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

Use PDGetHostEncoding() to determine if a system's host encoding is Roman.

Syntax

ASInt32 PDFontXlateToHost(PDFont fontP, ASUns8 *inP, ASInt32 inLen, ASUns8 *outP, ASInt32 outLen);

Parameters

fontP
The font used in the input string inP.
inP
A pointer to the string to translate.
inLen
The length of the inP buffer in bytes.
outP
(Filled by the method) A pointer to the translated string.
outLen
The length of the outP buffer in bytes.

Returns

The number of bytes in the translated string outP.

PDFontXlateToUCS

Header: PDProcs.h:6751

Description

Translates a string from whatever encoding the PDFont uses to Unicode encoding. This is useful for converting the text from a PDWord into Unicode. Use PDFontXlateToHost() to translate from the PDFont's encoding to host encoding.

Non-Roman fonts, like PostScript composite fonts, can be encoded in different ways, such as SHIFT-JIS, RKSJ, and so on. The caller does not need to know which encoding they're converting from, since that information is contained in the PDFont.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

Use PDGetHostEncoding() to determine if a system's host encoding is Roman.

Syntax

ASInt32 PDFontXlateToUCS(PDFont fontP, ASUns8 *inP, ASInt32 inLen, ASUns8 *outP, ASInt32 outLen);

Parameters

fontP
The font of the input string inP.
inP
A pointer to the string to translate.
inLen
The length of the inP buffer in bytes.
outP
(Filled by the method) A pointer to the translated string. If it is NULL, the method returns the size of the translated string.
outLen
The length of the outP buffer in bytes. If it is 0, the method returns the size of the translated string.

Returns

The number of bytes in the translated string in outP.

PDFontXlateWidths

Header: PDProcs.h:2948

Description

Translates an array of 256 glyph advance widths (obtained from PDFontGetWidths()) from their order in the PDF file into host encoding order. If the widths are already in host encoding order, the widths are merely copied. All un-encoded code points are given a width of zero.

For non-Roman character set viewers, it is not appropriate to call this method.

Related Methods

Syntax

void PDFontXlateWidths(PDFont font, ASInt16 *inP, ASInt16 *outP);

Parameters

font
IN/OUT The font whose glyph widths are translated.
inP
IN/OUT The array of glyph advance widths to rearrange.
outP
IN/OUT (Filled by the method) The rearranged array of glyph advance widths.

PDGetHostEncoding

Header: PDProcs.h:6575

Description

Indicates what kind of host encoding a system uses. It allows you to determine whether a system is Roman or non-Roman. (Non-Roman is also known as CJK-capable, which means that it is capable of handling multi-byte character sets such as Chinese, Japanese, or Korean).

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

Use PDGetHostEncoding() to determine if a system's host encoding is Roman.

Related Methods

Syntax

ASHostEncoding PDGetHostEncoding(void);

Returns

0 for a Roman system, nonzero for a non-Roman system (a structure that depends on the host encoding). Users should simply test whether this value is 0.

PDGetPDFDocEncoding

Header: PDProcs.h:2914

Description

Gets an array describing the differences between the platform's host encoding and PDFDocEncoding.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

Use PDGetHostEncoding() to determine whether a system's host encoding is Roman.

Related Methods

Syntax

ASUns8 **PDGetPDFDocEncoding(void);

Returns

An array containing 256 elements. Each element corresponds to a code point in the PDFDocEncoding, and is either NULL or a pointer to a string.

If the element is NULL, the code point refers to the same glyph in both host encoding and PDFDocEncoding. If the element is non- NULL, it points to a string containing the glyph name for the code point.

PDHostMBLen

Header: PDProcs.h:6538

Description

Gets the number of additional bytes required for the multi-byte character pointed to by cp. If cp points to a single-byte character, 0 is returned. This method makes it possible to determine the length of multi-byte character strings to allocate space for them.

This function is similar to the ANSI-C code:

mblen(cp, MB_LEN_MAX)- 1

or the Windows function:

IsDBCSLeadByte(cp)

Syntax

ASInt32 PDHostMBLen(const char *cp);

Parameters

cp
The character to examine.

Returns

The number of bytes in the multi-byte character.

PDXlateToASText

Header: PDProcs.h:11791

Description

Returns an ASText object corresponding to a host encoded string.

Syntax

void PDXlateToASText(const char *inHostString, ASInt32 inHostStringSize, ASText outPDFString);

Parameters

inHostString
A pointer to the string to translate (it may point to the same memory as outPDFString, allowing strings to translate in place).
inHostStringSize
The number of bytes in the string to translate.
outPDFString
(Filled by the method) The text object corresponding to inHostStringSize. The client must pass a valid ASText object title. The routine does not allocate it.

Returns

The number of bytes in the translated string outPDFString.

PDXlateToHost

Header: PDProcs.h:2702

Description

Translates a string from PDFDocEncoding to host encoding. This method is useful when setting or retrieving displayed text that must be in PDFDocEncoding (or Unicode), such as text that appears in a text annotation or bookmark.

A character that cannot be converted to the destination encoding is replaced with a space.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is MacRomanEncoding on Mac OS and WinAnsiEncoding on Windows. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

Use PDGetHostEncoding() to determine if a system's host encoding is Roman. For non-Roman systems, use PDXlateToHostEx().

In general, PDXlateToHostEx() can be called instead of PDXlateToHost() since PDXlateToHostEx() works for any host encoding.

Syntax

void PDXlateToHost(char *in, char *out, ASInt32 numBytes);

Parameters

in
The string to translate (it may point to the same memory as out, allowing strings to translate in place).
out
(Filled by the method) The translated string (it may point to the same memory as in).
numBytes
The number of bytes in the string to translate.

PDXlateToHostASText

Header: PDProcs.h:11769

Description

Returns a host encoded string corresponding to an ASText object.

Syntax

ASInt32 PDXlateToHostASText(const ASText inPdfString, char *outHostString, ASInt32 outHostStringSize);

Parameters

inPdfString
The text object.
outHostString
(Filled by the method) A pointer to the translated string.
outHostStringSize
The length of the outHostString buffer, in bytes.

Returns

The number of bytes in the translated string outHostString.

PDXlateToHostEx

Header: PDProcs.h:6456

Description

Translates a string from Unicode or PDFDocEncoding to host encoding. This method is useful when setting or retrieving displayed text that might be in Unicode, such as text that appears in a text annotation or bookmark.

A character that cannot be converted to the destination encoding is replaced with a space.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1:PDF 1.7, section 9.7.5, page 272.

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

For non-Roman systems, use PDXlatetoHostEx(). Use PDGetHostEncoding() to determine whether the host encoding for a system is Roman.

In general, PDXlatetoHostEx() operates in the same way as PDXlateToHost() but requires an extra argument, since the sizes of the input and translated strings may differ. This method can be called instead of PDXlateToHost(), and must be called for multi-byte character set systems.

Syntax

ASInt32 PDXlateToHostEx(const char *inPdfStr, ASInt32 inPdfStrSize, char *outHostStr, ASInt32 outHostStrSize);

Parameters

inPdfStr
IN/OUT A pointer to the string to translate (it may point to the same memory as outHostStr, allowing strings to translate in place).
inPdfStrSize
IN/OUT The length of inPdfStr in bytes.
outHostStr
IN/OUT (Filled by the method) A pointer to the translated string (it may point to the same memory as inPdfStr).
outHostStrSize
IN/OUT The length of the outHostStr buffer in bytes.

Returns

The number of bytes in the translated string outHostStr.

PDXlateToPDFDocEnc

Header: PDProcs.h:2653

Description

Translates a string from host encoding to PDFDocEncoding. This method is useful when setting or retrieving displayed text that must be in PDFDocEncoding (or Unicode), such as text that appears in a text annotation or bookmark.

A character that cannot be converted to the destination encoding is replaced with a space. For example, PDXlateToPDFDocEnc() converts '\\n' to a space character ( '\\r' is present in PDFDocEncoding and is left unchanged).

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

Use PDGetHostEncoding() to determine if a system's host encoding is Roman. For non-Roman systems, use PDXlateToPDFDocEncEx().

In general, PDXlateToPDFDocEncEx() can be called instead of PDXlateToPDFDocEnc(), since PDXlateToPDFDocEncEx() works for PDFDocEncoding or Unicode.

Syntax

void PDXlateToPDFDocEnc(char *in, char *out, ASInt32 numBytes);

Parameters

in
The string to translate (it may point to the same memory as out, allowing strings to translate in place).
out
(Filled by the method) The translated string (it may point to the same memory as in).
numBytes
The number of bytes in the string to translate.

PDXlateToPDFDocEncEx

Header: PDProcs.h:6516

Description

Translates a string from host encoding to PDFDocEncoding or Unicode. This method is useful when using text that must be in PDFDocEncoding or Unicode, such as text in a text annotation, bookmark, or article title.

A character that cannot be converted to the destination encoding is replaced with a space. For example, PDXlateToPDFDocEncEx() converts '\\n' to a space character ( '\\r' is present in PDFDocEncoding and is left unchanged).

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

For descriptions of WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

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

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.

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

For non-Roman systems, use PDXlateToPDFDocEncEx(). You can use PDGetHostEncoding() to determine whether a system's host encoding is Roman.

In general, PDXlateToPDFDocEncEx() can be called instead of PDXlateToPDFDocEnc() since PDXlateToPDFDocEncEx() works for PDFDocEncoding or Unicode.

Syntax

ASInt32 PDXlateToPDFDocEncEx(ASBool bUseUnicode, const char *inHostStr, ASInt32 inHostStrSize, char *outPDFStr, ASInt32 outPDFStrSize);

Parameters

bUseUnicode
If true, translate the string to Unicode; otherwise use PDFDocEncoding.
inHostStr
A pointer to the string to translate (it may point to the same memory as outPDFStr, allowing strings to translate in place).
inHostStrSize
The number of bytes in the string to translate.
outPDFStr
(Filled by the method) A pointer to the translated string (it may point to the same memory as inHostStr).
outPDFStrSize
The length of the outPDFStr buffer, in bytes.

Returns

The number of bytes in the translated string outPDFStr.