Permalink
Browse files

support UTF with Freetype 1.x

  • Loading branch information...
Tony Cook
Tony Cook committed Apr 18, 2002
1 parent f6af7cb commit 4f68b48f601d30cb278925a9638365286d272649
Showing with 480 additions and 262 deletions.
  1. +1 −0 Changes
  2. +46 −11 Imager.xs
  3. +176 −70 font.c
  4. +10 −88 freetyp2.c
  5. +9 −32 image.h
  6. +2 −0 imio.h
  7. +78 −0 io.c
  8. +13 −3 lib/Imager/Font/Truetype.pm
  9. +78 −29 t/t35ttfont.t
  10. +38 −29 t/t36oofont.t
  11. +29 −0 t/testtools.pl
View
@@ -649,6 +649,7 @@ Revision history for Perl extension Imager.
and at least mention it in the docs beyond the examples
- document the values for the read() and write() method type
parameter
+ - support UTF8 text with Freetype 1.x
=================================================================
View
@@ -1742,42 +1742,77 @@ MODULE = Imager PACKAGE = Imager
undef_int
-i_tt_text(handle,im,xb,yb,cl,points,str,len,smooth)
+i_tt_text(handle,im,xb,yb,cl,points,str_sv,len_ignored,smooth,utf8)
Imager::Font::TT handle
Imager::ImgRaw im
int xb
int yb
Imager::Color cl
float points
- char* str
- int len
+ SV * str_sv
+ int len_ignored
int smooth
+ int utf8
+ PREINIT:
+ char *str;
+ STRLEN len;
+ CODE:
+#ifdef SvUTF8
+ if (SvUTF8(str_sv))
+ utf8 = 1;
+#endif
+ str = SvPV(str_sv, len);
+ RETVAL = i_tt_text(handle, im, xb, yb, cl, points, str,
+ len, smooth, utf8);
+ OUTPUT:
+ RETVAL
undef_int
-i_tt_cp(handle,im,xb,yb,channel,points,str,len,smooth)
+i_tt_cp(handle,im,xb,yb,channel,points,str_sv,len_ignored,smooth,utf8)
Imager::Font::TT handle
Imager::ImgRaw im
int xb
int yb
int channel
float points
- char* str
- int len
+ SV * str_sv
+ int len_ignored
int smooth
-
+ int utf8
+ PREINIT:
+ char *str;
+ STRLEN len;
+ CODE:
+#ifdef SvUTF8
+ if (SvUTF8(str_sv))
+ utf8 = 1;
+#endif
+ str = SvPV(str_sv, len);
+ RETVAL = i_tt_cp(handle, im, xb, yb, channel, points, str, len,
+ smooth, utf8);
+ OUTPUT:
+ RETVAL
undef_int
-i_tt_bbox(handle,point,str,len)
+i_tt_bbox(handle,point,str_sv,len_ignored, utf8)
Imager::Font::TT handle
float point
- char* str
- int len
+ SV* str_sv
+ int len_ignored
+ int utf8
PREINIT:
int cords[6],rc;
+ char * str;
+ STRLEN len;
PPCODE:
- if ((rc=i_tt_bbox(handle,point,str,len,cords))) {
+#ifdef SvUTF8
+ if (SvUTF8(ST(2)))
+ utf8 = 1;
+#endif
+ str = SvPV(str_sv, len);
+ if ((rc=i_tt_bbox(handle,point,str,len,cords, utf8))) {
EXTEND(SP, 4);
PUSHs(sv_2mortal(newSViv(cords[0])));
PUSHs(sv_2mortal(newSViv(cords[1])));
Oops, something went wrong.

0 comments on commit 4f68b48

Please sign in to comment.