- Fixed a memory leak found by vroad.
CGUITTFont* fontTTF = NULL;
fontTTF->createTTFont(_environment, "fonts/times.ttf", 20, false, false);
IGUIFont* font = fontTTF;
irr::gui::IGUIButton* button = _device->getGUIEnvironment()->addButton(irr::core::rect<irr::s32>(0,0,200,100),0,1,L"salut",L"tooltip");
button->setOverrideFont(fontTTF);hilnius wrote:Hi
This stuff seems to be great, but it doesn't work on my PC...
i installed everything, files compiles well (on Code::blocks)
but the code
- Code: Select all
CGUITTFont* fontTTF = NULL;
fontTTF->createTTFont(_environment, "fonts/times.ttf", 20, false, false);
IGUIFont* font = fontTTF;
irr::gui::IGUIButton* button = _device->getGUIEnvironment()->addButton(irr::core::rect<irr::s32>(0,0,200,100),0,1,L"salut",L"tooltip");
button->setOverrideFont(fontTTF);
does not change my button's Font...
I got freetype6.dll, and installed freetype on my computer;
So can you tell me if it is a bug or if i didnt load it in the good way.
Thanks
Hilnius
CGUITTFont* fontTTF = CGUITTFont::createTTFont(_environment, "fonts/times.ttf", 20, false, false);
Sc\303\251nario
const char* initial = q.fieldValue("trad_label"); // the initial string
const uchar8_t* transtyped = (uchar8_t*) initial;
ustring test(transtyped);
stringw otherTest = test.toUTF8_s();
stringw anotherTest = test.toWCHAR_s();
SSJ17Vegeta wrote:The problem rises when I'm retrieving data from a UTF-8 encoded SQLite3 database. Let's say, for example, that i'm receiving the string for the french translation of the word "scenario", which is : "scénario".
When looking in the debugger, the string I'm receiving ( of type const char* ), looks like that :
- Code: Select all
Sc\303\251nario
SSJ17Vegeta wrote:
- Code: Select all
stringw otherTest = test.toUTF8_s();
guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", rect<s32>(10,10,260,22), true);if(tt_font)
skin->setFont(tt_font);
#include <irrlicht.h>
#include "CGUITTFont.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device = createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16, false, false, false, 0);
if (!device)
return 1;
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
gui::CGUITTFont* tt_font = gui::CGUITTFont::createTTFont(guienv, "comic.ttf", 14, true, false);
gui::IGUISkin* skin = guienv->getSkin();
if(tt_font)
skin->setFont(tt_font);
guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", rect<s32>(10,10,260,22), true);
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
core::ustring test("This is a test \xEF\xBF\xBD okay?");
test += 10400;
// Returns 3.
int s_count = std::count(test.begin(), test.end(), 's');
// Returns 2.
int non_ascii_count = std::count_if(test.begin(), test.end(), [](uchar32_t val) -> uchar32_t { return val > 127; });
Return to Project Announcements
Users browsing this forum: No registered users and 1 guest