LayerPDFEdit_Layer
ObjectPDEFont

A PDEFont object is a reference to a font used on a page. It may be equated with a font in the system. A PDEFont is not the same as a PDFont; a PDEFont is associated with a particular document.

See Chapter 5 in the PDF Reference for information on fonts.

A PDSysFont object represents a system font and is a distinct object from a PDEFont. You can create a PDEFont from a system font with the PDEFontCreateFromSysFont() method.

Your plug-in can set the font of a text run with the PDETextRunSetFont() method.



Define Summary
 Define
 kPDEFontNoEditableEmbedding
Flags for protection of PDEFontAttrs: editable embedding is not allowed.
 kPDEFontNoEmbedding
Flags for protection of PDEFontAttrs: embedding is not allowed.
Typedef Summary
 Typedef
 PDEFont
 PDEFontAttrs
 PDEFontAttrsP
 PDEFontCreateFromSysFontParams
 PDEFontCreateFromSysFontParamsRec
 PDEFontCreateParams
 PDEFontCreateParamsRec
 PDEFontInfoP
 PDEFontInfoRec
Enumeration Summary
 Enumeration
  PDEFontCreateFlags
Flags for PDEFontCreateFromSysFont() . If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.
  PDEFontCreateNeedFlags
Flags for PDEFontGetCreateNeedFlags().
Structure Summary
 Structure
 _t_PDEFontAttrs
Attributes of a PDEFont and of a PDSysFont. This structure is also referenced in PDEFontCreateParams().
 _t_PDEFontCreateFromSysFontParams
A data structure used with PDEFont creation.
 _t_PDEFontCreateParams
Parameters used for PDEFontCreateWithParams() to describe a font.
 _t_PDEFontInfo
PDEFont information.
Method Summary
 Method
 
PDESpanSetP PDEFontAddGlyphs(IN PDEFont pdeFont, INPDEGlyphRunP glyphRun, INASUns32 flags)
Adds glyphs to a PDEFont object for embedding a PDEFont.
 
PDEFont PDEFontCreate(INPDEFontAttrsP attrsP, INASUns32 attrsSize, INASInt32 firstChar, INASInt32 lastChar, INASInt16* widthsP, IN char** encoding, INASAtom encodingBaseName, INASStm fontStm, INASInt32 len1, INASInt32 len2, INASInt32 len3)
Creates a new PDEFont from the specified parameters.
 
PDEFont PDEFontCreateFromCosObj(const CosObj* cosObjP)
Creates a PDEFont corresponding to a Cos object of type Font.
 
PDEFont PDEFontCreateFromSysFont(INPDSysFont sysFont, INASUns32 flags)
Gets a PDEFont corresponding to a font in the system.
 
PDEFont PDEFontCreateFromSysFontAndEncoding(INPDSysFont sysFont, INPDSysEncoding sysEnc, INASAtom useThisBaseFont, INASUns32 createFlags)
Create a PDEFont from sysFont and sysEnc. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense.
 
PDEFont PDEFontCreateFromSysFontAndEncodingInCosDoc(INPDSysFont sysFont, INPDSysEncoding sysEnc, INASAtom useThisBaseFont, INASUns32 createFlags, INCosDoc cosDoc)
Creates a font object like PDEFontCreateFromSysFontAndEncoding(), except that the client can specify the CosDoc in which the font is created. Create a PDEFont from sysFont and sysEnc. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense.
 
PDEFont PDEFontCreateFromSysFontEx(INPDSysFont sysFont, INASUns32 flags, INASAtom snapshotName, INASFixed* mmDesignVec)
Creates a PDEFont corresponding to a font in the system.
 
PDEFont PDEFontCreateFromSysFontExInCosDoc(INPDSysFont sysFont, INASUns32 flags, INASAtom snapshotName, INASFixed* mmDesignVec, INCosDoc cosDoc)
Creates a font object like PDEFontCreateFromSysFontEx(), except that the client can specify the CosDoc in which the font is created.
 
PDEFont PDEFontCreateFromSysFontInCosDoc(INPDSysFont sysFont, INASUns32 flags, INCosDoc cosDoc)
Creates a font object like PDEFontCreateFromSysFont(), except that the client can specify the CosDoc in which the font is created.
 
Used to obtain a PDEFont corresponding to a font in the system.
 
PDEFont PDEFontCreateInCosDoc(INPDEFontAttrsP attrsP, INASUns32 attrsSize, INASInt32 firstChar, INASInt32 lastChar, INASInt16* widthsP, IN char** encoding, INASAtom encodingBaseName, INASStm fontStm, INASInt32 len1, INASInt32 len2, INASInt32 len3, INCosDoc cosDoc)
Creates a font object like PDEFontCreate(), except that the client can specify the CosDoc in which the font is created.
 
void PDEFontCreateToUnicodeNow(IN PDEFont font, INCosDoc cosDoc)
This function creates the / ToUnicode table. The user can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateToUnicodeNow() is needed.
 
void PDEFontCreateWidthsNow(IN PDEFont font, INCosDoc cosDoc)
This function creates width entries for font. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateWidthsNow() is needed.
 
Creates a new PDEFont from params.
 
Creates a font object like PDEFontCreateWithParams(), except that the client can specify the CosDoc in which the font is created. Creates a new PDEFont from params.
 
void PDEFontEmbedNow(IN PDEFont font, INCosDoc cosDoc)
This function embeds a font stream. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontEmbedNow() is needed.
 
void PDEFontEmbedNowDontSubset(IN PDEFont font, INCosDoc cosDoc)
Embeds the given PDEFont inside doc without creating a subset. Use this method instead of PDEFontSubsetNow() if you created the font with the willSubset flag but changed your mind.
 
void PDEFontGetAttrs(IN PDEFont font, OUTPDEFontAttrsP attrsP, INASUns32 attrsSize)
Gets the attributes for a font object.
 
void PDEFontGetCosObj(IN PDEFont font, OUTCosObj* cosObjP)
Gets a Cos object for a PDEFont.
 
ASUns32 PDEFontGetCreateNeedFlags(IN PDEFont font)
This function returns flags indicating what needs to be done to make PDEFont complete. kPDEFontCreateNeedWidths can be cleared by PDEFontCreateWidthsNow(). kPDEFontCreateNeedToUnicode can be cleared by PDEFontCreateToUnicodeNow(). kPDEFontCreateNeedEmbed can be cleared by PDEFontEmbedNow().
 
ASInt16 PDEFontGetNumCodeBytes(IN PDEFont font, INASUns8* text, INASInt32 len)
Gets the number of bytes comprising the next code in a string of single or multi-byte character codes.
 
ASBool PDEFontGetOneByteEncoding(IN PDEFont font, OUTASAtom* encodingDelta)
Gets an array of delta encodings for the given one byte PDEFont.
 
PDSysEncoding PDEFontGetSysEncoding(IN PDEFont pdeFont)
Gets the system encoding object associated with a font object.
 
PDSysFont PDEFontGetSysFont(IN PDEFont pdeFont)
Gets the system font object associated with a font object.
 
void PDEFontGetWidths(IN PDEFont font, OUTASInt16* widthsP)
Gets the widths for a font object.
 
void PDEFontGetWidthsNow(IN PDEFont font, INCosDoc cosDoc)
Gets a Type0 font's width information for only those characters used in the file. Call this routine when the font was created with the kPDEFontDeferWidths flag but without the kPDEFontCreateEmbedded flag (if the font is to be embedded, call PDEFontSubsetNow(), which also gets the width info).
 
ASBool PDEFontIsEmbedded(IN PDEFont pdeFont)
Tests whether a font is an embedded font in the document in which it was created.
 
ASBool PDEFontIsMultiByte(IN PDEFont font)
Tests whether a font contains any multi-byte characters.
 
void PDEFontSetSysEncoding(IN PDEFont pdeFont, INPDSysEncoding sysEnc)
Sets the system encoding object associated with a font object.
 
void PDEFontSetSysFont(IN PDEFont pdeFont, INPDSysFont sysFont)
Sets the system font object to be used with a font object that does not currently have a system font associated with it.
 
void PDEFontSubsetNow(IN PDEFont font, INCosDoc cosDoc)
Subsets a given PDEFont in a CosDoc.
 
ASInt32 PDEFontSumWidths(IN PDEFont font, INASUns8* text, INASInt32 len)
Gets the sum of the widths of len characters from a string of single or multi-byte characters.
 
ASUns32 PDEFontTranslateGlyphIdsToUnicode(IN PDEFont font, INASUns8* text, INASUns32 textLen, OUTASUns8* unicodeStr, INASUns32 size)
Translates a string to Unicode values. The PDEFont must have a / ToUnicode table.
Defines Detail
kPDEFontNoEditableEmbedding 
Product availability: All
Platform availability: All

Syntax

#define kPDEFontNoEditableEmbedding 0x00000002

Description

Flags for protection of PDEFontAttrs: editable embedding is not allowed.


File: PEExpT.h
Line: 1798
kPDEFontNoEmbedding 
Product availability: All
Platform availability: All

Syntax

#define kPDEFontNoEmbedding 0x00000001

Description

Flags for protection of PDEFontAttrs: embedding is not allowed.


File: PEExpT.h
Line: 1795

Typedefs Detail
PDEFont 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef struct _t_PDEFont* PDEFont;

File: PDExpT.h
Line: 6436
PDEFontAttrs 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontAttrs PDEFontAttrs;

File: PEExpT.h
Line: 1004
PDEFontAttrsP 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontAttrs PDEFontAttrsP;

File: PEExpT.h
Line: 1004
PDEFontCreateFromSysFontParams 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontCreateFromSysFontParams PDEFontCreateFromSysFontParams;

File: PEExpT.h
Line: 1210
PDEFontCreateFromSysFontParamsRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontCreateFromSysFontParams PDEFontCreateFromSysFontParamsRec;

File: PEExpT.h
Line: 1210
PDEFontCreateParams 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontCreateParams PDEFontCreateParams;

File: PEExpT.h
Line: 1171
PDEFontCreateParamsRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontCreateParams PDEFontCreateParamsRec;

File: PEExpT.h
Line: 1171
PDEFontInfoP 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontInfo PDEFontInfoP;

File: PDSysFontExpT.h
Line: 111
PDEFontInfoRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDEFontInfo PDEFontInfoRec;

File: PDSysFontExpT.h
Line: 111

Enumeration Detail
PDEFontCreateFlags
Product availability: All
Platform availability: All

Syntax

enum PDEFontCreateFlags {
 kPDEFontCreateEmbedded = 0x0001,
 
 kPDEFontWillSubset = 0x0002,
 
 kPDEFontDoNotEmbed = 0x0004,
 
 kPDEFontEncodeByGID = 0x0008,
 
 kPDEFontDeferWidths = 0x0010,
 
 kPDEFontCreateSubset = kPDEFontWillSubset,
 
 kPDEFontCreateGIDOverride = 0x0020,
 
 kPDEFontCreateToUnicode = 0x0040,
 
 kPDEFontCreateAllWidths = 0x0080,
 
 kPDEFontCreateEmbedOpenType = 0x0100,
 
 kPDEFontCreateReserved1 = 0x0200
}

See Also


File: PEExpT.h
Line: 1737

Elements
kPDEFontCreateEmbedded  

Embed the font. Create an embedded font. By itself, this will not subset the font.

 
kPDEFontWillSubset  

Subset the font. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags. You must call PDEFontSubsetNow() to actually subset the font. Both embedding and subsetting a font creates a CFF font.

 
kPDEFontDoNotEmbed  

Do not embed the font. You cannot set both this and the kPDEFontWillSubset flags. Nor can you set kPDEFontCreateEmbedded.

 
kPDEFontEncodeByGID  

Create a CIDFont with identity (GID) encoding.

 
kPDEFontDeferWidths  

Wait to get the widths until later (this affects Type0 fonts only).

 
kPDEFontCreateGIDOverride  

PDFLib will convert cp to gid with identity embedded.

 
kPDEFontCreateToUnicode  

Create a ToUnicode CMap.

 
kPDEFontCreateAllWidths  

Supply the entire widths table (this affects Type0 fonts only).

 
kPDEFontCreateEmbedOpenType  

Embed an OpenType style font subset, if appropriate.

 
kPDEFontCreateReserved1  

Reserved for internal usage

PDEFontCreateNeedFlags 
Product availability: All
Platform availability: All

Syntax

enum PDEFontCreateNeedFlags {
 kPDEFontCreateNeedWidths = 0x00010000,
 
 kPDEFontCreateNeedToUnicode = 0x00020000,
 
 kPDEFontCreateNeedEmbed = 0x00040000
}

File: PEExpT.h
Line: 1781

Elements
kPDEFontCreateNeedWidths  

It is necessary to to create the width.

 
kPDEFontCreateNeedToUnicode  

It is necessary to to create the ToUnicode stream.

 
kPDEFontCreateNeedEmbed  

It is necessary to to embed it.


Structure Detail
_t_PDEFontAttrs
Product availability: All
Platform availability: All

Syntax

struct _t_PDEFontAttrs {
 ASAtom name; 
 
 ASAtom type; 
 
 ASAtom charSet; 
 
 ASAtom encoding; 
 
 ASUns32 flags; 
 
 ASFixedRect fontBBox; 
 
 ASInt16 missingWidth; 
 
 ASInt16 stemV; 
 
 ASInt16 stemH; 
 
 ASInt16 capHeight; 
 
 ASInt16 xHeight; 
 
 ASInt16 ascent; 
 
 ASInt16 descent; 
 
 ASInt16 leading; 
 
 ASInt16 maxWidth; 
 
 ASInt16 avgWidth; 
 
 ASInt16 italicAngle; 
 
 ASAtom cidFontType; 
 
 ASInt16 wMode; 
 
 ASAtom psName; 
 
 ASAtom platformName; 
 
 ASAtom lang; 
 
 ASAtom registry; 
 
 ASAtom ordering; 
 
 ASInt32 supplement; 
 
 ASInt32 cantEmbed; 
 
 ASAtom deltaEncoding; 
 
 ASUns32 protection; 
 
 ASInt32 packageType; 
}

Attributes of a PDEFont and of a PDSysFont. This structure is also referenced in PDEFontCreateParams().

See Also


File: PEExpT.h
Line: 878

Elements
name  

An ASAtom for font name (for example, "Times-Roman"). It corresponds to the BaseFont key in the font dictionary of a PDF file (see Section 5.6.3 in the PDF Reference).

 
type  

An ASAtom for the font type corresponding to the Subtype key in a a font dictionary. It may be:

  • "Type1"

  • "TrueType"

  • "MMType1"

  • "Type0"

 
charSet  

An ASAtom for "Roman", or ASAtomNull. If it is "Roman", the characters must be a subset of the Adobe Standard Roman Character Set.

 
encoding  

An ASAtom for font encoding. It may be MacRomanEncoding, WinAnsiEncoding, or ASAtomNull. In the case of ASAtomNull, call PDSysFontGetEncoding() to get more information about the encoding.

 
flags  

The desired font flags; one or more of the Font Flags.

 
fontBBox  

The font bounding box in 1000 EM units.

 
missingWidth  

The width of the missing character (.notdef).

 
stemV  

The vertical stem width.

 
stemH  

The horizontal stem width.

 
capHeight  

The capital height.

 
xHeight  

The x height.

 
ascent  

The maximum ascender height.

 
descent  

The maximum descender depth.

 
leading  

The additional leading between lines.

 
maxWidth  

The maximum character width.

 
avgWidth  

The average character width.

 
italicAngle  

The italic angle in degrees, if any.

 
cidFontType  

CIDFontType0 or CIDFontType2.

 
wMode  

The writing mode. It must be one of:

Value

Description

0

For horizontal writing.

1

For vertical writing.

 
psName  

An ASAtom representing the PostScript name of a TrueType font.

 
platformName  

The platform name.

 
lang  

An ASAtom representing the ISO 639 language code. These are available from

 
registry  

An ASAtom representing the CIDFont's Registry information (for example, "gAdobe-Japan".

 
ordering  

An ASAtom representing the CIDFont's Ordering information (for example, "g1").

 
supplement  

The SystemSupplement field from the CIDFont.

 
cantEmbed  

A non-zero value means the font can't be embedded.

 
deltaEncoding  

The name of the base encoding; that is, the BaseEncoding entry in an encoding dictionary (see section 5.5.5 of the PDF Reference). The Differences entry of the encoding dictionary describes differences (deltas) from the base encoding.

 
protection  

Allows one of the following bits to be set in order to disable font embedding:

Bit

Description

kPDEFontNoEmbedding = 1

The font should not be embedded.

kPDEFontNoEditableEmbedding = 2

The font should not be embedded for editing purposes.

 
packageType  

PDSysFontPackageType

_t_PDEFontCreateFromSysFontParams 
Product availability: All
Platform availability: All

Syntax

struct _t_PDEFontCreateFromSysFontParams {
 ASUns32 structSize; 
 
 ASUns32 flags; 
 
 ASAtom snapshotName; 
 
 ASFixed mmDesignVec; 
 
 long ctCodePage; 
 
 ASAtom encoding; 
 
 CosDoc cosDoc; 
}

A data structure used with PDEFont creation.

See Also


File: PEExpT.h
Line: 1178

Elements
structSize  

The size of the data structure. It must be set to sizeof(PDEFontCreateFromSysFontParamsRec).

 
flags  

A bit mask of the PDEFontCreateFlags.

 
snapshotName  

The name of a Multiple Master snapshot. See the PDF Reference for more information on snapshots.

 
mmDesignVec  

A pointer to the Multiple Master font design vector.

 
ctCodePage  

