Hi,

prior to DirectFB 1.1.0 release, the .dgiff fonts format was disabled in
the makefiles -- from the look of it (http://tinyurl.com/5cq6ov), it was
because it didn't compile anymore after surface_core branch changes.

Attached patch updates the code to compile and work with latest sources
and re-enables it in the makefiles.

Regards,
Vaclav
diff --git a/interfaces/IDirectFBFont/Makefile.am b/interfaces/IDirectFBFont/Makefile.am
index 9bb6cd9..6927f7b 100644
--- a/interfaces/IDirectFBFont/Makefile.am
+++ b/interfaces/IDirectFBFont/Makefile.am
@@ -19,8 +19,8 @@ AM_CFLAGS = $(FREETYPE_CFLAGS)
 
 idirectfbfont_LTLIBRARIES = \
 	libidirectfbfont_default.la	\
-	$(FREETYPE_PROVIDER_LTLIB)
-#	libidirectfbfont_dgiff.la
+	$(FREETYPE_PROVIDER_LTLIB)	\
+	libidirectfbfont_dgiff.la
 
 if BUILD_STATIC
 idirectfbfont_DATA = $(idirectfbfont_LTLIBRARIES:.la=.o)
@@ -36,13 +36,13 @@ libidirectfbfont_default_la_LIBADD = \
 	$(top_builddir)/src/libdirectfb.la
 
 
-#libidirectfbfont_dgiff_la_SOURCES = idirectfbfont_dgiff.c
+libidirectfbfont_dgiff_la_SOURCES = idirectfbfont_dgiff.c
 
-#libidirectfbfont_dgiff_la_LDFLAGS = -avoid-version -module
+libidirectfbfont_dgiff_la_LDFLAGS = -avoid-version -module
 
-#libidirectfbfont_dgiff_la_LIBADD = \
-#	$(top_builddir)/lib/direct/libdirect.la \
-#	$(top_builddir)/src/libdirectfb.la
+libidirectfbfont_dgiff_la_LIBADD = \
+	$(top_builddir)/lib/direct/libdirect.la \
+	$(top_builddir)/src/libdirectfb.la
 
 
 libidirectfbfont_ft2_la_SOURCES = idirectfbfont_ft2.c
diff --git a/interfaces/IDirectFBFont/idirectfbfont_dgiff.c b/interfaces/IDirectFBFont/idirectfbfont_dgiff.c
index 71c66ae..5483633 100644
--- a/interfaces/IDirectFBFont/idirectfbfont_dgiff.c
+++ b/interfaces/IDirectFBFont/idirectfbfont_dgiff.c
@@ -161,6 +161,7 @@ Construct( IDirectFBFont      *thiz,
      DGIFFGlyphInfo  *glyphs;
      DGIFFGlyphRow   *row;
      DGIFFImplData   *data;
+     CoreSurfaceConfig config;
 
 //     if (desc->flags & (DFDESC_WIDTH | DFDESC_ATTRIBUTES | DFDESC_FIXEDADVANCE))
   //        return DFB_UNSUPPORTED;
@@ -234,6 +235,12 @@ Construct( IDirectFBFont      *thiz,
      }
 
      /* Build glyph cache rows. */
+
+     config.flags  = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_PREALLOCATED;
+     config.format = face->pixelformat;
+     config.preallocated[1].addr = NULL;
+     config.preallocated[1].pitch = 0;
+
      for (i=0; i<face->num_rows; i++) {
           font->rows[i] = D_CALLOC( 1, sizeof(CoreFontCacheRow) );
           if (!font->rows[i]) {
@@ -241,9 +248,14 @@ Construct( IDirectFBFont      *thiz,
                goto error;
           }
 
-          ret = dfb_surface_create_preallocated( core, row->width, row->height, face->pixelformat,
-                                                 CSP_VIDEOHIGH, DSCAPS_NONE, NULL, (void*)(row+1),
-                                                 NULL, row->pitch, 0, &font->rows[i]->surface );
+          config.size.w = row->width;
+          config.size.h = row->height;
+          config.preallocated[0].addr = (void*)(row+1);
+          config.preallocated[0].pitch = row->pitch;
+
+          ret = dfb_surface_create( core, &config, CSTF_PREALLOCATED, 0, NULL,
+                                    &font->rows[i]->surface );
+
           if (ret) {
                D_DERROR( ret, "DGIFF/Font: Could not create preallocated %s %dx%d glyph row surface!\n",
                          dfb_pixelformat_name(face->pixelformat), row->width, row->height );

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to