Page 1 of 1

Unable to load dejavusans.ttf

Posted: 16 Apr 2008, 01:48
by allenmoatallen
I am getting this error from the 0.1.0 version, I understand it is still under development I was just curious if this particular error has been fixed, it compiles fine and has no exceptions (on mac os x)

Error: Unable to load dejavusans.ttf: SDLTrueTypeFont::SDLTrueTypeFont: Couldn't open data/fonts/dejavusans.ttf

Re: Unable to load dejavusans.ttf

Posted: 16 Apr 2008, 09:23
by trapdoor
Make sure that the data folder gets copied into the Resource directory of the .app.

--
trapdoor

Re: Unable to load dejavusans.ttf

Posted: 17 Apr 2008, 06:57
by allenmoatallen
Yeah, I checked that afterwards and made sure it got included but it still doesn't find it O.o

Re: Unable to load dejavusans.ttf

Posted: 17 Apr 2008, 09:31
by trapdoor
Can you post your tmw.log?

--
trapdoor

Re: Unable to load dejavusans.ttf

Posted: 17 Apr 2008, 18:32
by allenmoatallen
It says exactly what the app said, can't open data/fonts/dejavusans.ttf

Re: Unable to load dejavusans.ttf

Posted: 17 Apr 2008, 22:24
by trapdoor
Surely it should say what paths it added.

--
trapdoor

Re: Unable to load dejavusans.ttf

Posted: 18 Apr 2008, 01:50
by allenmoatallen
Oh, I understand what you mean lol. I did a fresh clean of my computer (spring cleaning) so when I get it fully up and running tonight, I will post the log.

Re: Unable to load dejavusans.ttf

Posted: 18 Apr 2008, 08:12
by allenmoatallen
Ok, here is tmw.log:

Code: Select all

[08:09:03.52] The Mana World - version not defined
[08:09:03.52] Initializing libxml2...
[08:09:03.52] Initializing configuration...
[08:09:03.52] Initializing SDL...
[08:09:03.53] Initializing resource manager...
[08:09:03.53] Adding to PhysicsFS: /Users/trevor//.tmw
[08:09:03.53] Adding to PhysicsFS: data
[08:09:03.53] Error: File not found
[08:09:03.53] Adding to PhysicsFS: /Users/trevor/Projects/TMW0.1.0/build/Debug/The Mana World.app/Contents/Resources/data
[08:09:03.53] Setting video mode 800x600 windowed
[08:09:03.62] Using OpenGL with double buffering.
[08:09:03.62] OpenGL texture size: 8192 pixels (rectangle textures)
[08:09:03.62] Initializing GUI...
[08:09:03.69] Error: Unable to load dejavusans.ttf: SDLTrueTypeFont::SDLTrueTypeFont: Couldn't open data/fonts/dejavusans.ttf
 

Re: Unable to load dejavusans.ttf

Posted: 18 Apr 2008, 13:04
by trapdoor
The path is an absolute one, passed to SDL_TTF.

This needs to be changed to use physfs.

Find patch below.

Index: src/gui/gui.cpp
===================================================================
--- src/gui/gui.cpp (revision 4123)
+++ src/gui/gui.cpp (working copy)
@@ -107,9 +107,15 @@
Window::setWindowContainer(guiTop);
setTop(guiTop);

+ ResourceManager *resman = ResourceManager::getInstance();
+
// Set global font
try {
- mGuiFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 11);
+ std::string path = resman->getPath("fonts/dejavusans.ttf");
+ if (path != "")
+ {
+ mGuiFont = new TrueTypeFont(path.c_str(), 11);
+ }
}
catch (gcn::Exception e)
{
@@ -119,8 +125,11 @@
// Set speech font
try
{
- // FIXME: use another font?
- speechFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 11);
+ std::string path = resman->getPath("fonts/dejavusans.ttf");
+ if (path != "")
+ {
+ speechFont = new TrueTypeFont(path.c_str(), 11);
+ }
}
catch (gcn::Exception e)
{


--
trapdoor

Re: Unable to load dejavusans.ttf

Posted: 18 Apr 2008, 18:54
by allenmoatallen
Still getting the same error.

and on the other project I am getting these errors, do these mean there is a problem with zlib?

Code: Select all

 [size=85] "__ZN10TabbedAreaC1Ev", referenced from:
      __ZN10ChatWindowC1Ev in chat.o
      __ZN10ChatWindowC2Ev in chat.o
      __ZN11GuildWindowC2Ev in guildwindow.o
      __ZN11GuildWindowC1Ev in guildwindow.o
  "__ZN10TabbedArea9getWidgetERKSs", referenced from:
      __ZN11GuildWindow9setOnlineERKSsS1_b in guildwindow.o
  "__ZN10TabbedArea15getNumberOfTabsEv", referenced from:
      __ZN11GuildWindow6actionERKN3gcn11ActionEventE in guildwindow.o
  "__ZN10TabbedArea6getTabERKSs", referenced from:
      __ZN10ChatWindow9tabExistsERKSs in chat.o
      __ZN10ChatWindow13removeChannelEs in chat.o
      __ZN11GuildWindow9removeTabEi in guildwindow.o
ld: symbol(s) not found
collect2: ld returned 1 exit status[/size]

Re: Unable to load dejavusans.ttf

Posted: 20 Apr 2008, 19:50
by allenmoatallen
I actually have a question for you trapdoor.

as far as the data directory goes on the mac side, how does TMW look for Contents/Resources/data/ ? I am assuming that is where TMW looks for those files once its been built and if not then correct me. Cause my other client can't find the data directory but uses a global declaration to data/ but when run it exits with error status 2 cause it can't find the data file.

Re: Unable to load dejavusans.ttf

Posted: 21 Apr 2008, 08:21
by joeiy
If you go to http://dejavu.sourceforge.net/wiki/index.php/Download and get the file you want and put it in the directory that the program its wants. Have fun :D

Re: Unable to load dejavusans.ttf

Posted: 21 Apr 2008, 10:55
by trapdoor
allenmoatallen wrote:I actually have a question for you trapdoor.

as far as the data directory goes on the mac side, how does TMW look for Contents/Resources/data/ ? I am assuming that is where TMW looks for those files once its been built and if not then correct me. Cause my other client can't find the data directory but uses a global declaration to data/ but when run it exits with error status 2 cause it can't find the data file.
It looks up the path of the .app, and tells physfs to add the path to data inside it, so all data files need to be in the .app/Contents/Resources/data

--
trapdoor

Re: Unable to load dejavusans.ttf

Posted: 21 Apr 2008, 17:16
by allenmoatallen
Ok, that is where all the data files are and it still isn't looking inside the .app for some reason.