Error : using Font
Posted: Wed Feb 23, 2005 08:29
(If the topic has already existed ,I am sorry for repeatting . )
Hi , look at the following code:
utf8* insertGlyphs = (utf8*)"[color=FF0000]CEGUI世界你好[/color]";
CEGUI::Font * font = CEGUI::System::getSingleton().getDefaultFont() ;
try{
CEGUI::String glyphSets(font->getAvailableGlyphs());
glyphSets += insertGlyphs ;
font->defineFontGlyphs(glyphSets);
}catch (CEGUI::Exception & e )
{
// skip the exception and go on
}
The program will not work nicely , words will be lost on the widget
and the excptions said:
Exception: Imageset::defineImage - An image with the name [color=FF0000]'C' already exists[/color] in Imageset 'SimHei-10_auto_glyph_images'.
........
So if some character has already existed , how can I insert Glyphs into the Font dynamicly ? Such as when chatting .
Hi , look at the following code:
utf8* insertGlyphs = (utf8*)"[color=FF0000]CEGUI世界你好[/color]";
CEGUI::Font * font = CEGUI::System::getSingleton().getDefaultFont() ;
try{
CEGUI::String glyphSets(font->getAvailableGlyphs());
glyphSets += insertGlyphs ;
font->defineFontGlyphs(glyphSets);
}catch (CEGUI::Exception & e )
{
// skip the exception and go on
}
The program will not work nicely , words will be lost on the widget
and the excptions said:
Exception: Imageset::defineImage - An image with the name [color=FF0000]'C' already exists[/color] in Imageset 'SimHei-10_auto_glyph_images'.
........
So if some character has already existed , how can I insert Glyphs into the Font dynamicly ? Such as when chatting .