00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __FONTSIZE_H__
00021 #define __FONTSIZE_H__
00022
00023 #include <vrs/sharedobj.h>
00024
00025 #include <vrs/text/vrs_textprerequisites.h>
00026
00028 namespace VRS
00029 {
00030 namespace TEXT
00031 {
00034 class VRS_CORE_API FontSize : public SharedObj
00035 {
00036 public:
00038 FontSize( );
00040 FontSize( float value, bool absolute );
00042 FontSize( SO<FontSize> size );
00044 virtual ~FontSize();
00045
00047 static SO<FontSize> fromPoint( float points );
00049 static SO<FontSize> fromPixel( float pixels );
00051 static SO<FontSize> fromMillimeter( float mm );
00053 static SO<FontSize> fromInch( float inch );
00055 static SO<FontSize> fromCentimeter( float cm );
00056
00058 float toPoint( unsigned int dpi ) const;
00060 float toPixel( unsigned int dpi ) const;
00062 float toMillimeter( unsigned int dpi ) const;
00064 float toInch( unsigned int dpi ) const;
00066 float toCentimeter( unsigned int dpi ) const;
00067
00069 bool isAbsolute() const;
00071 float getSizeValue() const;
00072
00073 VRS_TYPEINFO(FontSize, SharedObj);
00074 VRS_SERIALIZABLE(FontSize);
00075 private:
00077 float m_SizeValue;
00079 bool m_Absolute;
00080 };
00081 }
00082 }
00083
00084 #endif