nanogui: GrGetGCTextSize bug with .ttf fonts?


Previous by date: 13 Jul 2004 02:37:05 +0100 ttf problems, tj
Next by date: 13 Jul 2004 02:37:05 +0100 Re: ttf problems, Greg Haerr
Previous in thread:
Next in thread: 13 Jul 2004 02:37:05 +0100 Re: GrGetGCTextSize bug with .ttf fonts?, Greg Haerr

Subject: GrGetGCTextSize bug with .ttf fonts?
From: tj ####@####.####
Date: 13 Jul 2004 02:37:05 +0100
Message-Id: <40F33CA3.7060901@comcast.net>

I think I may have found a bug in the GrGetGCTextSize() call when using 
ttf fonts. It seemd to return the descent value for baseLine.

example:
 helvB18 = GrCreateFont ("/usr/local/fonts/timesb.ttf",
            18,NULL);
 GrGetFontInfo(helvB18, &helvB18Info);
 strcpy(line, "The quick brown fox");
 GrGetGCTextSize(gc,line, -1,
          GR_TFASCII | GR_TFTOP,
         &textX, &textY,&textBase);
 printf("textX = %d\ntextY = %d\ntextBase = %d\n",
    textX, textY, textBase);
 results in :
maxwidth = 19
height = 20
baseline = 16
textX = 158
textY = 20
textBase = 3

Notice textBase id equal to 3. Sounds more like a descent value than an 
upper baseline value.
Changing to a helveta pcf font file gives a textBase of 14.

So, is GrCreateFont () returning the descent value for baseline?

tj
 




Previous by date: 13 Jul 2004 02:37:05 +0100 ttf problems, tj
Next by date: 13 Jul 2004 02:37:05 +0100 Re: ttf problems, Greg Haerr
Previous in thread:
Next in thread: 13 Jul 2004 02:37:05 +0100 Re: GrGetGCTextSize bug with .ttf fonts?, Greg Haerr


Powered by ezmlm-browse 0.20.