Used to select a specific code page supported by the font. When a non-zero code page is supplied, embedding must be turned on and the kPDEFontEncodeByGID flag must be set.

 
encoding  

Used to specify which encoding to use with a CID font. Pass ASAtomNull to use the platform default.

 
cosDoc  

Used to specify the CosDoc in which to create the font. Pass NULL to use the scratch doc.

_t_PDEFontCreateParams 
Product availability: All
Platform availability: All

Syntax

struct _t_PDEFontCreateParams {
 PDEFontAttrsP attrsP; 
 
 ASUns32 attrsSize; 
 
 ASInt32 firstChar; 
 
 ASInt32 lastChar; 
 
 ASInt16 widthsP; 
 
 char** encoding; 
 
 ASAtom encodingBaseName; 
 
 ASStm fontStm; 
 
 ASInt32 len1; 
 
 ASInt32 len2; 
 
 ASInt32 len3; 
 
 ASBool hasDW; 
 
 ASInt32 dw; 
 
 CosObj w; 
 
 ASBool hasDW2; 
 
 ASInt32 dw2[2]; 
 
 CosObj w2; 
 
 ASInt32 toUnicodeLen; 
 
 ASStm toUnicodeStm; 
 
 ASStm cidToGidMapStm; 
 
 char* panoseNo; 
 
 CosObj fd; 
 
 ASStm cidSetStm; 
 
 ASUns32 flags; 
 
 ASFixed mmDesignVec; 
 
 ASAtom sourceFontType; 
}

Parameters used for PDEFontCreateWithParams() to describe a font.

See Also


File: PEExpT.h
Line: 1012

Elements
attrsP  

A pointer to a PDEFontAttrs for the font attributes.

 
attrsSize  

The size of the data structure. It must be set to sizeof(PDEFontAttrs).

 
firstChar  

The first character index for the widths array, widthsP.

 
lastChar  

The last character index for the widths array, widthsP.

 
widthsP  

A pointer to the widths array.

 
encoding  

An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is NULL, no encoding information is written for that entry.

 
encodingBaseName  

An ASAtom representing the encoding base name if the encoding is a custom encoding. If the encoding is NULL, encodingBaseName is used as the value of the encoding and must be one of "WinAnsiEncoding", "MacRomanEncoding", or "MacExpertEncoding". If no encoding value is desired, use ASAtomNull. However, for Type 0 fonts, this field must be a valid CMap name, or PDEFontCreateWithParams() will fail.

 
fontStm  

A stream with font information.

 
len1  

The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only len1 is used, and it is the size of the font.

 
len2  

The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded.

 
len3  

The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the cleartomark operator, plus any following data.

 
hasDW  

If true, the dw and w fields are used; if false, they are not used.

 
dw  

(Optional) The default width for glyphs in a CIDFont. See Section 5.6.3 in the PDF Reference for more information.

 
w  

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. See Section 5.6.3 on character widths in CIDFonts in the PDF Reference for information on the format of this array.

 
hasDW2  

If true, the dw2 and w2 fields are used; if false, they are not used.

 
dw2  

(Optional: this applies only to CIDFonts that are used for vertical writing).

The default metric for writing mode 1. This entry is an array of two 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 Section 5.6.3 on vertical writing in the PDF Reference.

 
w2  

(Optional: this applies only to CIDFonts that are used for vertical writing)

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. See Section 5.6.3 on character widths in CIDFonts in the PDF Reference for information on the format of this array.

 
toUnicodeLen  

(Optional) The length of toUnicodeStm.

 
toUnicodeStm  

(Optional) A stream containing a CMap that defines the mapping from character codes to Unicode values. This entry is recommended for fonts that do not use one of the predefined CMaps. If present, this allows strings in the encoding to convert to Unicode values for export to other applications or plug-ins. For more information, see Section 5.6 on Type 0 fonts in the PDF Reference.

 
cidToGidMapStm  

A stream contain the mapping from a CID to glyphindex ("GID"). The glyphindex for a particular CID value c is a 2-byte value stored in bytes 2*c and 2*c+1; the first byte is the high-order byte.

 
panoseNo  

A 12-byte string containing the Family Class ID, Family SubClass ID, and 10 bytes for the PANOSE classification number for the font. For additional details on the PANOSE number, see the Japanese TrueType Font Property Selection Guidelines by the TrueType Conference Technical Committee.

 
fd  

A Cos dictionary identifying a subset of characters in a CIDFont. The values are dictionaries with entries that override the values in the FontDescriptor dictionary for the subset of characters. See Section 5.6 in the PDF Reference for more information.

 
cidSetStm  

A stream identifying which CIDs are present in the CIDFont file. It is required if the CIDFont file is embedded and only contains a subset of the glyphs in the character collection defined by the CIDSystemInfo. If this entry is missing, then it is assumed that the CIDFont file contains all the glyphs for the character collection. The stream's length should be rounded up to the nearest multiple of 8. The bits should be stored in bytes with the high-order bit first. Each bit corresponds to a CID. The first bit of the first byte corresponds to CID 0, the next bit corresponds to CID 1, and so on. If the subset contains a CID, the bit for that CID should be set. For compactness, the stream may use one of the compression filters to encode the data. For more information, see Section 5.6 in the PDF Reference.

 
flags  

One of the PDEFontCreateFlags describing how to embed and subset the font:

  • kPDEFontCreateEmbedded

  • kPDEFontWillSubset

  • kPDEFontDoNotEmbed

 
mmDesignVec  

A pointer to the Multiple Master font design vector.

 
_t_PDEFontInfo 
Product availability: All
Platform availability: All

Syntax

struct _t_PDEFontInfo {
 ASAtom name; 
 
 ASAtom type; 
 
 ASAtom charSet; 
 
 ASAtom encoding; 
 
 PDSysFontMode wMode; 
}

PDEFont information.

See Also


File: PDSysFontExpT.h
Line: 93

Elements
name  

An ASAtom for the font name (for example, "Times-Roman").

 
type  

An ASAtom for font type (for example, "Type 1", "TrueType", and so on).

 
charSet  

