Help!! How can I create my own font class?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

q68576021
Just popping in
Just popping in
Posts: 3
Joined: Sun Aug 02, 2009 09:27

Help!! How can I create my own font class?

Postby q68576021 » 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)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Help!! How can I create my own font class?

Postby CrazyEddie » Sat Aug 08, 2009 08:33

It looks like you're not linking against the CEGUIBase lib.

CE.

q68576021
Just popping in
Just popping in
Posts: 3
Joined: Sun Aug 02, 2009 09:27

Re: Help!! How can I create my own font class?

Postby q68576021 » Sat Aug 08, 2009 09:14

CrazyEddie wrote:It looks like you're not linking against the CEGUIBase lib.

CE.


but i have linked to it. if i don't use this class, the cegui performs very well in my game.I don't know what happened

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Help!! How can I create my own font class?

Postby CrazyEddie » Sat Aug 08, 2009 09:33

Yeah, I just looked at the code for CEGUI::FreeTypeFont - it turns out we're not exporting the symbols from the DLL (because further subclassing is not actually the intended usage of those classes).

As a slight aside, the latest trunk code for CEGUI has some support for coloured text (along with lots of other things) - it's not interface compatible with the old version though and the code is still being debugged and tuned.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests