Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

WT_Font Class Reference
[ class]

#include <font.h>

Inheritance diagram for WT_Font:

Inheritance graph
[legend]
Collaboration diagram for WT_Font:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the current text font.

See also:
WT_Rendition

WT_Text

Font options

Font.cpp

See also:
See the embedded fonts example provided in the sample app W2DTest accompanying the WHIP! Toolkit source distribution.

Definition at line 43 of file font.h.

Public Types

enum  Font_Options
 Bit mask describing which font options have been defined by this font.

Public Member Functions

Construction
 WT_Font ()
 Constructs a WT_Font object.
 WT_Font (WT_String name, WT_Boolean bold, WT_Boolean italic, WT_Boolean underline, WT_Byte charset, WT_Byte pitch, WT_Byte family, WT_Integer32 height, WT_Unsigned_Integer16 rotation, WT_Unsigned_Integer16 width_scale, WT_Unsigned_Integer16 spacing, WT_Unsigned_Integer16 oblique, WT_Integer32 flags=0)
 Constructs a WT_Font object from the given data.
Font option read-only accessor methods
The following methods provide read-only access to the font options.

WT_Font_Option_Charset const & charset () const
WT_Font_Option_Family const & family () const
WT_Font_Option_Flags const & flags () const
WT_Font_Option_Font_Name const & font_name () const
WT_Font_Option_Height const & height () const
WT_Font_Option_Oblique const & oblique () const
WT_Font_Option_Pitch const & pitch () const
WT_Font_Option_Rotation const & rotation () const
WT_Font_Option_Spacing const & spacing () const
WT_Font_Option_Style const & style () const
WT_Font_Option_Width_Scale
const & 
width_scale () const
Font option accessor methods
The following methods provide writable access to the font options.

WT_Font_Option_Charsetcharset ()
WT_Font_Option_Familyfamily ()
WT_Font_Option_Flagsflags ()
WT_Font_Option_Font_Namefont_name ()
WT_Font_Option_Heightheight ()
WT_Font_Option_Obliqueoblique ()
WT_Font_Option_Pitchpitch ()
WT_Font_Option_Rotationrotation ()
WT_Font_Option_Spacingspacing ()
WT_Font_Option_Stylestyle ()
WT_Font_Option_Width_Scalewidth_scale ()
Data access methods
WT_Unsigned_Integer16 fields_defined () const
 Returns the bitmask indicating which font options are defined (one or more of enum Font_Options.
void set_fields_defined (WT_Unsigned_Integer16 fields)
 Sets the bitmask indicating which font options are defined (one or more of enum Font_Options.
WT_Font const & operator= (WT_Font const &font)
 Assignment operator. Copies the given font settings to this one.
WT_Object and WT_Attribute virtual methods
WT_ID object_id () const
 Returns the WT_ID 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
 Forces the serialization of the object to the file.
WT_Result sync (WT_File &file) const
 Serializes the attribute out to the file, if necessary.
WT_Boolean operator== (WT_Attribute const &attrib) const
 Returns WD_True if the attributes are equal.

Static Public Member Functions

static WT_Result default_process (WT_Font &item, WT_File &file)
 Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).


Constructor & Destructor Documentation

WT_Font::WT_Font WT_String  name,
WT_Boolean  bold,
WT_Boolean  italic,
WT_Boolean  underline,
WT_Byte  charset,
WT_Byte  pitch,
WT_Byte  family,
WT_Integer32  height,
WT_Unsigned_Integer16  rotation,
WT_Unsigned_Integer16  width_scale,
WT_Unsigned_Integer16  spacing,
WT_Unsigned_Integer16  oblique,
WT_Integer32  flags = 0
 

Constructs a WT_Font object from the given data.

Parameters:
name  Font name.
bold  Boldface option.
italic  Italics option.
underline  Underline option.
charset  Character set code as defined in WT_Font_Option_Charset::Font_Charset_Code.
pitch  Pitch bitmask as defined in WT_Font_Option_Pitch::Font_Pitch_Flags.
family  Font family as defined in WT_Font_Option_Pitch::Font_Family_Flags.
height  Font height in drawing units.
rotation  Font rotation in 360/65636ths of a degree.
width_scale  The desired width scaling (multiplied by 1024) to be applied to the font. A value of 1024 indicates no scaling, whereas 2048 indicates a font twice as wide as normal, and 512 indicates a font 1/2 as wide as normal. May range from a value of one (1/1024 of normal) to 65535 (64 times normal).
spacing  The desired inter-character spacing scale (multiplied by 1024) to be applied to the font. A value of 1024 indicates normal inter-character spacing, whereas 2048 indicates spacing that is twice as wide as normal, and 512 indicates spacing that is 1/2 as wide as normal. May range from a value of one (1/1024 of normal) to 65535 (64 times normal).
oblique  The desired rotation of the individual characters within the font in 360/65636ths of a degree. Note that rotation describes how the entire string is rotated, whereas oblique rotates the characters in place.
flags  RESERVED. The font flags are rarely used.


Member Function Documentation

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

Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

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

WT_Result WT_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_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_Font::serialize WT_File file  )  const [virtual]
 

Forces the serialization of the object to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.

Implements WT_Attribute.

WT_Result WT_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.

WT_Result WT_Font::sync WT_File file  )  const [virtual]
 

Serializes the attribute out to the file, if necessary.

Only outputs relevant desired rendition changes to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
See also:
WT_File::desired_rendition().

Implements WT_Attribute.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:07:53 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1