From f658209d25477c490bf1892e68a0fd1384c1dded Mon Sep 17 00:00:00 2001 From: scuri Date: Tue, 23 Jun 2009 20:55:28 +0000 Subject: *** empty log message *** --- src/drv/cddxf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/drv/cddxf.c') diff --git a/src/drv/cddxf.c b/src/drv/cddxf.c index b5c8854..b4dc875 100644 --- a/src/drv/cddxf.c +++ b/src/drv/cddxf.c @@ -563,7 +563,7 @@ static void cdsector (cdCtxCanvas *ctxcanvas, int xc, int yc, int w, int h, doub fprintf ( ctxcanvas->file, "SEQEND\n" ); } -static void cdtext (cdCtxCanvas *ctxcanvas, int x, int y, const char *s) +static void cdtext (cdCtxCanvas *ctxcanvas, int x, int y, const char *s, int len) { fprintf ( ctxcanvas->file, "0\n" ); fprintf ( ctxcanvas->file, "TEXT\n" ); @@ -592,7 +592,10 @@ static void cdtext (cdCtxCanvas *ctxcanvas, int x, int y, const char *s) fprintf ( ctxcanvas->file, "73\n" ); fprintf ( ctxcanvas->file, "%3d\n", ctxcanvas->tva ); /* text vertical alignment */ fprintf ( ctxcanvas->file, "1\n" ); + + s = cdStrDupN(s, len); fprintf ( ctxcanvas->file, "%s\n", s ); /* text */ + free((char*)s); } @@ -774,13 +777,14 @@ static void cdgetfontdim (cdCtxCanvas *ctxcanvas, int *max_width, int *height, i } } -static void cdgettextsize (cdCtxCanvas *ctxcanvas, const char *s, int *width, int *height) +static void cdgettextsize (cdCtxCanvas *ctxcanvas, const char *s, int len, int *width, int *height) { int i; double tangent_ta; double pixel_th; + (void)s; - i = (int)strlen(s); + i = len; tangent_ta = tan(ctxcanvas->toa*CD_DEG2RAD); pixel_th = (ctxcanvas->th*ctxcanvas->canvas->xres)/CD_MM2PT; /* points to pixels */ -- cgit v1.2.3