More Freetype/FTGL trouble
Hi all,
I've now pulled out my hair one time too many over this, so I'm going to beg for help. I've managed to get FTGL and Freetype setup and working on one machine once, but I can't repeat the feat.
So, the problems are the following:
First, I download the Freetype source. Trying to run ./configure gives me an error message: ": bad interpreter: No such file or directory".
So, I just run make. make install fails, because there's no such target. I get the libfreetype.a spat out, and I add it to my project.
Now, I can't build FTGL, because the Freetype headers can't be found. I dunk it all into /usr/local/include and install the .a into /usr/local/lib. Still no beef.
I've gotten past this point earlier, but I still get a boatload of header problems, since the headers aren't found. I've tried adding /usr/local/include, /usr/local/include/freetype2 and a host of others to the header include paths, but I'm getting nowhere.
I know that a lot of people have managed to setup this correctly, but I'm clearly doing something wrong. All I want is a simple possibility to static-link FTGL into my program. Google doesn't turn up anything about this, and neither does the forum.
Could anyone perhaps help me out?
Thanks,
I've now pulled out my hair one time too many over this, so I'm going to beg for help. I've managed to get FTGL and Freetype setup and working on one machine once, but I can't repeat the feat.
So, the problems are the following:
First, I download the Freetype source. Trying to run ./configure gives me an error message: ": bad interpreter: No such file or directory".
So, I just run make. make install fails, because there's no such target. I get the libfreetype.a spat out, and I add it to my project.
Now, I can't build FTGL, because the Freetype headers can't be found. I dunk it all into /usr/local/include and install the .a into /usr/local/lib. Still no beef.
I've gotten past this point earlier, but I still get a boatload of header problems, since the headers aren't found. I've tried adding /usr/local/include, /usr/local/include/freetype2 and a host of others to the header include paths, but I'm getting nowhere.
I know that a lot of people have managed to setup this correctly, but I'm clearly doing something wrong. All I want is a simple possibility to static-link FTGL into my program. Google doesn't turn up anything about this, and neither does the forum.
Could anyone perhaps help me out?Thanks,
I'm in the same boat. I can't get the FTGL project to work for me. I have Freetype already installed just fine. Anyone got any advice?
I finally just became fed up enough to screw with the /usr/local/include headers to possibly break FT1.
I ended up moving the /usr/local/include/freetype2/freetype folder to /usr/local/include/freetype, that seems to have stopped the endless number of headaches (though again, it may cause some if you also use freetype1). I also kept the original freetype2 folder in /usr/local/include/ to prevent current stuff that might break from breaking.
EDIT: whoops, I meant include instead of lib
I ended up moving the /usr/local/include/freetype2/freetype folder to /usr/local/include/freetype, that seems to have stopped the endless number of headaches (though again, it may cause some if you also use freetype1). I also kept the original freetype2 folder in /usr/local/include/ to prevent current stuff that might break from breaking.
EDIT: whoops, I meant include instead of lib
All, for your convenience, I've packaged a zip file with built versions of freetype, ftgl, glew, and a recent version of OpenAL ( from CVS ) which works on Panther as well as Tiger. The package includes headers, and is really easy to use.
Just unpack it, and put the lib and include folders in the root of your Xcode project, and then set the search paths as follows:![[Image: SearchPaths.png]](http://zakariya.net/shamyl/SearchPaths.png)
The archive is here: http://zakariya.net/shamyl/UsefulLibs.zip
That said, you probably don't need the $(SRCROOT)/ stuff, I didn't put that there... I guess Xcode was being smart. All my other projects using these libs don't use that part, and they build fine.
Since the headers are stored in folders using the archive name, you can include as if it were a framework, e.g.,
Just unpack it, and put the lib and include folders in the root of your Xcode project, and then set the search paths as follows:
![[Image: SearchPaths.png]](http://zakariya.net/shamyl/SearchPaths.png)
The archive is here: http://zakariya.net/shamyl/UsefulLibs.zip
That said, you probably don't need the $(SRCROOT)/ stuff, I didn't put that there... I guess Xcode was being smart. All my other projects using these libs don't use that part, and they build fine.
Since the headers are stored in folders using the archive name, you can include as if it were a framework, e.g.,
Code:
#include <FTGL/FTFont.h>
#include <GL/glew.h>
#include <OpenAL/al.h>
... and so on
Sorry Derek, it wouldn've worked out anyway.
TomorrowPlusX, will you marry me?
TomorrowPlusX, will you marry me?
You are an amorous man, Fenris.
he's MINE Fenris back off!
Seriously TPX, this is useful - everyone always seems to have trouble getting freetype/ftgl to build Thanks!
Seriously TPX, this is useful - everyone always seems to have trouble getting freetype/ftgl to build Thanks!
Well, if anybody's interested, I just this morning finished a text area class which displays text using FTGL with automatic linewrapping, scrollbars, and such. Addmittedly, it's part of a larger framework ( full opengl gui, with layout and queued message delivery ) but the core logic is basically just c++, opengl, and FTGL. So it could easily be adapted to other uses.
Here's a screenshot:
It's not a rich-formatted text display, just 1 color and 1 font. But it does respect "\t" and "\n" and in general works pretty well. It'll be good enough for in-game message display.
( for reference, I'm trying to build a robust gui layer for my engine
)
Here's a screenshot:
It's not a rich-formatted text display, just 1 color and 1 font. But it does respect "\t" and "\n" and in general works pretty well. It'll be good enough for in-game message display.
( for reference, I'm trying to build a robust gui layer for my engine
)
codemattic Wrote:he's MINE Fenris back off!
Seriously TPX, this is useful - everyone always seems to have trouble getting freetype/ftgl to build Thanks!
When people finally fight over me, it's men
I'll accept a beer -- the standard unit of hacker payment.
nice GUI toolkit, TomorrowPlusX -- any plans to make it publically available?
TPX: I'd love to take a peek at your line-wrapping code, because that's been stumping me for quite a while. As for having men fight over you and then asking for beer, I'm not sure that's very tactic.
TomorrowPlusX, your screenshots just keep looking better and better (heck, they started off good!). Your GUI looks really amazing!
[edit] I hope the Fenris love-tryst works out amicably for all those involved here. We certainly don't want any more broken hearts at iDG.
[edit] I hope the Fenris love-tryst works out amicably for all those involved here. We certainly don't want any more broken hearts at iDG.
OneSadCookie Wrote:nice GUI toolkit, TomorrowPlusX -- any plans to make it publically available?
Absolutely. I've tried to make it *fairly* independant of my engine, but it does require certain unavoidable boilerplate to forward mouse events and the like.
What I'll do is post a project with the GUI working. My actual engine is still in development so it's not really worth looking into ( it's a complete rewrite/refactoring/redesign of the engine for Legion, my stillborn game ).
The GUI programming style ought to be familiar to anybody who's worked with Java or Qt layout managers. You basically just attach a layout manager to a widget, and then add child widgets. So long as all the "leaf" widgets ( like buttons, labels, etc ) provide meaningful values for the preferredContentSize method, it lays out pretty well.
My message passing system, however, is a little expensive and meant *only* for GUI notifications... but it is a more or less proper message queue system.
I'll put up a demo project for you guys soon.
OK, as promised, here's a project which includes the text formatting and, in general, the gui api with layout management and so on.
http://zakariya.net/shamyl/WorldEngine.zip
I'd have preferred to hack up a demo with *just* the gui stuff, but the thing is, it's all pretty tied together, since it's all part of an "engine". For reference, there's not much engine there, just the basics, since I'm rewriting Legion from the ground up.
But the gui's pretty solid, at this point, and I'd say more or less ready for public consumption. I spent the last couple days tying up some loose ends in the code and doxygenating it.
The project, as packaged, will build the text demo app in the screenshot.
Now, a few notes:
First, unless you do a deplyment build, you'll have to edit the resource path in main.cpp. Easy enough.
Second, the stuff you're probably interested in is in src/WorldEngine/Hud, specifically, the text layout is in /src/WorldEngine/Hud/Widgets/TextWidget.{h,cpp}
Regarding the architecture, you could probably extract my Hud related classes ( and adapt some of the classes they make use of, like my FontManager, ColorManager, vec2i, etc ), so long as you forward it the proper events, such as key events, mouse events, resizing events, etc.
Of note, my API expects not just a display() call, but also a step() call, since my engine updates the game state at a different rate than it displays. If you don't care about that kind of behavior, you could simply put a call to Hud::step() in Hud::display().
Finally, I make heavy use of a "toolbox" lib (source not included) which I wrote for my AI work, called PANSICore ( Procedural Autonomic Nervous System Interface ). It's not likely much use to any of you, but it includes some useful string functions... the one particularly that I use in my text widget is a string tokenizer, "split". Here's the source,
For reference, "stringlist" is just a typedef'd std::vector< std::string >.
I hope this is useful to people!
http://zakariya.net/shamyl/WorldEngine.zip
I'd have preferred to hack up a demo with *just* the gui stuff, but the thing is, it's all pretty tied together, since it's all part of an "engine". For reference, there's not much engine there, just the basics, since I'm rewriting Legion from the ground up.
But the gui's pretty solid, at this point, and I'd say more or less ready for public consumption. I spent the last couple days tying up some loose ends in the code and doxygenating it.
The project, as packaged, will build the text demo app in the screenshot.
Now, a few notes:
First, unless you do a deplyment build, you'll have to edit the resource path in main.cpp. Easy enough.
Second, the stuff you're probably interested in is in src/WorldEngine/Hud, specifically, the text layout is in /src/WorldEngine/Hud/Widgets/TextWidget.{h,cpp}
Regarding the architecture, you could probably extract my Hud related classes ( and adapt some of the classes they make use of, like my FontManager, ColorManager, vec2i, etc ), so long as you forward it the proper events, such as key events, mouse events, resizing events, etc.
Of note, my API expects not just a display() call, but also a step() call, since my engine updates the game state at a different rate than it displays. If you don't care about that kind of behavior, you could simply put a call to Hud::step() in Hud::display().
Finally, I make heavy use of a "toolbox" lib (source not included) which I wrote for my AI work, called PANSICore ( Procedural Autonomic Nervous System Interface ). It's not likely much use to any of you, but it includes some useful string functions... the one particularly that I use in my text widget is a string tokenizer, "split". Here's the source,
Code:
stringlist split( std::string in, stringlist delimeters )
{
stringlist tokens;
string nonDelimeter;
size_t start = 0, next = string::npos;
while (true)
{
string delim;
for (stringlist::iterator it = delimeters.begin(); it != delimeters.end(); ++it)
{
next = in.find(*it, start);
if (next == start)
{
delim = *it;
break; //get out
}
}
//if we found a delimeter
if (delim.length())
{
start += delim.length();
if (nonDelimeter.length())
{
tokens.push_back(nonDelimeter);
nonDelimeter.clear();
}
tokens.push_back(delim);
}
else
{
nonDelimeter.push_back(in[start]);
start++;
if (start >= in.length()) break;
}
}
return tokens;
}For reference, "stringlist" is just a typedef'd std::vector< std::string >.
I hope this is useful to people!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Xcode and FTGL | hiddenspring81 | 2 | 3,602 |
Apr 26, 2010 08:38 PM Last Post: akb825 |
|
| Anyone run into this problem with FTGL? | wadesworld | 1 | 2,548 |
Apr 21, 2009 02:19 PM Last Post: Oddity007 |
|
| FTGL crash when exiting program | Malarkey | 8 | 4,294 |
Mar 27, 2008 03:33 PM Last Post: Malarkey |
|
| Freetype Demo | kodex | 0 | 2,173 |
Mar 6, 2006 10:27 PM Last Post: kodex |
|
| FTGL point size question | TomorrowPlusX | 3 | 3,097 |
Aug 26, 2005 04:56 AM Last Post: TomorrowPlusX |
|

