truetypefont errors returned in console- any suggestions?

Hi All

I am getting the following error in the console, from previously working code that loads and uses verdana.ttf on xcode 4

  
  
OF_ERROR: Error : font not allocated -- line 779 in /Users/will/Desktop/of_iOS_v0062/libs/openFrameworksCompiled/project/iphone/../../../openFrameworks/graphics/ofTrueTypeFont.cpp  
  

It seems to indicate that the compiled libs don’t seem to like ofTrueTypeFont?

Has anyone else found this? Is this an easy fix?
Any help appreciated, nothing too urgent

that usually means that ofTrueTypeFont cannot find the font file, do you have it in the data folder?

Hi Arturo
yes, it’s there, it was the first thing I checked.
I went straight to compile the fontsExample for the iPhone and that just returns a white screen and the exact same error. And the verdana.ttf is there too in the data folder.
It makes no difference dragging it into the resource bundle in xcode navigator either…
… a real puzzle!
thanks for the help
sacculi

then i guess there’s some problem with ofToDataPath returning a wrong path to the data directory. i’m not used to iphone/osx development so cannot give you a better answer sorry.

i doubt that ofToDataPath isn’t working… that would be a super weird change… hmmmmm :confused:

more likely the sh script that copies in the contents of the data folder is probably broken in 4… we shouldn’t be using it anyway, I think we moved away from that in 007…

sevenspiral, have you tried dragging the font into the data group in your xcode project to ensure that it’s copied into the bundle? (on the side bar within the project)

hi zach
yes, I copied dragged across the .ttf file into the bundle for both my own, and the iPhoneFontsExample that in iPhoneExamples. It doesn’t make a difference I’m afraid. The error in ofTrueTypeFont.cpp still appears, showing the font isn’t loading…
thanks for the help
sacculi

hmmmm super weird. i’ll take a look

Are you working of the 007 git or the 062 build?

Hi Zach
I pulled the latest build of oF from github (which I guess is the 007 build?) and tried to build a couple of examples. As I’d now set the targets and build setttings for my machine (iOS 4.3, xcode 4, macos 10.6) I assumed it would build, but I am getting a bunch of errors returned by the iPhone + OF static library - 38 in fact - when trying to build the fontsExample. Any ideas what I might be doing wrong?
cheers
sacculi

Just spotted this from a search
https://github.com/openframeworks/openF-…-issues/256

This might relate to the errors I’m getting for my 062 build somehow…
But still unsure about the 007 build errors above

huh, that does sound like what you’re running into. I didn’t realize you were trying to compile for the simulator… I figured you were trying to build for the device :slight_smile: sim is definitely very different.

Actually I would say if possible you should download xcode3 and use that for your development at the moment. There should be a link for xcode 3 under the xcode 4 download in the apple dev center… xcode 4 makes a ton of changes, and there are a lot of different weird bugs that can come up (not just with OF, but with a lot of outside libraries)… I’d wait until the of dev core (and everyone else on the internet) have worked out most of that stuff before getting into it (unless you want to take a lead on quashing bugs!).

I was building in xcode4 for a bit when it first came out but there were just so many issues I gave up and went back to just making things. I’ll go back later when my goal is bug squashing.

[quote author=“zach_gage”]…I’d wait until the of dev core (and everyone else on the internet) have worked out most of that stuff before getting into it (unless you want to take a lead on quashing bugs!).

I was building in xcode4 for a bit when it first came out but there were just so many issues I gave up and went back to just making things. I’ll go back later when my goal is bug squashing.[/quote]
+1 for that. Tried Xcode 4 ages ago with a beta, was too buggy. Tried last week with the official release, still very buggy, couldn’t get source control working. Will leave it for another few months… :?

Thanks both… tis done, I have fallen back into the arms of 3.2.6…
I will sure I will cross paths my Number 4 some time in the not too distant future, but not yet!

sevenspiral did you solve this by going back to xcode3?

isn’t this the problem?:
quoting theo on github “freetype needed non os x lib for simulator”

tried to use freetype-iphone.a & freetype.a from github with no success;
on the device everthing works fine, in the simulator i get the ‘font not allocated’ error; .ttf files are there for sure, checked it.

any hints?

also tried to use those files, with no success

i’m not having any problems with ttf fonts in the data folder, but i get the exact same error whenever i load an otf font.

Hey All, similar problems here. I’m using xcode4 and ofTrueTypeFont causes a problem with the simulator but not the device. I get

“Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
open$UNIX2003 called from function FT_Stream_Open in image macro.”

The line highlighted is in the truetype header file at line

if (FT_New_Face( library, filename.c_str(), 0, &face )) {
return false;
}

which is presumably the fontloader. It’s not finding the data folder clearly

Extensive googling :frowning: reveals a whole bunch of people having the same sort of bother with different libraries not playing nicely with the sim and resorting to recompiling/building those various libraries but as relative noob wouldn’t know where to start. I’m going to keep poking at this and will report any success.