Help!! How can I create my own font class?
Posted: Sat Aug 08, 2009 08:01
I want to create my own font class just like this:
class ColorFont:public CEGUI::FreeTypeFont
{
public:
ColorFont(const CEGUI::String& name, const CEGUI::String& fontname,
const CEGUI::String& resourceGroup = "");
void drawTextLine (const CEGUI::String& text, const CEGUI::Vector3& position,
const CEGUI::Rect& clip_rect, const CEGUI::ColourRect& colours, float x_scale = 1.0f, float y_scale = 1.0f);
}
and overwrite the drawTextLine function, so I can change the font colour by the text.
However, when i compile it, these are something wrong , and I don't know how to solve,please help!!! I want a multicolour text.
error LNK2001: 无法解析的外部符号 "protected: __thiscall CEGUI::FreeTypeFont::FreeTypeFont(class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (??0FreeTypeFont@CEGUI@@IAE@ABVString@1@00@Z)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall CEGUI::FreeTypeFont::updateFont(void)" (?updateFont@FreeTypeFont@CEGUI@@MAEXXZ)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CEGUI::FreeTypeFont::rasterize(unsigned int,unsigned int)" (?rasterize@FreeTypeFont@CEGUI@@UAEXII@Z)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall CEGUI::FreeTypeFont::writeXMLToStream_impl(class CEGUI::XMLSerializer &)const " (?writeXMLToStream_impl@FreeTypeFont@CEGUI@@MBEXAAVXMLSerializer@2@@Z)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CEGUI::FreeTypeFont::load(void)" (?load@FreeTypeFont@CEGUI@@UAEXXZ)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "protected: virtual __thiscall CEGUI::FreeTypeFont::~FreeTypeFont(void)" (??1FreeTypeFont@CEGUI@@MAE@XZ)
class ColorFont:public CEGUI::FreeTypeFont
{
public:
ColorFont(const CEGUI::String& name, const CEGUI::String& fontname,
const CEGUI::String& resourceGroup = "");
void drawTextLine (const CEGUI::String& text, const CEGUI::Vector3& position,
const CEGUI::Rect& clip_rect, const CEGUI::ColourRect& colours, float x_scale = 1.0f, float y_scale = 1.0f);
}
and overwrite the drawTextLine function, so I can change the font colour by the text.
However, when i compile it, these are something wrong , and I don't know how to solve,please help!!! I want a multicolour text.
error LNK2001: 无法解析的外部符号 "protected: __thiscall CEGUI::FreeTypeFont::FreeTypeFont(class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (??0FreeTypeFont@CEGUI@@IAE@ABVString@1@00@Z)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall CEGUI::FreeTypeFont::updateFont(void)" (?updateFont@FreeTypeFont@CEGUI@@MAEXXZ)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CEGUI::FreeTypeFont::rasterize(unsigned int,unsigned int)" (?rasterize@FreeTypeFont@CEGUI@@UAEXII@Z)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall CEGUI::FreeTypeFont::writeXMLToStream_impl(class CEGUI::XMLSerializer &)const " (?writeXMLToStream_impl@FreeTypeFont@CEGUI@@MBEXAAVXMLSerializer@2@@Z)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CEGUI::FreeTypeFont::load(void)" (?load@FreeTypeFont@CEGUI@@UAEXXZ)
1>ColorFont.obj : error LNK2001: 无法解析的外部符号 "protected: virtual __thiscall CEGUI::FreeTypeFont::~FreeTypeFont(void)" (??1FreeTypeFont@CEGUI@@MAE@XZ)