Advertisement

FreeType example

Started by January 07, 2018 08:20 AM
3 comments, last by Lactose 6 years, 10 months ago

Hi

I've compiled:

michael@michael-All-Series:~/CPP$ g++ example1.c -o ftypeexample -lfreetype -I/usr/include/freetype2

http://freetype.sourceforge.net/freetype2/docs/tutorial/example1.c

but try to run on Ubuntu like:

michael@michael-All-Series:~/CPP$ ./ftypeexample ./Ubuntu-B.ttf HELLO

returns nothing.

Thanks for help. Can i use that font in my small commercial app?

 

2 hours ago, mike44 said:

Hi

I've compiled:

michael@michael-All-Series:~/CPP$ g++ example1.c -o ftypeexample -lfreetype -I/usr/include/freetype2

http://freetype.sourceforge.net/freetype2/docs/tutorial/example1.c

but try to run on Ubuntu like:

michael@michael-All-Series:~/CPP$ ./ftypeexample ./Ubuntu-B.ttf HELLO

returns nothing.

Thanks for help. Can i use that font in my small commercial app?

 

And you have the ttf at the same location than your binary ?

From the tutorial, errors are gotten, but not managed: manage them.

Also, debug your program to see where things get bad.

Advertisement

Thanks, now I look at something different:

FontHandle FontMgr::loadFont(const char* inFontPath, const char * inStartMem, const char * inEndMem, unsigned int inSizePx, bool require_exact)
{

and get:

HelloWorld.cpp:83:12: error: expected primary-expression before ‘.’ token
 m.loadFont(./Ubuntu-B.ttf, 0, 100, 16, 0);

 

There are no explanations to the loadFont function. Would you have an idea on how to load the ubuntu.ttf?

52 minutes ago, mike44 said:

(./Ubuntu-B.ttf

This probably needs to be a a string.

Hello to all my stalkers.

This topic is closed to new replies.

Advertisement