WT_Embedded_Font Class Reference
[Support objects]

#include <embedded_font.h>

Inheritance diagram for WT_Embedded_Font:

Inheritance graph
[legend]
Collaboration diagram for WT_Embedded_Font:

Collaboration graph
[legend]
List of all members.

Detailed Description

Contains an embedded font as defined and/or created by the Microsoft OpenType Font Embedding SDK.

Note:
The data in this object is only briefly documented here as it is necessary for WHIP! authors creating embedded fonts to licence the Microsoft OpenType Font Embedding SDK from Microsoft. The documentation therein explains in detail how to create embedded fonts. The structures, variables and enumerations in this object track very closely with the embedding SDK and thus copious detail is herein omitted.
An example of creating embedded fonts is provided in the sample app W2DTest accompanying the WHIP! Toolkit source distribution. It is too lengthy to be included here in this API doc.

Deprecated:
Clients should embed font subsets in the DWF package, rather than in a W2D stream

Definition at line 47 of file embedded_font.h.

Public Types

enum  WT_Request_Format {
  Raw = 0x00000001, Subset = 0x00000002, Compressed = 0x00000004, Fail_If_Variations_Simulated = 0x00000008,
  Eudc = 0x00000010, Validation_Tests = 0x00000020, Web_Object = 0x00000040, Encrypt_Data = 0x00000080
}
 Font embedding request values. More...
enum  WT_Character_Set { Unicode = 0x00000001, Symbol = 0x00000002, Glyphidx = 0x00000003 }
 Font embedding character set values. More...
enum  WT_Privilege { PreviewPrint = 0x00000001, Editable = 0x00000002, Installable = 0x00000003, Non_Embedding = 0x00000004 }
 The license granted to the font embedding app. More...

Public Member Functions

 WT_Embedded_Font ()
 Constructs a WT_Embedded_Font object.
 WT_Embedded_Font (int request_type, int privilege_type, int character_set_type)
 Constructs a WT_Embedded_Font object with the given data.
 WT_Embedded_Font (int request_type, int privilege_type, int character_set_type, WT_Integer32 data_size, WT_Byte *data, WT_Boolean copy) throw (WT_Result)
 Constructs a WT_Embedded_Font object with the given data.
 WT_Embedded_Font (int request_type, int privilege_type, int character_set_type, WT_Integer32 data_size, WT_Byte *data, WT_Integer32 font_type_face_name_length, WT_Byte *font_type_face_name_string, WT_Integer32 font_logfont_name_length, WT_Byte *font_logfont_name_string, WT_Boolean copy) throw (WT_Result)
 Constructs a WT_Embedded_Font object with the given data.
virtual ~WT_Embedded_Font ()
 Destroys a WT_Embedded_Font object.
const WT_Bytecharacter_set_type () const
 Returns the character set type (one of the values in enum WT_Character_Set.).
WT_Bytecharacter_set_type ()
WT_Byte *const & data () const
 Returns a read-only pointer to the raw font data.
WT_Byte *& data ()
const WT_Integer32data_size () const
 Returns the size (in bytes) of the raw font data.
WT_Integer32data_size ()
const WT_Integer32font_type_face_name_length () const
 The length of the cannonical font name string.
WT_Integer32font_type_face_name_length ()
WT_Byte *const & font_type_face_name_string () const
 A buffer holding the cannonical font name string (ASCII).
WT_Byte *& font_type_face_name_string ()
const WT_Integer32font_logfont_name_length () const
 The length of the logfont name string.
WT_Integer32font_logfont_name_length ()
WT_Byte *const & font_logfont_name_string () const
 A buffer holding the logfont name string (ASCII).
WT_Byte *& font_logfont_name_string ()
const WT_Byteprivilege () const
 The embedding privilege value (one of the values in enum WT_Privilege.).
WT_Byteprivilege ()
const WT_Unsigned_Integer32request_type () const
 The embedding request value (a combination of zero or more values in enum WT_Request_Format.).
WT_Unsigned_Integer32request_type ()
WT_ID object_id () const
 Returns the WT_ID for this object.
WT_Type object_type () const
 Returns the WT_Type for this object.
WT_Result materialize (WT_Opcode const &opcode, WT_File &file)
 Materializes the contents of the object from the file and the given opcode.
WT_Result process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
WT_Result skip_operand (WT_Opcode const &opcode, WT_File &file)
 Causes the file reading to proceed to the end of this object.
WT_Result serialize (WT_File &file) const
 Causes the serialization of the object to the file.

Static Public Member Functions

static WT_Result default_process (WT_Embedded_Font &item, WT_File &file)
 Provides a default action handler for this object.

Protected Attributes

WT_Boolean m_local_data_copy

Friends

class WT_W2D_Class_Factory
class WT_Opcode


Member Enumeration Documentation

enum WT_Embedded_Font::WT_Character_Set
 

Font embedding character set values.

Enumerator:
Unicode  Unicode character set, requiring 16-bit character encoding.
Symbol  Symbol character set, requiring 16-bit character encoding.
Glyphidx  Indicates that subset values passed are to be interpreted as glyph id’s (rather than unicode values).

