nanogui: GrGetGCTextSize bug with .ttf fonts?
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