#define kPDEFontNoEditableEmbedding
0x00000002
#define kPDEFontNoEmbedding
0x00000001
PDEFontCreateFromSysFont
()
. If you want to subset a font, set both the kPDEFontCreateEmbedded
and kPDEFontWillSubset
flags. kPDEFontCreateEmbedded = 0x0001 | Embed the font. Create an embedded font. By itself, this will not subset the font.
|
kPDEFontWillSubset = 0x0002 | 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 = 0x0004 | Do not embed the font. You cannot set both this and the
kPDEFontWillSubset flags. Nor can you set kPDEFontCreateEmbedded . |
kPDEFontEncodeByGID = 0x0008 | Create a CIDFont with identity (GID) encoding.
|
kPDEFontDeferWidths = 0x0010 | Wait to get the widths until later (this affects Type0 fonts only).
|
kPDEFontCreateSubset = kPDEFontWillSubset | |
kPDEFontCreateGIDOverride = 0x0020 | PDFLib will convert
cp to gid with identity embedded. |
kPDEFontCreateToUnicode = 0x0040 | Create a ToUnicode CMap.
|
kPDEFontCreateAllWidths = 0x0080 | Supply the entire widths table (this affects Type0 fonts only).
|
kPDEFontCreateEmbedOpenType = 0x0100 | Embed an OpenType style font subset, if appropriate.
|
kPDEFontCreateReserved1 = 0x0200 | Reserved for internal usage
|
kPDEFontCreateFullCIDSet = 0x0400 | Create CIDSet entry from all CIDs present in subsetted Type0 CID Fonts containing glyph descriptions based on identity encoded TrueType fonts (subtype CIDFontType2). Subsetted identity encoded Type0 fonts can have more glyphs than asked for to avoid glyph renumbering. Default behavior is to only include CIDs used in PDF page content stream in CIDset
|
kPDEFontThrowIfToUnicodeUsesPUA = 0x0800 | If kPDEFontThrowIfToUnicodeUsesPUA flag is passed along with kPDEFontCreateToUnicode and kPDEFontCreateSubset, throw error in PDEFont embedding APIs if the created ToUnicode table contains Private Use Area (Range: E000-F8FF in plane 0 and Supplemental Private Use Area A & B) Unicode values
|
kPDEFontInvisibleRenderingMode = 0x1000 | Reserved for internal usage- This flag is passed if PDEFont is used with Text rendering mode 3(Invisible)- While converting to PDFXxx and PDFAxx if fetched fontfile stream data from Cooltype is empty (NULL), then with this flag enabled entire fontfile stream data from input file is copied to embedded font in output file
|
kPDEFontCreateNeedWidths = 0x00010000 | It is necessary to to create the width.
|
kPDEFontCreateNeedToUnicode = 0x00020000 | It is necessary to to create the ToUnicode stream.
|
kPDEFontCreateNeedEmbed = 0x00040000 | It is necessary to to embed it.
|
typedef
struct
_t_PDEFont
*
PDEFont
;
Attributes of a PDEFont and of a PDSysFont. This structure is also referenced in PDEFontCreateParams().
To learn more about the BaseFont key, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 269. You can find this document on the web store of the International Standards Organization (ISO).
To learn more about Base Encoding, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 262. You can find this document on the web store of the International Standards Organization (ISO).
| |||||||
An ASAtom for font name (for example,
"Times-Roman" ). It corresponds to the BaseFont key in the font dictionary of a PDF file. See the description of the BaseFont key in the CIDFont dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269. | |||||||
| |||||||
An ASAtom for
"Roman" , or ASAtomNull. If it is "Roman" , the characters must be a subset of the Adobe Standard Roman Character Set. | |||||||
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. | |||||||
The desired font flags; one or more of the Font Flags.
| |||||||
The font bounding box in 1000 EM units.
| |||||||
The width of the missing character (
.notdef ). | |||||||
The vertical stem width.
| |||||||
The horizontal stem width.
| |||||||
The capital height.
| |||||||
The x height.
| |||||||
The maximum ascender height.
| |||||||
The maximum descender depth.
| |||||||
The additional leading between lines.
| |||||||
The maximum character width.
| |||||||
The average character width.
| |||||||
The italic angle in degrees, if any.
| |||||||
CIDFontType0 or CIDFontType2.
| |||||||
The writing mode. It must be one of:
| |||||||
An ASAtom representing the PostScript name of a TrueType font.
| |||||||
The platform name.
| |||||||
An ASAtom representing the ISO 639 language code. These are available from http://www.iso.ch.
| |||||||
An ASAtom representing the CIDFont's Registry information (for example,
"gAdobe-Japan" . | |||||||
An ASAtom representing the CIDFont's Ordering information (for example,
"g1" ). | |||||||
The SystemSupplement field from the CIDFont.
| |||||||
A non-zero value means the font can't be embedded.
| |||||||
The name of the base encoding; that is, the BaseEncoding entry in an encoding dictionary. See the description of Base Encoding in the Character Encoding section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.6.6, page 262. The Differences entry of the encoding dictionary describes differences (deltas) from the base encoding.
| |||||||
Allows one of the following bits to be set in order to disable font embedding:
| |||||||
Font weight, An unsigned integer representing the thinness or thickness of * a font
| |||||||
|
| |
The size of the data structure. It must be set to
sizeof(PDEFontCreateFromSysFontParamsRec) . | |
A bit mask of the PDEFontCreateFlags.
| |
The name of a Multiple Master snapshot. See "Multiple Master Fonts" in section 9.6.2.3, under Type 1 Fonts, in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 256.
| |
A pointer to the Multiple Master font design vector.
| |
long 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.
|
Used to specify which encoding to use with a CID font. Pass ASAtomNull to use the platform default.
| |
|
Parameters used for PDEFontCreateWithParams() to describe a font.
To learn more about CIDFonts, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 269. You can find this document on the web store of the International Standards Organization (ISO).
To learn more about Composite Fonts, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 267. You can find this document on the web store of the International Standards Organization (ISO).
| |
A pointer to a PDEFontAttrs for the font attributes.
| |
The size of the data structure. It must be set to
sizeof(PDEFontAttrs) . | |
The first character index for the widths array,
widthsP . | |
The last character index for the widths array,
widthsP . | |
A pointer to the widths array.
| |
char * * 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. |
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. | |
A stream with font information.
| |
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. | |
The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded.
| |
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. | |
(Optional) The default width for glyphs in a CIDFont. See the description of the BaseFont key in the CIDFont dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.
| |
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 the description of character widths in CIDFonts in the CIDFont dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.
| |
(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 | |
(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 | |
(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 on type 0 fonts, see the description of Composite Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
| |
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. | |
char * 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.
|
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 the description of Composite Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
| |
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. See the description of Composite Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267. | |
| |
A pointer to the Multiple Master font design vector.
| |
| |
|
| |
An ASAtom for the font name (for example,
"Times-Roman" ). | |
An ASAtom for
"Roman" , or ASAtomNull. If it is "Roman" , the characters must be a subset of the Adobe Standard Roman Character Set. | |
An ASAtom for font encoding, such as WinAnsiEncoding.
| |
The writing mode:
0 means horizontal and 1 means vertical. | |
|
| |
The index into the glyphs array in a PDEGlyphRun object.
| |
The number of glyphs in the span starting from firstGlyph. This can be zero, indicating there are no glyphs for this Unicode string. The firstGlyph indicates the glyph that precedes the Unicode string.
| |
The index into the
uniText array in a PDEGlyphRun object. | |
The number of Unicode characters in the span starting from
firstUniChar . This count can be zero, indicating there are no Unicode values for the range of glyphs. | |
|
| |
A pointer to array of spans corresponding to the PDEGlyphRun object.
| |
The count of spans in the
spans array. | |
|
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.
PDESpanSetP
PDEFontAddGlyphs(
IN
PDEFont
pdeFont
,
IN
PDEGlyphRunP
glyphRun
,
IN
ASUns32
flags
);
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.
|
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 the description of Embedded Font Programs in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO).
The caller must close fontStm
with ASStmClose() after invoking PDEFontCreate().
Call PDERelease() to dispose of the returned font object when finished with it.
PDEFont
PDEFontCreate(
IN
PDEFontAttrsP
attrsP
,
IN
ASUns32
attrsSize
,
IN
ASInt32
firstChar
,
IN
ASInt32
lastChar
,
IN
ASInt16
*
widthsP
,
IN
char
*
*
encoding
,
IN
ASAtom
encodingBaseName
,
IN
ASStm
fontStm
,
IN
ASInt32
len1
,
IN
ASInt32
len2
,
IN
ASInt32
len3
);
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. |
Creates a PDEFont corresponding to a Cos object of type Font.
Call PDERelease() to dispose of the returned font object when finished with it.
PDEFont
PDEFontCreateFromCosObj(
const
CosObj
*
cosObjP
);
cosObjP | IN/OUT The Cos object for which a PDEFont is created.
|
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.
Note: If you want to use WinAnsiEncoding
on UNIX, do not use this method. Use PDEFontCreateFromSysFontWithParams() or PDEFontCreateFromSysFontAndEncoding() instead.
PDEFont
PDEFontCreateFromSysFont(
IN
PDSysFont
sysFont
,
IN
ASUns32
flags
);
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.
|
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.
Note: If you want to use WinAnsiEncoding
on UNIX, use this method or PDEFontCreateFromSysFontWithParams().
PDEFont
PDEFontCreateFromSysFontAndEncoding(
IN
PDSysFont
sysFont
,
IN
PDSysEncoding
sysEnc
,
IN
ASAtom
useThisBaseFont
,
IN
ASUns32
createFlags
);
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.
|
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.
Note: If you want to use WinAnsiEncoding
on UNIX, use this method or PDEFontCreateFromSysFontWithParams().
PDEFont
PDEFontCreateFromSysFontAndEncodingInCosDoc(
IN
PDSysFont
sysFont
,
IN
PDSysEncoding
sysEnc
,
IN
ASAtom
useThisBaseFont
,
IN
ASUns32
createFlags
,
IN
CosDoc
cosDoc
);
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 . |
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.
PDEFont
PDEFontCreateFromSysFontEx(
IN
PDSysFont
sysFont
,
IN
ASUns32
flags
,
IN
ASAtom
snapshotName
,
IN
ASFixed
*
mmDesignVec
);
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.
|
sysFont
. 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.
PDEFont
PDEFontCreateFromSysFontExInCosDoc(
IN
PDSysFont
sysFont
,
IN
ASUns32
flags
,
IN
ASAtom
snapshotName
,
IN
ASFixed
*
mmDesignVec
,
IN
CosDoc
cosDoc
);
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 . |
sysFont
. 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.
Note: If you want to use WinAnsiEncoding
on UNIX, do not use this method. Use PDEFontCreateFromSysFontWithParams() or PDEFontCreateFromSysFontAndEncoding() instead.
PDEFont
PDEFontCreateFromSysFontInCosDoc(
IN
PDSysFont
sysFont
,
IN
ASUns32
flags
,
IN
CosDoc
cosDoc
);
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 . |
sysFont
. 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.
Note: If you want to use WinAnsiEncoding
on UNIX, use this method or PDEFontCreateFromSysFontAndEncoding() instead.
PDEFont
PDEFontCreateFromSysFontWithParams(
IN
PDSysFont
sysFont
,
IN
PDEFontCreateFromSysFontParams
params
);
sysFont | The system font.
|
params | The parameters structure.
|
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 the description of Embedded Font Programs in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO).
The caller must close fontStm
with ASStmClose() after invoking PDEFontCreate().
Call PDERelease() to dispose of the returned font object when finished with it.
PDEFont
PDEFontCreateInCosDoc(
IN
PDEFontAttrsP
attrsP
,
IN
ASUns32
attrsSize
,
IN
ASInt32
firstChar
,
IN
ASInt32
lastChar
,
IN
ASInt16
*
widthsP
,
IN
char
*
*
encoding
,
IN
ASAtom
encodingBaseName
,
IN
ASStm
fontStm
,
IN
ASInt32
len1
,
IN
ASInt32
len2
,
IN
ASInt32
len3
,
IN
CosDoc
cosDoc
);
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 . |
void
PDEFontCreateToUnicodeNow(
IN
PDEFont
font
,
IN
CosDoc
cosDoc
);
font | IN/OUT An object of type PDEFont.
|
cosDoc | IN/OUT The container document.
|
font
. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateWidthsNow() is needed. void
PDEFontCreateWidthsNow(
IN
PDEFont
font
,
IN
CosDoc
cosDoc
);
font | IN/OUT The font for which to create width entries.
|
cosDoc | IN/OUT The container document.
|
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.
PDEFont
PDEFontCreateWithParams(
IN
PDEFontCreateParams
params
);
params | IN/OUT A pointer to a structure containing all font parameters necessary to fully define a font.
|
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.
PDEFont
PDEFontCreateWithParamsInCosDoc(
IN
PDEFontCreateParams
params
,
IN
CosDoc
cosDoc
);
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 . |
void
PDEFontEmbedNow(
IN
PDEFont
font
,
IN
CosDoc
cosDoc
);
font | The font to embed.
|
cosDoc | The container document.
|
willSubset
flag but changed your mind. void
PDEFontEmbedNowDontSubset(
IN
PDEFont
font
,
IN
CosDoc
cosDoc
);
font | The font to embed.
|
cosDoc | The container document.
|
Note: PDEFontGetAttrs() cannot fill in the cantEmbed
and protection
fields. PDSysFontAttrs() can return this information to you for system fonts.
Note: PDEFontGetAttrs() fills in the fontBBox
portion of the PDEFontAttrs as ASInt16 objects, even though the member says it is an ASFixedRect. Make sure to properly convert those values using ASInt16ToFixed() so that you get the proper ASFixedRect associated with that font.
void
PDEFontGetAttrs(
IN
PDEFont
font
,
OUT
PDEFontAttrsP
attrsP
,
IN
ASUns32
attrsSize
);
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. |
void
PDEFontGetCosObj(
IN
PDEFont
font
,
OUT
CosObj
*
cosObjP
);
font | IN/OUT A PDEFont whose Cos object is obtained.
|
cosObjP | IN/OUT (Filled by the method) The Cos object corresponding to
font . |
ASUns32
PDEFontGetCreateNeedFlags(
IN
PDEFont
font
);
font | The font object.
|
ASInt16
PDEFontGetNumCodeBytes(
IN
PDEFont
font
,
IN
ASUns8
*
text
,
IN
ASInt32
len
);
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.
|
ASBool
PDEFontGetOneByteEncoding(
IN
PDEFont
font
,
OUT
ASAtom
*
encodingDelta
);
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. For more information about font encodings see the description of Base Encoding in the Character Encoding section of the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.6.6, page 262. The array must be allocated to hold 256 entries.
|
PDSysEncoding
PDEFontGetSysEncoding(
IN
PDEFont
pdeFont
);
pdeFont | A PDEFont whose system encoding is found.
|
PDSysFont
PDEFontGetSysFont(
IN
PDEFont
pdeFont
);
pdeFont | A PDEFont whose system font is found.
|
void
PDEFontGetWidths(
IN
PDEFont
font
,
OUT
ASInt16
*
widthsP
);
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. |
void
PDEFontGetWidthsNow(
IN
PDEFont
font
,
IN
CosDoc
cosDoc
);
font | The font whose widths are found.
|
cosDoc | The container document.
|
ASBool
PDEFontIsEmbedded(
IN
PDEFont
pdeFont
);
pdeFont | A PDEFont object to test.
|
ASBool
PDEFontIsMultiByte(
IN
PDEFont
font
);
font | IN/OUT A PDEFont object returned from one of the
PDEFontCreate methods to test. |
Note: Changing the system encoding may produce unexpected results.
void
PDEFontSetSysEncoding(
IN
PDEFont
pdeFont
,
IN
PDSysEncoding
sysEnc
);
pdeFont | A PDEFont whose system encoding is set.
|
sysEnc | The new system encoding object.
|
void
PDEFontSetSysFont(
IN
PDEFont
pdeFont
,
IN
PDSysFont
sysFont
);
pdeFont | A PDEFont whose system font is set.
|
sysFont | The new system font object.
|
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.
Note: This method does not change the reference count.
void
PDEFontSubsetNow(
IN
PDEFont
font
,
IN
CosDoc
cosDoc
);
font | IN/OUT The PDEFont to subset.
|
cosDoc | IN/OUT The CosDoc whose font is subsetted.
|
len
characters from a string of single or multi-byte characters. ASInt32
PDEFontSumWidths(
IN
PDEFont
font
,
IN
ASUns8
*
text
,
IN
ASInt32
len
);
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.
|
ASUns32
PDEFontTranslateGlyphIdsToUnicode(
IN
PDEFont
font
,
IN
ASUns8
*
text
,
IN
ASUns32
textLen
,
OUT
ASUns8
*
unicodeStr
,
IN
ASUns32
size
);
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. |
0
if the string was successfully translated. If unicodeStr
is too small for the translated string, it returns the number of bytes required. void
PDEReleaseSpan(
IN
PDESpanSetP
pdeSpan
);