From: <pj...@ne...> - 2012-01-17 02:02:50
|
OK, so it turns out it's not a good idea to start programming at 4:30 a.m. after about 5 hours' sleep, and expect to have any respectable neural activity 12 hours later. Turned the TrueType file into hex-coded char array via a Perl script, and I'm good to go... -----Original Message----- >From: pj...@ne... >Sent: Jan 16, 2012 7:20 PM >To: ftg...@li... >Subject: [Ftgl-devel] Creating font from data instead of a file? > >Greetings - > >I wish to use FTGL in a context in which reading from a TrueType data file won't work. I should be able to use, for example, this method: > > FTTextureFont::FTTextureFont(const unsigned char *pBufferBytes, size_t bufferSizeInBytes) > >Basically, I need to compile the "pBufferBytes" into my program. But of course in C/C++, I can't just do this: > > const unsigned char *data = "<contents of a ttf file pasted in>"; > >because the binary data, as arbitrary unsigned char, contains characters that the compiler is going to reject (un-escaped newlines and goodness knows what else). Am I just missing some obvious technique for this? Apologies if this is a really ignorant question... :-) > >- Philip > > >------------------------------------------------------------------------------ >Keep Your Developer Skills Current with LearnDevNow! >The most comprehensive online learning library for Microsoft developers >is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >Metro Style Apps, more. Free future releases when you subscribe now! >http://p.sf.net/sfu/learndevnow-d2d >_______________________________________________ >Ftgl-devel mailing list >Ftg...@li... >https://lists.sourceforge.net/lists/listinfo/ftgl-devel |