An ASAtom for "Roman", or ASAtomNull. If it is "Roman", the characters must be a subset of the Adobe Standard Roman Character Set.

 
encoding  

An ASAtom for font encoding, such as WinAnsiEncoding.

 
wMode  

The writing mode: 0 means horizontal and 1 means vertical.


Method Detail
PDEFontAddGlyphs()
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDESpanSetP PDEFontAddGlyphs(IN PDEFont pdeFont, INPDEGlyphRunP glyphRun, INASUns32 flags)

Adds glyphs to a PDEFont object for embedding a PDEFont.

This is used by clients that use PDEFEdit calls to embed the font but create their own content stream. The glyphs added by this routine will be included in the font when PDEFontSubsetNow() is called. It is up to the client to ensure that the encoding used by the PDEFont matches the character codes used in the string arguments to the text operators in the content stream.

This routine is used to specify which glyphs should be included in the font when embedded. Additionally, it specifies the mapping from the GlyphIDs to Unicode values. This mapping will be used to create the ToUnicode entry in the embedded font object. In the cases where the ToUnicode table cannot accurately reproduce the Unicode string in the PDEGlyphRun structure, this routine will return an array of spans that describe the contents of the ActualText spans that must be included in the content stream. Each span indicates a contiguous range of glyphs and a corresponding contiguous range of Unicode values that correspond to the glyphs. For example, the following ActualText span replace two glyphs with three Unicode values.

/Span<</ActualText(U+vvvvU+xxxU+yyyy)>>

BDC [Giii Gjjj] TJ EMC

Note that the routine must be called with the PDEGlyphRuns in display order.

Parameters

pdeFont — 

The font for the element.

 
glyphRun — 

A pointer to a PDEGlyphRun structure with Unicode data, GlyphIDs and their correspondence. Note that the xPosition and yPosition fields in the PDEGlyphDescription structure are ignored.

 
flags — 

Unused, reserved for later use.

Returns

A pointer to a PDESpanSet. The span can be released with PDEReleaseSpan().

See Also

Exceptions

genErrBadParm

Since


File: PEWProcs.h
Line: 2972
PDEFontCreate() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreate(INPDEFontAttrsP attrsP, INASUns32 attrsSize, INASInt32 firstChar, INASInt32 lastChar, INASInt16* widthsP, IN char** encoding, INASAtom encodingBaseName, INASStm fontStm, INASInt32 len1, INASInt32 len2, INASInt32 len3)

Creates a new PDEFont from the specified parameters.

The PDEFont may be represented as an embedded font (a FontFile entry in the font descriptor of the PDF file). To create a PDEFont that is stored as an embedded font, the FontFile stream may be passed in fontStm, and the len1, len2, and len3 parameters contain the Length1, Length2, and Length3 values of the FontFile stream attributes dictionary. See Section 5.8 in the PDF Reference for more information about embedded fonts.

The caller must close fontStm with ASStmClose() after invoking PDEFontCreate().

Call PDERelease() to dispose of the returned font object when finished with it.

Parameters

attrsP — 

A pointer to a PDEFontAttrs structure for the font attributes.

 
attrsSize — 

The size of the attrsP buffer in bytes.

 
firstChar — 

The first character index for the widths array, widthsP.

 
lastChar — 

The last character index for the widths array, widthsP.

 
widthsP — 

A pointer to the widths array.

 
encoding — 

An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is NULL, no encoding information is written for that entry.

 
encodingBaseName — 

The encoding base name if the encoding is a custom encoding. If the encoding is NULL, encodingBaseName is used as the value of the encoding, and must be one of WinAnsiEncoding, MacRomanEncoding, or MacExpertEncoding. If no encoding value is desired, use ASAtomNull.

 
fontStm — 

The stream with font information.

 
len1 — 

The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only len1 is used, and it is the size of the font.

 
len2 — 

The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded.

 
len3 — 

The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the cleartomark operator, plus any following data.

Returns

The specified PDEFont.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 941
PDEFontCreateFromCosObj() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromCosObj(const CosObj* cosObjP)

Creates a PDEFont corresponding to a Cos object of type Font.

Call PDERelease() to dispose of the returned font object when finished with it.

Parameters

cosObjP — 

IN/OUT The Cos object for which a PDEFont is created.

Returns

The PDEFont created from cosObjP.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 968
PDEFontCreateFromSysFont() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFont(INPDSysFont sysFont, INASUns32 flags)

Gets a PDEFont corresponding to a font in the system.

Call PDERelease() to dispose of the returned font object when finished with it.

The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font.

If you create a PDEFont that is a subset, call PDEFontSubsetNow() on this font afterwards.

Parameters

sysFont — 

A PDSysFont object referencing a system font.

 
flags — 

Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.

Returns

The PDEFont corresponding to sysFont.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 1015
PDEFontCreateFromSysFontAndEncoding() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFontAndEncoding(INPDSysFont sysFont, INPDSysEncoding sysEnc, INASAtom useThisBaseFont, INASUns32 createFlags)

Create a PDEFont from sysFont and sysEnc. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense.

Call PDERelease() to dispose of the returned PDEFont object when finished with it.

Parameters

sysFont — 

A PDSysFont object referencing a system font.

 
sysEnc — 

A PDSysEncoding object.

 
useThisBaseFont — 

The base font. An exception will be raised if the base font name passed is a subset name (XXXXXX+FontName) or an empty string.

 
createFlags — 

One of the PDEFontCreateFlags.

Returns

The newly created PDEFont object.

Since


File: PEWProcs.h
Line: 2383
PDEFontCreateFromSysFontAndEncodingInCosDoc() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFontAndEncodingInCosDoc(INPDSysFont sysFont, INPDSysEncoding sysEnc, INASAtom useThisBaseFont, INASUns32 createFlags, INCosDoc cosDoc)

Creates a font object like PDEFontCreateFromSysFontAndEncoding(), except that the client can specify the CosDoc in which the font is created. Create a PDEFont from sysFont and sysEnc. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense.

Call PDERelease() to dispose of the returned PDEFont object when finished with it.

Parameters

sysFont — 

A PDSysFont object referencing a system font.

 
sysEnc — 

A PDSysEncoding object.

 
useThisBaseFont — 

The base font. An exception will be raised if the base font name passed is a subset name (XXXXXX+FontName) or an empty string.

 
createFlags — 

One of the PDEFontCreateFlags.

 
cosDoc — 

IN/OUT The document in which to put the Cos representation of resource. It may be NULL.

Returns

The newly created PDEFont object.

Since


File: PEWProcs.h
Line: 3408
PDEFontCreateFromSysFontEx() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFontEx(INPDSysFont sysFont, INASUns32 flags, INASAtom snapshotName, INASFixed* mmDesignVec)

Creates a PDEFont corresponding to a font in the system.

If the font is a Multiple Master font, mmDesignVector points to the design vector, whose length must equal the number of design axes of the font.

Call PDERelease() to dispose of the returned font object when finished with it.

The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font.

If you create a PDEFont that is subsetted, call PDEFontSubsetNow() on this font afterwards.

Parameters

sysFont — 

IN/OUT A PDSysFont object referencing a system font.

 
flags — 

IN/OUT Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.

 
snapshotName — 

IN/OUT The name to be associated with this particular instantiation of the PDEFont.

 
mmDesignVec — 

IN/OUT A pointer to the Multiple Master font design vector.

Returns

The PDEFont corresponding to sysFont.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 1709
PDEFontCreateFromSysFontExInCosDoc() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFontExInCosDoc(INPDSysFont sysFont, INASUns32 flags, INASAtom snapshotName, INASFixed* mmDesignVec, INCosDoc cosDoc)

Creates a font object like PDEFontCreateFromSysFontEx(), except that the client can specify the CosDoc in which the font is created.

If the font is a Multiple Master font, mmDesignVector points to the design vector, whose length must equal the number of design axes of the font.

Call PDERelease() to dispose of the returned font object when finished with it.

The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font.

If you create a PDEFont that is subsetted, call PDEFontSubsetNow() on this font afterwards.

Parameters

sysFont — 

IN/OUT A PDSysFont object referencing a system font.

 
flags — 

IN/OUT Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.

 
snapshotName — 

IN/OUT The name to be associated with this particular instantiation of the PDEFont.

 
mmDesignVec — 

IN/OUT A pointer to the Multiple Master font design vector.

 
cosDoc — 

IN/OUT The document in which to put the Cos representation of resource. It may be NULL.

Returns

The PDEFont corresponding to sysFont.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 3336
PDEFontCreateFromSysFontInCosDoc() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFontInCosDoc(INPDSysFont sysFont, INASUns32 flags, INCosDoc cosDoc)

Creates a font object like PDEFontCreateFromSysFont(), except that the client can specify the CosDoc in which the font is created.

Call PDERelease() to dispose of the returned font object when finished with it.

The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font.

If you create a PDEFont that is a subset, call PDEFontSubsetNow() on this font afterwards.

Parameters

sysFont — 

A PDSysFont object referencing a system font.

 
flags — 

Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.

 
cosDoc — 

IN/OUT The document in which to put the Cos representation of resource. It may be NULL.

Returns

The PDEFont corresponding to sysFont.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 3278
PDEFontCreateFromSysFontWithParams() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateFromSysFontWithParams(INPDSysFont sysFont, INPDEFontCreateFromSysFontParams params)

Used to obtain a PDEFont corresponding to a font in the system.

Call PDERelease() to dispose of the returned PDEFont object when finished with it.

Parameters

sysFont — 

The system font.

 
params — 

The parameters structure.

Returns

The newly created PDEFont object.

Exceptions

peErrCantCreateFontSubset
genErrBadParm

Since


File: PEWProcs.h
Line: 2243
PDEFontCreateInCosDoc() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateInCosDoc(INPDEFontAttrsP attrsP, INASUns32 attrsSize, INASInt32 firstChar, INASInt32 lastChar, INASInt16* widthsP, IN char** encoding, INASAtom encodingBaseName, INASStm fontStm, INASInt32 len1, INASInt32 len2, INASInt32 len3, INCosDoc cosDoc)

Creates a font object like PDEFontCreate(), except that the client can specify the CosDoc in which the font is created.

The PDEFont may be represented as an embedded font (a FontFile entry in the font descriptor of the PDF file). To create a PDEFont that is stored as an embedded font, the FontFile stream may be passed in fontStm, and the len1, len2, and len3 parameters contain the Length1, Length2, and Length3 values of the FontFile stream attributes dictionary. See Section 5.8 in the PDF Reference for more information about embedded fonts.

The caller must close fontStm with ASStmClose() after invoking PDEFontCreate().

Call PDERelease() to dispose of the returned font object when finished with it.

Parameters

attrsP — 

A pointer to a PDEFontAttrs structure for the font attributes.

 
attrsSize — 

The size of the attrsP buffer in bytes.

 
firstChar — 

The first character index for the widths array, widthsP.

 
lastChar — 

The last character index for the widths array, widthsP.

 
widthsP — 

A pointer to the widths array.

 
encoding — 

An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is NULL, no encoding information is written for that entry.

 
encodingBaseName — 

The encoding base name if the encoding is a custom encoding. If the encoding is NULL, encodingBaseName is used as the value of the encoding, and must be one of WinAnsiEncoding, MacRomanEncoding, or MacExpertEncoding. If no encoding value is desired, use ASAtomNull.

 
fontStm — 

The stream with font information.

 
len1 — 

The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only len1 is used, and it is the size of the font.

 
len2 — 

The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded.

 
len3 — 

The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the cleartomark operator, plus any following data.

 
cosDoc — 

IN/OUT The document in which to put the Cos representation of resource. It may be NULL.

Returns

The specified PDEFont.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 3228
PDEFontCreateToUnicodeNow() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontCreateToUnicodeNow(IN PDEFont font, INCosDoc cosDoc)

