Layer | PDFEdit_Layer |
Object | PDEFont |
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 | ||
---|---|---|
kPDEFontNoEditableEmbedding
Flags for protection of PDEFontAttrs: editable embedding is not allowed.
|
||
kPDEFontNoEmbedding
Flags for protection of PDEFontAttrs: embedding is not allowed.
|
Typedef | ||
---|---|---|
PDEFont | ||
PDEFontAttrs | ||
PDEFontAttrsP | ||
PDEFontCreateFromSysFontParams | ||
PDEFontCreateFromSysFontParamsRec | ||
PDEFontCreateParams | ||
PDEFontCreateParamsRec | ||
PDEFontInfoP | ||
PDEFontInfoRec |
Enumeration | ||
---|---|---|
PDEFontCreateFlags
Flags for
PDEFontCreateFromSysFont()
. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.
|
||
PDEFontCreateNeedFlags
Flags for PDEFontGetCreateNeedFlags().
|
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 | ||
---|---|---|
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.
|
||
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.
|
||
Creates a font object like PDEFontCreateFromSysFont(), except that the client can specify the CosDoc in which the font is created.
|
||
PDEFont PDEFontCreateFromSysFontWithParams(INPDSysFont sysFont, INPDEFontCreateFromSysFontParams params)
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.
|
||
PDEFont PDEFontCreateWithParams(INPDEFontCreateParams params)
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.
|
||
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().
|
||
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.
|
||
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.
|
kPDEFontNoEditableEmbedding |
Product availability: All |
Platform availability: All |
#define kPDEFontNoEditableEmbedding 0x00000002
Flags for protection of PDEFontAttrs: editable embedding is not allowed.
File: PEExpT.h |
Line: 1798 |
kPDEFontNoEmbedding |
Product availability: All |
Platform availability: All |
#define kPDEFontNoEmbedding 0x00000001
Flags for protection of PDEFontAttrs: embedding is not allowed.
File: PEExpT.h |
Line: 1795 |
PDEFont |
Product availability: PDFL |
Platform availability: Macintosh, Windows, UNIX |
typedef struct _t_PDEFont* PDEFont;
File: PDExpT.h |
Line: 6436 |
PDEFontAttrs |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontAttrs PDEFontAttrs;
File: PEExpT.h |
Line: 1004 |
PDEFontAttrsP |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontAttrs PDEFontAttrsP;
File: PEExpT.h |
Line: 1004 |
PDEFontCreateFromSysFontParams |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontCreateFromSysFontParams PDEFontCreateFromSysFontParams;
File: PEExpT.h |
Line: 1210 |
PDEFontCreateFromSysFontParamsRec |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontCreateFromSysFontParams PDEFontCreateFromSysFontParamsRec;
File: PEExpT.h |
Line: 1210 |
PDEFontCreateParams |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontCreateParams PDEFontCreateParams;
File: PEExpT.h |
Line: 1171 |
PDEFontCreateParamsRec |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontCreateParams PDEFontCreateParamsRec;
File: PEExpT.h |
Line: 1171 |
PDEFontInfoP |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontInfo PDEFontInfoP;
File: PDSysFontExpT.h |
Line: 111 |
PDEFontInfoRec |
Product availability: All |
Platform availability: All |
typedef _t_PDEFontInfo PDEFontInfoRec;
File: PDSysFontExpT.h |
Line: 111 |
PDEFontCreateFlags |
Product availability: All |
Platform availability: All |
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 |
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 |
|
kPDEFontDoNotEmbed | Do not embed the font. You cannot set both this and the |
|
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 |
|
kPDEFontCreateToUnicode | Create a ToUnicode CMap. |
|
kPDEFontCreateAllWidths | Supply the entire widths table (this affects Type0 fonts only). |
|
kPDEFontCreateEmbedOpenType | ||
kPDEFontCreateReserved1 | Reserved for internal usage |
PDEFontCreateNeedFlags |
Product availability: All |
Platform availability: All |
enum PDEFontCreateNeedFlags {
kPDEFontCreateNeedWidths = 0x00010000,
kPDEFontCreateNeedToUnicode = 0x00020000,
kPDEFontCreateNeedEmbed = 0x00040000
}
File: PEExpT.h |
Line: 1781 |
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. |
_t_PDEFontAttrs |
Product availability: All |
Platform availability: All |
struct _t_PDEFontAttrs {
Attributes of a PDEFont and of a PDSysFont. This structure is also referenced in PDEFontCreateParams().
See Also
File: PEExpT.h |
Line: 878 |
name | An ASAtom for font name (for example, |
|||||||
type | An ASAtom for the font type corresponding to the Subtype key in a a font dictionary. It may be:
|
|||||||
charSet | An ASAtom for |
|||||||
encoding | An ASAtom for font encoding. It may be |
|||||||
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 ( |
|||||||
stemV | The vertical stem width. |
|||||||
stemH | The horizontal stem width. |
|||||||
capHeight | The capital height. |
|||||||
xHeight | ||||||||
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 | ||||||||
cidFontType | CIDFontType0 or CIDFontType2. |
|||||||
wMode | The writing mode. It must be one of:
|
|||||||
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, |
|||||||
ordering | An ASAtom representing the CIDFont's Ordering information (for example, |
|||||||
supplement | The SystemSupplement field from the CIDFont. |
|||||||
cantEmbed | ||||||||
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:
|
|||||||
packageType |
_t_PDEFontCreateFromSysFontParams |
Product availability: All |
Platform availability: All |
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 |
structSize | The size of the data structure. It must be set to |
|
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 |
_t_PDEFontCreateParams |
Product availability: All |
Platform availability: All |
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 |
attrsP | A pointer to a PDEFontAttrs for the font attributes. |
|
attrsSize | The size of the data structure. It must be set to |
|
firstChar | ||
lastChar | ||
widthsP | A pointer to the widths array. |
|
encoding | An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is |
|
encodingBaseName | An ASAtom representing the encoding base name if the encoding is a custom encoding. If the encoding is |
|
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 |
|
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 |
|
hasDW | If |
|
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 |
|
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 |
|
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 |
|
toUnicodeLen | (Optional) The length of |
|
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 |
|
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 |
|
flags | One of the PDEFontCreateFlags describing how to embed and subset the font:
|
|
mmDesignVec | A pointer to the Multiple Master font design vector. |
|
_t_PDEFontInfo |
Product availability: All |
Platform availability: All |
struct _t_PDEFontInfo {
ASAtom name;
ASAtom type;
ASAtom charSet;
ASAtom encoding;
PDSysFontMode wMode;
}
PDEFont information.
See Also
File: PDSysFontExpT.h |
Line: 93 |
name | ||
type | An ASAtom for font type (for example, |
|
charSet | An ASAtom for |
|
encoding | ||
wMode | The writing mode: |
PDEFontAddGlyphs | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
|
flags — | Unused, reserved for later use. |
A pointer to a PDESpanSet. The span can be released with PDEReleaseSpan(). |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 2972 |
PDEFontCreate | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
firstChar — | ||
lastChar — | ||
widthsP — | A pointer to the widths array. |
|
encoding — | An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is |
|
encodingBaseName — | The encoding base name if the encoding is a custom encoding. If the encoding is |
|
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 |
|
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 |
The specified PDEFont. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 941 |
PDEFontCreateFromCosObj | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — |
The PDEFont created from cosObjP. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 968 |
PDEFontCreateFromSysFont | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
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. |
The PDEFont corresponding to sysFont. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 1015 |
PDEFontCreateFromSysFontAndEncoding | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
sysEnc — | A PDSysEncoding object. |
|
useThisBaseFont — | The base font. An exception will be raised if the base font name passed is a subset name |
|
createFlags — | One of the PDEFontCreateFlags. |
The newly created PDEFont object. |
Since
File: PEWProcs.h |
Line: 2383 |
PDEFontCreateFromSysFontAndEncodingInCosDoc | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
sysEnc — | A PDSysEncoding object. |
|
useThisBaseFont — | The base font. An exception will be raised if the base font name passed is a subset name |
|
createFlags — | One of the PDEFontCreateFlags. |
|
cosDoc — | IN/OUT The document in which to put the Cos representation of resource. It may be |
The newly created PDEFont object. |
Since
File: PEWProcs.h |
Line: 3408 |
PDEFontCreateFromSysFontEx | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
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. |
The PDEFont corresponding to |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 1709 |
PDEFontCreateFromSysFontExInCosDoc | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
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 |
The PDEFont corresponding to |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 3336 |
PDEFontCreateFromSysFontInCosDoc | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
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 |
The PDEFont corresponding to |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 3278 |
PDEFontCreateFromSysFontWithParams | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
The newly created PDEFont object. |
Exceptions
Since
File: PEWProcs.h |
Line: 2243 |
PDEFontCreateInCosDoc | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
firstChar — | ||
lastChar — | ||
widthsP — | A pointer to the widths array. |
|
encoding — | An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is |
|
encodingBaseName — | The encoding base name if the encoding is a custom encoding. If the encoding is |
|
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 |
|
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 |
|
cosDoc — | IN/OUT The document in which to put the Cos representation of resource. It may be |
The specified PDEFont. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 3228 |
PDEFontCreateToUnicodeNow | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
cosDoc — | IN/OUT The container document. |
Exceptions
Since
File: PEWProcs.h |
Line: 2442 |
PDEFontCreateWidthsNow | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
cosDoc — | IN/OUT The container document. |
Exceptions
Since
File: PEWProcs.h |
Line: 2427 |
PDEFontCreateWithParams | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 1557 |
PDEFontCreateWithParamsInCosDoc | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 3378 |
PDEFontEmbedNow | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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
Since
File: PEWProcs.h |
Line: 2412 |
PDEFontEmbedNowDontSubset | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
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 — |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1145 |
PDEFontGetCosObj | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1181 |
PDEFontGetCreateNeedFlags | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
A value corresponding to PDEFontCreateNeedFlags(). |
Since
File: PEWProcs.h |
Line: 2396 |
PDEFontGetNumCodeBytes | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
|
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. |
The number of bytes in the next character code pointed to by text. |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1731 |
PDEFontGetOneByteEncoding | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
Gets an array of delta encodings for the given one byte PDEFont.
Parameters
font — | IN/OUT A PDEFont object returned from one of the |
|
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. |
|
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1971 |
PDEFontGetSysEncoding | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
PDSysEncoding PDEFontGetSysEncoding(IN PDEFont pdeFont)
Gets the system encoding object associated with a font object.
Parameters
pdeFont — |
The system encoding object. |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 2724 |
PDEFontGetSysFont | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
PDSysFont PDEFontGetSysFont(IN PDEFont pdeFont)
Gets the system font object associated with a font object.
Parameters
pdeFont — |
The system font object. |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 2711 |
PDEFontGetWidths | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1166 |
PDEFontGetWidthsNow | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
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. |
|
See Also
Since
File: PERProcs.h |
Line: 2697 |
PDEFontIsMultiByte | () |
Product availability: All |
Platform availability: All |
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 |
|
See Also
Since
File: PERProcs.h |
Line: 1763 |
PDEFontSetSysEncoding | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEFontSetSysEncoding(IN PDEFont pdeFont, INPDSysEncoding sysEnc)
Sets the system encoding object associated with a font object.
Parameters
pdeFont — | ||
sysEnc — | The new system encoding object. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 2620 |
PDEFontSetSysFont | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
sysFont — | The new system font object. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 2603 |
PDEFontSubsetNow | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 1477 |
PDEFontSumWidths | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
The width of the text string in EM space. (In EM space, the width of 'M' is about 1000 EM units). |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1709 |
PDEFontTranslateGlyphIdsToUnicode | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — | ||
unicodeStr — | IN/OUT (Filled by the method) A buffer to hold the translated string. |
|
size — | IN/OUT The size of the |
|
Exceptions
Since
File: PEWProcs.h |
Line: 2266 |