[Solved] Clipping freetype text

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Gh0sT
Posts: 5
Joined: Tue Jun 06, 2006 2:38 am

[Solved] Clipping freetype text

Post by Gh0sT »

Hi everyone,

I'd like to clip off a part of a text blitted with the freetype2 lib.

IE.

Code: Select all

mytext = "This is a long line of text which need to be clipped"; 
text_to_screen(mytext, x, y);

I'd like it to display only the first part of the text, so:
"This is a long li"

Any ideas or suggestions are highly appreciated.

Thanks in advance,
Gh0sT

Edit:
Just got solved!

For anyone interested:

Code: Select all

char mytext[10]; 
strncpy(mytext,"This is a long line of text which need to be clipped",10); 
Post Reply