TrueType font Support by FreeType Library
-
- Posts: 8
- Joined: Sat Apr 12, 2008 4:14 pm
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.
En tierrra de ciegos, el tuerto es rey.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
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...
as the online tut said i put #include FT_FREETYPE_H instead #include <freetype/freetype.h> but the problem seems not to be there...
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
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
In 2.35 it was in objs. Don't know about 2.37.EvIl_DeViL wrote:the latest version (2.3.7) hasn't a library or a library directory...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
I don't understand what i have to link as library
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
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
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...
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'
I hope all these posts will be useful also for someone else...
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.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
-
- Posts: 135
- Joined: Thu Oct 30, 2008 11:56 am
- Location: UK
- Contact:
decent TT loader
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
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]
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);