This function creates the / ToUnicode table. The user can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateToUnicodeNow() is needed.

Parameters

font — 

IN/OUT An object of type PDEFont.

 
cosDoc — 

IN/OUT The container document.

Exceptions

genErrBadParm
peErrWrongPDEObjectType

Since


File: PEWProcs.h
Line: 2442
PDEFontCreateWidthsNow() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontCreateWidthsNow(IN PDEFont font, INCosDoc cosDoc)

This function creates width entries for font. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateWidthsNow() is needed.

Parameters

font — 

IN/OUT The font for which to create width entries.

 
cosDoc — 

IN/OUT The container document.

Exceptions

genErrBadParm
peErrWrongPDEObjectType

Since


File: PEWProcs.h
Line: 2427
PDEFontCreateWithParams() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateWithParams(INPDEFontCreateParams params)

Creates a new PDEFont from params.

The PDEFont may be represented as an embedded font (a FontFile value in PDF). To create a PDEFont that will be stored as an embedded font, the FontFile stream may be passed as fontStm, and the len1, len2, and len3 parameters contain the Length1, Length2, and Length3 values of the FontFile. The caller must close the fontStm after calling this method. This method supports multi-byte fonts.

This method extends PDEFontCreate() to support multi-byte fonts.

Call PDERelease() to dispose of the returned font object when finished with it.

Parameters

params — 

IN/OUT A pointer to a structure containing all font parameters necessary to fully define a font.

Returns

A PDEFont object of the font described by the parameters.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 1557
PDEFontCreateWithParamsInCosDoc() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEFont PDEFontCreateWithParamsInCosDoc(INPDEFontCreateParams params, INCosDoc cosDoc)

Creates a font object like PDEFontCreateWithParams(), except that the client can specify the CosDoc in which the font is created. Creates a new PDEFont from params.

The PDEFont may be represented as an embedded font (a FontFile value in PDF). To create a PDEFont that will be stored as an embedded font, the FontFile stream may be passed as fontStm, and the len1, len2, and len3 parameters contain the Length1, Length2, and Length3 values of the FontFile. The caller must close the fontStm after calling this method. This method supports multi-byte fonts.

This method extends PDEFontCreate() to support multi-byte fonts.

Call PDERelease() to dispose of the returned font object when finished with it.

Parameters

params — 

IN/OUT A pointer to a structure containing all font parameters necessary to fully define a font.

 
cosDoc — 

IN/OUT The document in which to put the Cos representation of resource. It may be NULL.

Returns

A PDEFont object of the font described by the parameters.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 3378
PDEFontEmbedNow() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontEmbedNow(IN PDEFont font, INCosDoc cosDoc)

This function embeds a font stream. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontEmbedNow() is needed.

Parameters

font — 

The font to embed.

 
cosDoc — 

The container document.

See Also

Exceptions

genErrBadParm
peErrWrongPDEObjectType

Since


File: PEWProcs.h
Line: 2412
PDEFontEmbedNowDontSubset() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontEmbedNowDontSubset(IN PDEFont font, INCosDoc cosDoc)

Embeds the given PDEFont inside doc without creating a subset. Use this method instead of PDEFontSubsetNow() if you created the font with the willSubset flag but changed your mind.

Parameters

font — 

The font to embed.

 
cosDoc — 

The container document.

See Also

Since


File: PEWProcs.h
Line: 1791
PDEFontGetAttrs() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontGetAttrs(IN PDEFont font, OUTPDEFontAttrsP attrsP, INASUns32 attrsSize)

Gets the attributes for a font object.

Parameters

font — 

IN/OUT A PDEFont whose attributes are found.

 
attrsP — 

IN/OUT (Filled by the method) A pointer to a PDEFontAttrs structure for the font attributes.

 
attrsSize — 

IN/OUT The size of the attrsP buffer in bytes.

See Also

Exceptions

peErrCantGetAttrs
genErrBadParm
genErrResourceLoadFailed

Since


File: PERProcs.h
Line: 1145
PDEFontGetCosObj() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontGetCosObj(IN PDEFont font, OUTCosObj* cosObjP)

Gets a Cos object for a PDEFont.

Parameters

font — 

IN/OUT A PDEFont whose Cos object is obtained.

 
cosObjP — 

IN/OUT (Filled by the method) The Cos object corresponding to font.

See Also

Exceptions

genErrResourceLoadFailed
peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1181
PDEFontGetCreateNeedFlags() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASUns32 PDEFontGetCreateNeedFlags(IN PDEFont font)

This function returns flags indicating what needs to be done to make PDEFont complete. kPDEFontCreateNeedWidths can be cleared by PDEFontCreateWidthsNow(). kPDEFontCreateNeedToUnicode can be cleared by PDEFontCreateToUnicodeNow(). kPDEFontCreateNeedEmbed can be cleared by PDEFontEmbedNow().

Parameters

font — 

The font object.

Returns

A value corresponding to PDEFontCreateNeedFlags().

Since


File: PEWProcs.h
Line: 2396
PDEFontGetNumCodeBytes() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt16 PDEFontGetNumCodeBytes(IN PDEFont font, INASUns8* text, INASInt32 len)

Gets the number of bytes comprising the next code in a string of single or multi-byte character codes.

Parameters

font — 

IN/OUT A PDEFont object returned from one of the PDEFontCreate methods.

 
text — 

IN/OUT A pointer to a string of characters.

 
len — 

IN/OUT The length, in bytes, of the string of characters, starting with the character pointed to by text.

Returns

The number of bytes in the next character code pointed to by text.

See Also

Exceptions

genErrNoMemory

Since


File: PERProcs.h
Line: 1731
PDEFontGetOneByteEncoding() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEFontGetOneByteEncoding(IN PDEFont font, OUTASAtom* encodingDelta)

Gets an array of delta encodings for the given one byte PDEFont.

Parameters

font — 

IN/OUT A PDEFont object returned from one of the PDEFontCreate methods.

 
encodingDelta — 

