TTEmbedFontEx function

Creates a font structure containing the subsetted UCS-4 character (32-bit) font. The current font of the device context (hDC) provides the font information.

This function passes the data to a client-defined callback routine for insertion into the document stream.

TTEmbedFontEx is used the same way as TTEmbedFont, but accepts a character code set given in UCS-4 (32 bits).

Syntax


LONG TTEmbedFontEx(
  _In_     HDC            hDC,
  _In_     ULONG          ulFlags,
  _In_     ULONG          ulCharSet,
  _Out_    ULONG          *pulPrivStatus,
  _Out_    ULONG          *pulStatus,
           WRITEEMBEDPROC lpfnWriteToStream,
  _In_     LPVOID         lpvWriteStream,
  _In_     ULONG          *pulCharCodeSet,
  _In_     USHORT         usCharCodeCount,
  _In_     USHORT         usLanguage,
  _In_opt_ TTEMBEDINFO    *pTTEmbedInfo
);

Parameters

hDC [in]

Device context handle.

ulFlags [in]

Flag specifying the embedding request. This flag can have zero or more of the following values.

ValueMeaning
TTEMBED_EMBEDEUDC

Include the associated EUDC font file data with the font structure.

TTEMBED_RAW

Return a font structure containing the full character set, non-compressed. This is the default behavior of the function.

TTEMBED_SUBSET

Return a subsetted font containing only the glyphs indicated by the pusCharCodeSet or pulCharCodeSet parameter. These character codes must be denoted as 16-bit or UCS-4 characters as appropriate for the parameter.

TTEMBED_TTCOMPRESSED

Return a compressed font structure.

 

ulCharSet [in]

Flag specifying the character set of the font to be embedded. This flag can have one of the following values.

ValueMeaning
CHARSET_UNICODE

Unicode character set, requiring 16-bit character encoding.

CHARSET_SYMBOL

Symbol character set, requiring 16-bit character encoding.

 

pulPrivStatus [out]

Pointer to flag indicating embedding privileges of the font. This flag can have one of the following values. This function returns the least restrictive license granted.

ValueMeaning
EMBED_PREVIEWPRINT

Preview and Print Embedding.

EMBED_EDITABLE

Editable Embedding.

EMBED_INSTALLABLE

Installable Embedding.

EMBED_NOEMBEDDING

Restricted License Embedding.

 

pulStatus [out]

Pointer to a bitfield containing status information about the embedding request. This field is filled upon completion of this function. No bits are currently defined for this parameter.

lpfnWriteToStream

Pointer to the client-defined callback function which writes the font structure to the document stream. See WRITEEMBEDPROC.

lpvWriteStream [in]

A token to represent the output stream.

pulCharCodeSet [in]

Pointer to the buffer containing the optional UCS-4 character codes for subsetting. This field is only used for subsetting a font and is ignored if the ulFlags field does not specify TTEMBED_SUBSET.

usCharCodeCount [in]

The number of characters in the list of characters indicated by pulCharCodeSet. This field is only used for subsetting a font and is ignored if the ulFlags field does not specify TTEMBED_SUBSET.

usLanguage [in]

Specifies which language in the name table to keep when subsetting. Set to 0 to keep all languages. This field is only used for subsetting a font and is ignored if the ulFlags field does not specify TTEMBED_SUBSET.

pTTEmbedInfo [in, optional]

Pointer to a TTEMBEDINFO structure containing the URLs from which the embedded font object may be legitimately referenced. If pTTEmbedInfo is NULL, no URLs will be added to the embedded font object and no URL checking will occur when the client calls TTLoadEmbeddedFont.

Return value

If the embedding is successful, returns E_NONE.

The font structure is incorporated into the document stream by the client.

pulPrivStatus is set, indicating the embedding privileges of the font; and pulStatus is set to provide results of the embedding operation.

Otherwise, returns an error code described in Embedding-Function Error Messages.

Remarks

This function references a client-defined callback routine for embedding the font structure into the document stream.

Clients are responsible for determining and indicating the character set of the font.

For information on embedding Unicode characters, see TTEmbedFont; for information on embedding Unicode characters from a file, see TTEmbedFontFromFileA.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

T2embapi.h

Library

T2embed.lib

DLL

T2embed.dll

See also

TTEMBEDINFO
TTEmbedFont
TTEmbedFontFromFileA
TTLoadEmbeddedFont

 

 

Show: