TrueType font Support by FreeType Library

A forum to store posts deemed exceptionally wise and useful
Post Reply
Cristian
Posts: 55
Joined: Fri Nov 25, 2005 12:02 pm

Post by Cristian »

here you go, now it works in irrlicht 1.4. That is, if anyone wants it.
http://rapidshare.com/files/100444358/I ... e.zip.html
lobo-tuerto
Posts: 8
Joined: Sat Apr 12, 2008 4:14 pm

Post by lobo-tuerto »

Why don't they include this in the core distribution of Irrlicht? any legal issues with it?
Blog: Lobo tuerto
En tierrra de ciegos, el tuerto es rey.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, it's the additional library dependence and general problems with unicode fonts in Irrlicht.
Xplod
Posts: 32
Joined: Sat Mar 29, 2008 5:48 pm
Contact:

Post by Xplod »

I tried Crisitan's files, but when I add a StaticText, I get a "pure virtual function call" error... Can someone help me?
CuteAlien
Admin
Posts: 9728
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

If it's the same errors than those around 2 pages back in this thread, then just add some empty implementation for those functions.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Xplod
Posts: 32
Joined: Sat Mar 29, 2008 5:48 pm
Contact:

Post by Xplod »

But it gives me no function name :/
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

Now if only I could find a way to convert from OpenType to TrueType... :D
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

Post by EvIl_DeViL »

i'm trying to compile the project with the 2.3.7 version of freetype but a *.a seems to be missed... here is my compiler's output...

Code: Select all

Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"  -I"C:/irrlicht-1.4.2/include"  -I"C:/freetype-2.3.7/src/cache"  -I"C:/freetype-2.3.7/include"   

g++.exe main.o CGUITTFont.o  -o "IrrTrueType.exe" -L"C:/Dev-Cpp/lib" ../../libIrrlicht.a  

CGUITTFont.o(.text+0x28d):CGUITTFont.cpp: undefined reference to `FT_Set_Pixel_Sizes'
CGUITTFont.o(.text+0x2a7):CGUITTFont.cpp: undefined reference to `FT_Load_Glyph'
CGUITTFont.o(.text+0x2db):CGUITTFont.cpp: undefined reference to `FT_Render_Glyph'
CGUITTFont.o(.text+0x70c):CGUITTFont.cpp: undefined reference to `FT_Load_Glyph'
CGUITTFont.o(.text+0xa91):CGUITTFont.cpp: undefined reference to `FT_Init_FreeType'
CGUITTFont.o(.text+0xac4):CGUITTFont.cpp: undefined reference to `FT_New_Face'
CGUITTFont.o(.text+0x1420):CGUITTFont.cpp: undefined reference to `FT_Get_Char_Index'
collect2: ld returned 1 exit status

make.exe: *** [IrrTrueType.exe] Error 1
as the online tut said i put #include FT_FREETYPE_H instead #include <freetype/freetype.h> but the problem seems not to be there...
CuteAlien
Admin
Posts: 9728
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

You include the headers, but you do not seem to link the library. So you need to add -lfreetype and maybe also the library path with -L
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

Post by EvIl_DeViL »

CuteAlien wrote:You include the headers, but you do not seem to link the library. So you need to add -lfreetype and maybe also the library path with -L
the latest version (2.3.7) hasn't a library or a library directory...
I don't understand what i have to link as library
CuteAlien
Admin
Posts: 9728
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

EvIl_DeViL wrote:
CuteAlien wrote:You include the headers, but you do not seem to link the library. So you need to add -lfreetype and maybe also the library path with -L
the latest version (2.3.7) hasn't a library or a library directory...
I don't understand what i have to link as library
In 2.35 it was in objs. Don't know about 2.37.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

Post by EvIl_DeViL »

i build the project i found in
freetype-2.3.7\builds\win32\visualc\freetype.vcproj

it creates a file in
freetype-2.3.7/objs/freetype237MT_D.lib

I linked it to my project but i gets about 500 error
they sounds all like

Code: Select all

Warning: .drectve `/DEFAULTLIB:"LIBCMTD" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized
../../freetype-2.3.7/objs/freetype237MT_D.lib(../../../objs/debug_mt/ftbase.obj)(.text+0x281): undefined reference to `@_RTC_CheckStackVars@8'
../../freetype-2.3.7/objs/freetype237MT_D.lib(../../../objs/debug_mt/ftbase.obj)(.text+0x28e): undefined reference to `_RTC_CheckEsp'
sorry for all this but I want to get it work and I don't know how to do...
I hope all these posts will be useful also for someone else...
CuteAlien
Admin
Posts: 9728
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

That looks like the VisualStudio library. From the code above I would have rather guessed that you would use the gcc compiler. You can't mix them.

I'm no longer sure how I did get the freetype lib compiled on MinGW - I should have written that down :-( I remember now, that this was some work, because the makesystem didn't recognize MinGW correctly. I'm no longer sure, either I had to update some parts of MinGW for this or I had imported the VS project file into codeblocks and adapted it.

Sorry, can't help more right now, if I ever update to 2.37 I will write down which steps I take. If this is for VS I also can't help, haven't got it running there yet.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

Post by EvIl_DeViL »

you're right! I compiled with codeblocks with GNU/gcc compiler! it creates
C:\freetype-2.3.7\objs\libfreetype237.a i linked it and it work!!!
it can't load kochi-gothic-subst.ttf... appz freeze but I don't care... I tried another japanese font and it loads it succeful!! tnx!!
thespecial1
Posts: 135
Joined: Thu Oct 30, 2008 11:56 am
Location: UK
Contact:

decent TT loader

Post by thespecial1 »

thats sweet .. got it working as long as the point size of the font is greater than e.g. 16pt with verdana say like this

Code: Select all

CGUITTFace face;
	face.load(addtopath("verdana.ttf",MEDIA_PATH.c_str()).c_str());
	CGUITTFont *font = new CGUITTFont(driver);
	font->attach(&face,16);
	if (font) env->getSkin()->setFont(font);
is their any reason why when I go to a point size below 14pt it doesnt render the font properly, doesnt matter which one I pick they all look slightly bitty in small sizes.[/code]
Post Reply