I’m running OF 0.9.3 on OSX with Xcode. In my application, I try to load a TrueTypeFont with:
- In the header: ofTrueTypeFont fontBlack;
- In the ofApp setup: fontBlack.load(“verdana.ttf”, 10, true, true, true);
with verdana.ttf in the data directory.
This gives me [ error ] ofTrueTypeFont: loadFontFace(): couldn’t find font “verdana.ttf” = so loadFontFace() returns a nullptr.
Interestingly, I get the same error when building the OF example in examples/graphics/fontsExample. I didn’t make any changes here (not to the code, nor to the file structure).
Is this a bug in OF or a system-specific issue on my side? Would you mind to compile the example and test?
Just tried to compile the fontsExample xCode project using the same setup :
OSX 10.11.6 with OF 0.9.3 and its runs fine.
Maybe cleaning the project and recompile it would help ?
Retried with a fresh copy of OF - there it works. So clearly some local issue.
Sorry for the trouble!
I identified the origin of this error, and it relates to boost!
In my actual project, I switched the boost library folder to usr/local/include, which contains my hombrew installation of the precompiled boost 1.60.0_2 libraries. If I do the same for a fresh copy of OF 0.9.3 and compile the font example, I get the loadFontFace() error. If I link to OF’s internal copy of boost, everything works like a charm.
Anyone knows why this is the case / how to overcome this? I rely on the boost/math/distributions libraries, and they come with several dependencies within boost. I’d therefore prefer to continue linking to usr/local/include instead of the of-internal minimal-boost package.