Definition at line 75 of file embedded_font.h.

enum WT_Embedded_Font::WT_Privilege
 

The license granted to the font embedding app.

Enumerator:
PreviewPrint  Preview and Print Embedding.
Editable  Editable Embedding.
Installable  Installable Embedding.
Non_Embedding  Restricted License Embedding.

Definition at line 86 of file embedded_font.h.

enum WT_Embedded_Font::WT_Request_Format
 

Font embedding request values.

Enumerator:
Raw  The font structure contains the full character set, non-compressed. This is the default behavior.
Subset  The font structure is a subset containing only the glyphs indicated. The character codes are denoted as 16-bit Unicode values.
Compressed  The font structure is compressed.
Fail_If_Variations_Simulated  In some cases, a client will want to avoid embedding simulated fonts, especially if the normal instance of the typeface is being embedded. If this flag is set and the font in the DC is simulated, TTEmbedFont( ) will fail, generating the error E_FONTVARIATIONSIMULATED.
Eudc  Embed EUDC font. If there is typeface EUDC embed it; otherwise embed system EUDC.
Validation_Tests  The validity of font file should be confirmed before embedding.
Web_Object  Not used.
Encrypt_Data  Font data in the embedded object was encrypted when compression was being performed.

Definition at line 54 of file embedded_font.h.


Constructor & Destructor Documentation

WT_Embedded_Font::WT_Embedded_Font int  request_type,
int  privilege_type,
int  character_set_type,
WT_Integer32  data_size,
WT_Byte data,
WT_Boolean  copy
throw (WT_Result) [inline]
 

Constructs a WT_Embedded_Font object with the given data.

Parameters:
request_type  The embedding request value (a combination of zero or more values in enum WT_Request_Format.)
privilege_type  The embedding privilege value (one of the values in enum WT_Privilege.)
character_set_type  Sets the character code value (one of the values in enum WT_Character_Set.)
data_size  The size of the embedded font data in bytes.
data  A buffer containing the embedded font data.
copy  Whether the data should be copied or if its content should be used directly from the array.

Definition at line 191 of file embedded_font.h.

WT_Embedded_Font::WT_Embedded_Font int  request_type,
int  privilege_type,
int  character_set_type,
WT_Integer32  data_size,
WT_Byte data,
WT_Integer32  font_type_face_name_length,
WT_Byte font_type_face_name_string,
WT_Integer32  font_logfont_name_length,
WT_Byte font_logfont_name_string,
WT_Boolean  copy
throw (WT_Result) [inline]
 

Constructs a WT_Embedded_Font object with the given data.

Parameters:
request_type  The embedding request value (a combination of zero or more values in enum WT_Request_Format.)
privilege_type  The embedding privilege value (one of the values in enum WT_Privilege.)
character_set_type  Sets the character code value (one of the values in enum WT_Character_Set.)
data_size  The size of the embedded font data in bytes.
data  A buffer containing the embedded font data.
font_type_face_name_length  The length of the cannonical font name string specified by the font_type_face_name_string buffer.
font_type_face_name_string  A buffer holding the cannonical font name string (ASCII).
font_logfont_name_length  The length of the logfont name string specified by the font_logfont_name_string buffer.
font_logfont_name_string  A buffer holding the logfont name string (ASCII).
copy  Whether the data should be copied or if its content should be used directly from the array.

Definition at line 235 of file embedded_font.h.


Member Function Documentation

static WT_Result WT_Embedded_Font::default_process WT_Embedded_Font item,
WT_File file
[static]
 

Provides a default action handler for this object.

Warning:
This is used by the framework and should not be called by client code.
Parameters:
item  The object to process.
file  The file being read.

WT_Result WT_Embedded_Font::materialize WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Materializes the contents of the object from the file and the given opcode.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Opcode_Not_Valid_For_This_Object The object does not support the opcode type.
WT_Result::Internal_Error Something went very wrong.

Implements WT_Object.

WT_Result WT_Embedded_Font::process WT_File file  )  [virtual]
 

Calls the configured action handler for this object (passes in the file reference.).

Warning:
This is used by the framework and should not be called by client code.

Implements WT_Object.

WT_Result WT_Embedded_Font::serialize WT_File file  )  const [virtual]
 

Causes the serialization of the object to the file.

If this is a WT_Drawable derived object, this method may cause the object to be delayed (in case a coincident like-object follows) and/or merged (in case a coincident like-object preceeded) so as to optimize the output.

Return values:
WT_Result::Success The operation was successful.

Implements WT_Object.

WT_Result WT_Embedded_Font::skip_operand WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Bug:
Not all objects perform skip_operand() correctly; this is a known problem. For best results, if client code must use WT_File::get_next_object_shell() manually, it should also call the corresponding WT_Object::materialize() method to avoid this problem.
See also:
WT_File::get_next_object_shell(), WT_File_Heuristics::set_deferred_delete().

Reimplemented from WT_Object.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:17 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5