IN/OUT (Filled by the method) A pointer to an ASAtom array that is filled with the delta encodings for font. Each entry is the ASAtom for a glyph name that differs from the base encoding. See Section 5.5.5 in the PDF Reference for more information about font encodings. The array must be allocated to hold 256 entries.

Returns

true if encodingDelta is filled, false otherwise.

See Also

Exceptions

genErrNoMemory

Since


File: PERProcs.h
Line: 1971
PDEFontGetSysEncoding() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDSysEncoding PDEFontGetSysEncoding(IN PDEFont pdeFont)

Gets the system encoding object associated with a font object.

Parameters

pdeFont — 

A PDEFont whose system encoding is found.

Returns

The system encoding object.

See Also

Exceptions

genErrBadParm
genErrResourceLoadFailed

Since


File: PERProcs.h
Line: 2724
PDEFontGetSysFont() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDSysFont PDEFontGetSysFont(IN PDEFont pdeFont)

Gets the system font object associated with a font object.

Parameters

pdeFont — 

A PDEFont whose system font is found.

Returns

The system font object.

See Also

Exceptions

genErrBadParm
genErrResourceLoadFailed

Since


File: PERProcs.h
Line: 2711
PDEFontGetWidths() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontGetWidths(IN PDEFont font, OUTASInt16* widthsP)

Gets the widths for a font object.

Parameters

font — 

IN/OUT A PDEFont whose widths are found.

 
widthsP — 

IN/OUT (Filled by the method) A pointer to the widths array. widthsP must have room for 256 values. The widths are returned in character space (1000 EM units). An EM is a typographic unit of measurement equal to the size of a font. To convert to text space, divide the value returned by 1000. To convert to user space, multiply the text space value by the font size.

See Also

Exceptions

peErrCantGetWidths
genErrBadParm
genErrResourceLoadFailed

Since


File: PERProcs.h
Line: 1166
PDEFontGetWidthsNow() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontGetWidthsNow(IN PDEFont font, INCosDoc cosDoc)

Gets a Type0 font's width information for only those characters used in the file. Call this routine when the font was created with the kPDEFontDeferWidths flag but without the kPDEFontCreateEmbedded flag (if the font is to be embedded, call PDEFontSubsetNow(), which also gets the width info).

Parameters

font — 

The font whose widths are found.

 
cosDoc — 

The container document.

Since


File: PEWProcs.h
Line: 1805
PDEFontIsEmbedded() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEFontIsEmbedded(IN PDEFont pdeFont)

Tests whether a font is an embedded font in the document in which it was created.

Parameters

pdeFont — 

A PDEFont object to test.

Returns

true if the font is embedded, false if it is not, or if it was created in one document and embedded in a different document.

See Also

Since


File: PERProcs.h
Line: 2697
PDEFontIsMultiByte() 
Product availability: All
Platform availability: All

Syntax

ASBool PDEFontIsMultiByte(IN PDEFont font)

Tests whether a font contains any multi-byte characters.

Parameters

font — 

IN/OUT A PDEFont object returned from one of the PDEFontCreate methods to test.

Returns

true if the font contains any multi-byte characters, false otherwise.

See Also

Since


File: PERProcs.h
Line: 1763
PDEFontSetSysEncoding() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontSetSysEncoding(IN PDEFont pdeFont, INPDSysEncoding sysEnc)

Sets the system encoding object associated with a font object.

Parameters

pdeFont — 

A PDEFont whose system encoding is set.

 
sysEnc — 

The new system encoding object.

See Also

Exceptions

genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 2620
PDEFontSetSysFont() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontSetSysFont(IN PDEFont pdeFont, INPDSysFont sysFont)

Sets the system font object to be used with a font object that does not currently have a system font associated with it.

Parameters

pdeFont — 

A PDEFont whose system font is set.

 
sysFont — 

The new system font object.

See Also

Exceptions

genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 2603
PDEFontSubsetNow() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEFontSubsetNow(IN PDEFont font, INCosDoc cosDoc)

Subsets a given PDEFont in a CosDoc.

If you created font with PDEFontCreateFromSysFont(), you must have set both the kPDEFontCreateEmbedded and kPDEFontWillSubset set in the flags parameter, to be able to subset the font.

Parameters

font — 

IN/OUT The PDEFont to subset.

 
cosDoc — 

IN/OUT The CosDoc whose font is subsetted.

See Also

Exceptions

peErrCantCreateFontSubset
peErrCantGetAttrs
peErrCantGetWidths
peErrCantEmbedFont
genErrBadParm
genErrResourceLoadFailed

Since


File: PEWProcs.h
Line: 1477
PDEFontSumWidths() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt32 PDEFontSumWidths(IN PDEFont font, INASUns8* text, INASInt32 len)

Gets the sum of the widths of len characters from a string of single or multi-byte characters.

Parameters

font — 

A PDEFont object returned from one of the PDEFontCreate methods.

 
text — 

A pointer to a string of characters.

 
len — 

The length of string in bytes.

Returns

The width of the text string in EM space. (In EM space, the width of 'M' is about 1000 EM units).

See Also

Exceptions

genErrNoMemory
pdErrBadResMetrics
genErrResourceLoadFailed
peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1709
PDEFontTranslateGlyphIdsToUnicode() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASUns32 PDEFontTranslateGlyphIdsToUnicode(IN PDEFont font, INASUns8* text, INASUns32 textLen, OUTASUns8* unicodeStr, INASUns32 size)

Translates a string to Unicode values. The PDEFont must have a / ToUnicode table.

Parameters

font — 

IN/OUT The font.

 
text — 

IN/OUT The string to convert.

 
textLen — 

IN/OUT The length of text in bytes.

 
unicodeStr — 

IN/OUT (Filled by the method) A buffer to hold the translated string.

 
size — 

IN/OUT The size of the unicodeStr buffer.

Returns

0 if the string was successfully translated. If unicodeStr is too small for the translated string, it returns the number of bytes required.

Exceptions

genErrBadParm

Since


File: PEWProcs.h
Line: 2266