LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2001, 02:02 AM   #1
crvoss
LQ Newbie
 
Registered: Aug 2001
Posts: 5

Rep: Reputation: 0
gd library with ttf


I am trying to use gd-1.8.4 libraries in C++ with FreeType2 on a Linux system. I did a make after editing Makefile to include the -DHAVE_LIBFREETYPE and -lfreetype along with the other libraries (I left out -DHAVE_LIBTTF and -lttf; will that be a problem?). The following is a portion of the program with interdispersed printf statements and following that is the output:

int ShowCurve(int intSize) {
gdImagePtr gdChart;
char *ptrResult;
int intTxtHght=0, intTxtWdth=0;
int intFntRect[8];
char *ptrDummy = "000000";
double dblFntSz = 0;
char *ptrCurrFnt = NULL;

// several nonrelated statements here

printf("ptrCurrFnt: %s, dblFntSz: %f\n", ptrCurrFnt, dblFntSz);
printf("ptrDummy: %s\n", ptrDummy);
ptrResult = gdImageStringFT(NULL, &intFntRect[0], 0, ptrCurrFnt, dblFntSz, 0., 0, 0, ptrDummy);
intTxtWdth = intFntRect[2]-intFntRect[6] + 6;
intTxtHght = intFntRect[3]-intFntRect[7] + 6;
printf("intTxtHght: %d intTxtWdth: %d\n", intTxtHght, intTxtWdth);
printf("intFntRect[2]: %d intFntRect[6]: %d\n", intFntRect[2], intFntRect[6]);

// remainder of this function follows

Below is the output from the program
ptrCurrFnt: /home/crvoss/Projects/AdvChart-0.1/fonts/bus.ttf, dblFntSz: 20.000000
ptrDummy: 000000
intTxtHght: 831162 intTxtWdth: 1208285958
intFntRect[2]: 134542760 intFntRect[6]: -1073743192


As can be seen from the output the font height and width are very large compared to the font size. What have I done wrong?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a bulit in library to my library lg3 Linux - Software 1 10-17-2004 08:19 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
what is the function library of the basic graphics library in rethat9.0? zerwolve Red Hat 0 04-29-2004 09:18 PM
Ttf wonderpun Linux - General 3 10-21-2002 01:57 PM
about TTF safrout Linux - Newbie 1 05-03-2002 10:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration