freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] bug report.


From: Alexey Kolesnikov
Subject: [Devel] bug report.
Date: Thu, 4 Jul 2002 23:11:28 +0400

Dear developers,

I have found bug in FreeType2 2.1.2 and 2.1.0 releases.
I try to use some Japanese fonts with FreeType library and GD
library 2.0.1 version.

For example, when I use 'DFHsg9.ttf' font (see C source below) the
image are not generated.
Early version (2.0.9) of FreeType are works properly and image are
generating.

I have Linux box with 2.4.2-2smp kernel.

I hope this information will be sufficient and helpful for fixing this
problem.
If you can't find any Japanese TTF fonts, inform me.
I will try to upload 'DFHsg9.ttf' file.

Alexey Kolesnikov.

P.S. Sorry for my bad english. :)

------------ C source ------------------
#include "gd.h"
#include <string.h>

gdImagePtr im;
int black;
int white;
int brect[8];
int x, y;
char *err;

char *s = "Hello."; /* String to draw. */
double sz = 40.;
char *f = "/var/www/html/web_russian/fonts/DFHsg9.ttf";  /* User supplied font 
*/

main() {
/* obtain brect so that we can size the image */
err = gdImageStringFT(NULL,&brect[0],0,f,sz,0.,0,0,s);
if (err) {fprintf(stderr,err); return 1;}

/* create an image big enough for the string plus a little whitespace */
x = brect[2]-brect[6] + 6;
y = brect[3]-brect[7] + 6;
im = gdImageCreate(x,y);

/* Background color (first allocated) */
white = gdImageColorResolve(im, 255, 255, 255);
black = gdImageColorResolve(im, 0, 0, 0);

/* render the string, offset origin to center string*/
/* note that we use top-left coordinate for adjustment
 * since gd origin is in top-left with y increasing downwards. */
x = 3 - brect[6];
y = 3 - brect[7];
err = gdImageStringFT(im,&brect[0],black,f,sz,0.0,x,y,s);
if (err) {fprintf(stderr,err); return 1;}

/* Write img to stdout */
gdImagePng(im, stdout);

/* Destroy it */
gdImageDestroy(im);

}
------------ C source ------------------


-- 
With best regards,
 Alexey                          mailto:address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]