I am trying to use the ofxTrueTypeFontUC addon and I am having trouble because the copy and assignment constructor are private. This causes problems when I create a vector of objects of a class which contains objects of the ofxTrueTypeFontUC class.
Why would the copy-constructor and the assignment operator be private? Moving them to public did not fix the issue. Is there a way around it?
Is there an alternative plugin for Unicode that works? I tried a couple but to no avail.
Thanks.
marinero
2 Likes
Hi there,
Unless I am mistaken, in theory if you change your variables to pointers (e.g. ofPtr<>) to ofxTrueTypeFontUC, then the copy-constructor shouldn’t be called when copying/moving around your “container” object.
Does that work for you?
Cheers!
Sacha
1 Like
Thank you @sachaventura for the tip. That was exactly it.
For others that might be in similar trouble. Declare your ofxTrueTypeFontUC object as a pointer in the .h file like this:
ofPtr<ofxTrueTypeFontUC> particleFont;
then in the .cpp file:
particleFont = ofPtr<ofxTrueTypeFontUC> (new ofxTrueTypeFontUC());
particleFont->loadFont("afontFile.ttf", 40, true, true, true);
etc...
I love this forum,
marinero
1 Like