Unable to load dejavusans.ttf

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Unable to load dejavusans.ttf

Post 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
User avatar
trapdoor
Novice
Novice
Posts: 216
Joined: 18 Feb 2007, 12:36

Re: Unable to load dejavusans.ttf

Post by trapdoor »

Make sure that the data folder gets copied into the Resource directory of the .app.

--
trapdoor
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post by allenmoatallen »

Yeah, I checked that afterwards and made sure it got included but it still doesn't find it O.o
User avatar
trapdoor
Novice
Novice
Posts: 216
Joined: 18 Feb 2007, 12:36

Re: Unable to load dejavusans.ttf

Post by trapdoor »

Can you post your tmw.log?

--
trapdoor
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post by allenmoatallen »

It says exactly what the app said, can't open data/fonts/dejavusans.ttf
User avatar
trapdoor
Novice
Novice
Posts: 216
Joined: 18 Feb 2007, 12:36

Re: Unable to load dejavusans.ttf

Post by trapdoor »

Surely it should say what paths it added.

--
trapdoor
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post 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.
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post 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
 
User avatar
trapdoor
Novice
Novice
Posts: 216
Joined: 18 Feb 2007, 12:36

Re: Unable to load dejavusans.ttf

Post 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
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post 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]
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post 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.
joeiy
Peon
Peon
Posts: 1
Joined: 21 Apr 2008, 08:00

Re: Unable to load dejavusans.ttf

Post 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
User avatar
trapdoor
Novice
Novice
Posts: 216
Joined: 18 Feb 2007, 12:36

Re: Unable to load dejavusans.ttf

Post 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
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Re: Unable to load dejavusans.ttf

Post by allenmoatallen »

Ok, that is where all the data files are and it still isn't looking inside the .app for some reason.
Post Reply