Index: xorg/configure.ac =================================================================== RCS file: /cvs/xorg/xserver/xorg/configure.ac,v retrieving revision 1.159 diff -u -r1.159 configure.ac --- xorg/configure.ac 10 Jan 2006 02:32:20 -0000 1.159 +++ xorg/configure.ac 25 Jan 2006 05:04:08 -0000 @@ -1227,6 +1227,42 @@ AC_PATH_PROG(MKFONTSCALE, mkfontscale) AC_PATH_PROG(MKFONTDIR, mkfontdir) + + # freetype support code borrowed from lib/XFont + AC_ARG_ENABLE(freetype, [ --disable-freetype],[XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=yes]) + AM_CONDITIONAL(XP_USE_FREETYPE, [test x$XP_USE_FREETYPE = xyes]) + if test x$XP_USE_FREETYPE = xyes; then + AC_DEFINE(XP_USE_FREETYPE,1,[Support FreeType rasterizer in Xprint for nearly all font file formats]) + AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=auto) + + if test "$freetype_config" = "auto" ; then + PKG_CHECK_MODULES(FREETYPE, freetype2, + freetype_config=no, freetype_config=yes) + fi + + if test "$freetype_config" = "yes"; then + AC_PATH_PROG(ft_config,freetype-config,no) + if test "$ft_config" = "no"; then + AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/]) + fi + else + ft_config="$freetype_config" + fi + + if test "$freetype_config" != "no"; then + FREETYPE_CFLAGS="`$ft_config --cflags`" + FREETYPE_LIBS="`$ft_config --libs`" + fi + FREETYPE_REQUIRES="freetype2" + else + FREETYPE_CFLAGS="" + FREETYPE_LIBS="" + FREETYPE_REQUIRES="" + fi + AC_SUBST(FREETYPE_LIBS) + AC_SUBST(FREETYPE_CFLAGS) + AC_SUBST(FREETYPE_REQUIRES) + # end freetype support fi Index: xorg/Xprint/Makefile.am =================================================================== RCS file: /cvs/xorg/xserver/xorg/Xprint/Makefile.am,v retrieving revision 1.7 diff -u -r1.7 Makefile.am --- xorg/Xprint/Makefile.am 6 Jan 2006 23:06:14 -0000 1.7 +++ xorg/Xprint/Makefile.am 25 Jan 2006 05:04:08 -0000 @@ -11,7 +11,8 @@ Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \ pcl/libpcl.la pcl-mono/libpcl.la \ ../mfb/libmfb.la ../mi/libmi.la \ - ../cfb32/libcfb32.la ../cfb/libcfb.la ../Xext/libXext.la + ../cfb32/libcfb32.la ../cfb/libcfb.la ../Xext/libXext.la \ + @FREETYPE_LIBS@ miinitext-wrapper.c: echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@ Index: xorg/Xprint/ps/Makefile.am =================================================================== RCS file: /cvs/xorg/xserver/xorg/Xprint/ps/Makefile.am,v retrieving revision 1.3 diff -u -r1.3 Makefile.am --- xorg/Xprint/ps/Makefile.am 2 Dec 2005 06:02:38 -0000 1.3 +++ xorg/Xprint/ps/Makefile.am 25 Jan 2006 05:04:08 -0000 @@ -2,7 +2,7 @@ INCLUDES = -I$(top_srcdir)/Xprint -I$(top_srcdir)/cfb -I$(top_srcdir)/mfb -AM_CFLAGS = @SERVER_DEFINES@ @DIX_CFLAGS@ @XPRINT_CFLAGS@ \ +AM_CFLAGS = @SERVER_DEFINES@ @DIX_CFLAGS@ @XPRINT_CFLAGS@ @FREETYPE_CFLAGS@ \ -D_XP_PRINT_SERVER_ -DPSZ=8 -DXP_PSTEXT libps_la_SOURCES = \ @@ -35,3 +35,8 @@ psout_ftpstype1.c \ psout_ftpstype3.c \ ttf2pt1wrap.c + +if XP_USE_FREETYPE + AM_CFLAGS += -DXP_USE_FREETYPE + libps_la_SOURCES += $(EXTRA_DIST) +endif Index: xorg/Xprint/ps/psout_ftpstype3.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/Xprint/ps/psout_ftpstype3.c,v retrieving revision 1.7 diff -u -r1.7 psout_ftpstype3.c --- xorg/Xprint/ps/psout_ftpstype3.c 7 Jul 2005 14:59:48 -0000 1.7 +++ xorg/Xprint/ps/psout_ftpstype3.c 25 Jan 2006 05:04:08 -0000 @@ -55,13 +55,6 @@ #include FT_MULTIPLE_MASTERS_H #include FT_SFNT_NAMES_H -#define USE_FT_INTERNALS 1 -#ifdef USE_FT_INTERNALS -#include FT_INTERNAL_TYPE1_TYPES_H -#include "t42types.h" -#include FT_INTERNAL_OBJECTS_H -#endif /* USE_FT_INTERNALS */ - #include #include #include @@ -287,28 +280,6 @@ return 0; } -#ifdef USE_FT_INTERNALS -static FT_BBox * -FT_Get_PS_Font_BBox( FT_Face face ) -{ - const char *driver_name; - FT_BBox *font_bbox = NULL; - - if ( face && face->driver && face->driver->root.clazz ) - { - driver_name = face->driver->root.clazz->module_name; - if ( ft_strcmp( driver_name, "type1" ) == 0 ) - font_bbox = &(((T1_Face)face)->type1.font_bbox); - else if ( ft_strcmp( driver_name, "t1cid" ) == 0 ) - font_bbox = &(((CID_Face)face)->cid.font_bbox); - else if ( ft_strcmp( driver_name, "type42" ) == 0 ) - font_bbox = &(((T42_Face)face)->type1.font_bbox); - } - - return font_bbox; -} -#endif /* USE_FT_INTERNALS */ - static int PSType3_generateOutlineFont(FILE *out, const char *psfontname, struct ft2info *ti, long block_offset) { @@ -362,12 +333,12 @@ } else { - FT_BBox *font_bbox = FT_Get_PS_Font_BBox(ti->ttface); - fprintf(out, "/FontBBox [%d %d %d %d] def\n", - (int)font_bbox->xMin, - (int)font_bbox->yMin, - (int)font_bbox->xMax, - (int)font_bbox->yMax); + fprintf(out, "/FontBBox [%ld %ld %ld %ld] def\n", + ti->ttface->bbox.xMin, + ti->ttface->bbox.yMin, + ti->ttface->bbox.xMax, + ti->ttface->bbox.yMax); + } fprintf(out, "/Encoding [\n");