#include <libsswf.h>
Public Types | |
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... | |
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 | ParseTag (TagBase::swf_tag_t tag, const Data &data) |
Parse data from a file into a CSMTextSettings tag. | |
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 |
This enumeration is used to define how to render fonts in regard to pixels.
This enumeration is used to list all the text renderers available in a Flash Player.
TagCSMTextSettings::TagCSMTextSettings | ( | void | ) |
This function initializes the CSM Text Settings tag to its defaults. And by default it will not be used.
References CSM_TEXT_GRIDFIT_NO_GRID, CSM_TEXT_RENDERER_NORMAL, f_csm_text_gridfit, f_csm_text_renderer, f_sharpness, and f_thickness.
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.
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.
References CSM_TEXT_GRIDFIT_NO_GRID, CSM_TEXT_RENDERER_NORMAL, f_csm_text_gridfit, f_csm_text_renderer, f_sharpness, and f_thickness.
Referenced by PreSaveCSMTextSettings(), and SaveCSMTextSettings().
ErrorManager::error_code_t TagCSMTextSettings::ParseTag | ( | TagBase::swf_tag_t | tag, | |
const Data & | data | |||
) | [protected] |
This function does nothing since the CSMTextSettings tag has no data.
[in] | tag | The tag that generated this call |
[in] | data | The Data buffer from the Flash file being loaded |
Reimplemented in sswf::TagEditText, and sswf::TagText.
References sswf::ErrorManager::ERROR_CODE_NONE, f_csm_text_gridfit, f_csm_text_renderer, f_sharpness, f_thickness, sswf::Data::GetBits(), sswf::Data::GetLongFloat(), and sswf::TagBaseID::ParseID().
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.
References sswf::ErrorManager::ERROR_CODE_NONE, IsCSMTextSettingsDefined(), and sswf::TagBase::MinimumVersion().
Referenced by sswf::TagText::PreSave(), and sswf::TagEditText::PreSave().
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.
[in] | data | The Data buffer where the tag is saved |
References sswf::ErrorManager::ERROR_CODE_NONE, f_csm_text_gridfit, f_csm_text_renderer, f_sharpness, f_thickness, IsCSMTextSettingsDefined(), sswf::Data::PutByte(), sswf::Data::PutLongFloat(), sswf::TagBaseID::SaveID(), sswf::TagBase::SaveTag(), sswf::TagBase::SWF_TAG_CSM_TEXT_SETTINGS, and sswf::Data::WriteBits().
Referenced by sswf::TagText::Save(), and sswf::TagEditText::Save().
void TagCSMTextSettings::SetGridFit | ( | csm_text_gridfit_t | csm_text_gridfit | ) |
This function is used to define the grid to use with this TagCSMTextSetting.
[in] | csm_text_gridfit | The new grid mode. |
References f_csm_text_gridfit.
void TagCSMTextSettings::SetRenderer | ( | csm_text_renderer_t | csm_text_renderer | ) |
This function is used to define the renderer to use with this TagCSMTextSetting.
[in] | csm_text_renderer | The new renderer. |
References f_csm_text_renderer.
void TagCSMTextSettings::SetSharpness | ( | float | sharpness | ) |
This function is used to define the sharpness to use with this TagCSMTextSetting.
[in] | sharpness | The new sharpness. |
References f_sharpness.
void TagCSMTextSettings::SetThickness | ( | float | thickness | ) |
This function is used to define the thickness to use with this TagCSMTextSetting.
[in] | thickness | The new thickness. |
References f_thickness.
Referenced by IsCSMTextSettingsDefined(), ParseTag(), SaveCSMTextSettings(), SetGridFit(), and TagCSMTextSettings().
Referenced by IsCSMTextSettingsDefined(), ParseTag(), SaveCSMTextSettings(), SetRenderer(), and TagCSMTextSettings().
float sswf::TagCSMTextSettings::f_sharpness [private] |
Referenced by IsCSMTextSettingsDefined(), ParseTag(), SaveCSMTextSettings(), SetSharpness(), and TagCSMTextSettings().
float sswf::TagCSMTextSettings::f_thickness [private] |
Referenced by IsCSMTextSettingsDefined(), ParseTag(), SaveCSMTextSettings(), SetThickness(), and TagCSMTextSettings().