sswf::TagCSMTextSettings Class Reference

Defines extraneous settings for text tags. More...

#include <libsswf.h>

Inheritance diagram for sswf::TagCSMTextSettings:

sswf::TagEditText sswf::TagText List of all members.

Public Types

 CSM_TEXT_GRIDFIT_NO_GRID = 0
 The default value meaning draw text anywhere.
 CSM_TEXT_GRIDFIT_PIXEL = 1
 The simple pixel grid snap feature.
 CSM_TEXT_GRIDFIT_SUBPIXEL = 2
 Use 1/3rd of a pixel to snap the font.
enum  csm_text_gridfit_t { CSM_TEXT_GRIDFIT_NO_GRID = 0, CSM_TEXT_GRIDFIT_PIXEL = 1, CSM_TEXT_GRIDFIT_SUBPIXEL = 2 }
 Defines how to draw points in regard to screen pixels. More...
 CSM_TEXT_RENDERER_FLASH = 1
 Use the special FontType renderer.
 CSM_TEXT_RENDERER_NORMAL = 0
 Use the normal renderer.
enum  csm_text_renderer_t { CSM_TEXT_RENDERER_NORMAL = 0, CSM_TEXT_RENDERER_FLASH = 1 }
 The list of renderer available in the Flash player. More...

Public Member Functions

bool IsCSMTextSettingsDefined (void) const
 Check whether an option is not the default.
void SetGridFit (csm_text_gridfit_t csm_text_gridfit)
 Defines the grid to use.
void SetRenderer (csm_text_renderer_t csm_text_renderer)
 Defines the renderer to use.
void SetSharpness (float sharpness)
 Defines the sharpness to use.
void SetThickness (float thickness)
 Defines the thickness to use.
 TagCSMTextSettings (void)
 Initializes the CSM Text Settings tag.
virtual ~TagCSMTextSettings (void)
 Clean up the TagCSMTextSettings.

Protected Member Functions

ErrorManager::error_code_t PreSaveCSMTextSettings (void)
 Ensure that the minimum version is 8.
ErrorManager::error_code_t SaveCSMTextSettings (Data &data)
 Save the TagCSMTextSettings in the specified Data buffer.

Private Attributes

csm_text_gridfit_t f_csm_text_gridfit
csm_text_renderer_t f_csm_text_renderer
float f_sharpness
float f_thickness

Detailed Description

This object defines extraneous settings to be used with text tags such as DefineText, DefineText2 and DefineEditText.

See also:
sswf::TagEditText

sswf::TagFont

sswf::TagText

SWF Alexis' Reference—CSM Text Settings

SWF Alexis' Reference—swf_tag


Member Enumeration Documentation

enum sswf::TagCSMTextSettings::csm_text_gridfit_t

This enumeration is used to define how to render fonts in regard to pixels.

Enumerator:
CSM_TEXT_GRIDFIT_NO_GRID  The default value meaning draw text anywhere.

This value is the default and lets the renderer draw the font at any position. Very useful if you are scrolling your text horizontally or rotating it.

CSM_TEXT_GRIDFIT_PIXEL  The simple pixel grid snap feature.

This value indicates that fonts should be drawn on a per pixel basis.

There are two problems with this method:

  • Some glyphs will be rendered a little further than they should otherwise be. This can make some words look broken.
  • Moving such fonts in any direction will make it jump if the move is too slow.
CSM_TEXT_GRIDFIT_SUBPIXEL  Use 1/3rd of a pixel to snap the font.

This feature allows for 1/3rd of a pixel snapping system that mostly solves the two problems of the PIXEL Grid Fit.

enum sswf::TagCSMTextSettings::csm_text_renderer_t

This enumeration is used to list all the text renderers available in a Flash Player.

Enumerator:
CSM_TEXT_RENDERER_NORMAL  Use the normal renderer.

This value is used as the default. It will use the older Flash renderer instead of the FontType specialized renderer.

CSM_TEXT_RENDERER_FLASH  Use the special FontType renderer.

This value is used to ask the player to use the new Font Type renderer. This option appeared in SFW version 8.

It is supposed to do a much better job at drawing small fonts.


Constructor & Destructor Documentation

TagCSMTextSettings::TagCSMTextSettings ( void   ) 

This function initializes the CSM Text Settings tag to its defaults. This means it will not be used.

TagCSMTextSettings::~TagCSMTextSettings ( void   )  [virtual]

This function cleans up the CSM Text Settings tag.

Also, the existance of a virtual function makes the TagCSMTextSettings class polymorphic.


Member Function Documentation

bool TagCSMTextSettings::IsCSMTextSettingsDefined ( void   )  const

This function checks all the parameters of the TagCSMTextSettings and returns true if any one of them was modified and thus the tag needs to be saved.

Returns:
True if the tag needs to be saved.

ErrorManager::error_code_t TagCSMTextSettings::PreSaveCSMTextSettings ( void   )  [protected]

This function ensures that the minimum version is 8 if the tag needs to be saved. Otherwise it does nothing.

Returns:
An error code or ErrorManager::ERROR_CODE_NONE.

ErrorManager::error_code_t TagCSMTextSettings::SaveCSMTextSettings ( Data data  )  [protected]

This function checks whether the tag needs to be saved. If not, nothing happens and the function returns immediately. Otherwise, it saves the TagCSMTextSettings.

Parameters:
[in] data The Data buffer where the tag is saved
Returns:
An error code or ErrorManager::ERROR_CODE_NONE.

void TagCSMTextSettings::SetGridFit ( csm_text_gridfit_t  csm_text_gridfit  ) 

This function is used to define the grid to use with this TagCSMTextSetting.

Parameters:
[in] csm_text_gridfit The new grid mode.

void TagCSMTextSettings::SetRenderer ( csm_text_renderer_t  csm_text_renderer  ) 

This function is used to define the renderer to use with this TagCSMTextSetting.

Parameters:
[in] csm_text_renderer The new renderer.

void TagCSMTextSettings::SetSharpness ( float  sharpness  ) 

This function is used to define the sharpness to use with this TagCSMTextSetting.

Parameters:
[in] sharpness The new sharpness.

void TagCSMTextSettings::SetThickness ( float  thickness  ) 

This function is used to define the thickness to use with this TagCSMTextSetting.

Parameters:
[in] thickness The new thickness.


Member Data Documentation

csm_text_gridfit_t sswf::TagCSMTextSettings::f_csm_text_gridfit [private]

csm_text_renderer_t sswf::TagCSMTextSettings::f_csm_text_renderer [private]

float sswf::TagCSMTextSettings::f_sharpness [private]

float sswf::TagCSMTextSettings::f_thickness [private]


The documentation for this class was generated from the following files:
Generated on Tue Jun 26 02:36:45 2007 for libsswf by  doxygen 1.4.7