gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog Makefile.am configure.ac server...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog Makefile.am configure.ac server...
Date: Wed, 13 Jun 2007 09:59:44 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/06/13 09:59:43

Modified files:
        .              : ChangeLog Makefile.am configure.ac 
        server         : FreetypeRasterizer.cpp FreetypeRasterizer.h 
                         Makefile.am 
        testsuite/misc-ming.all: DefineEditTextTest.c 

Log message:
                * configure.ac: look for libfontconfig
                * Makefile.am: print fontconfig info on 'dumpconfig'
                * server/FreetypeRasterizer.{cpp,h}: implement font name
                  to filename matching using fontconfig, when available;
                  updated copyright info (enough hacking on it now..)
                * server/Makefile.am: add FONTCONFIG cflags and libs.
                * testsuite/misc-ming.all/DefineEditTextTest.c: add another
                  text field using 'times' font.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3521&r2=1.3522
http://cvs.savannah.gnu.org/viewcvs/gnash/Makefile.am?cvsroot=gnash&r1=1.76&r2=1.77
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.339&r2=1.340
http://cvs.savannah.gnu.org/viewcvs/gnash/server/FreetypeRasterizer.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/FreetypeRasterizer.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.116&r2=1.117
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DefineEditTextTest.c?cvsroot=gnash&r1=1.6&r2=1.7

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3521
retrieving revision 1.3522
diff -u -b -r1.3521 -r1.3522
--- ChangeLog   13 Jun 2007 09:54:10 -0000      1.3521
+++ ChangeLog   13 Jun 2007 09:59:41 -0000      1.3522
@@ -1,3 +1,14 @@
+2007-06-13 Sandro Santilli <address@hidden>
+
+       * configure.ac: look for libfontconfig
+       * Makefile.am: print fontconfig info on 'dumpconfig'
+       * server/FreetypeRasterizer.{cpp,h}: implement font name
+         to filename matching using fontconfig, when available;
+         updated copyright info (enough hacking on it now..)
+       * server/Makefile.am: add FONTCONFIG cflags and libs.
+       * testsuite/misc-ming.all/DefineEditTextTest.c: add another
+         text field using 'times' font.
+
 2007-06-13 Zou Lunkai <address@hidden>
 
        * testsuite/misc-ming.all/Makefile.am:

Index: Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/Makefile.am,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -b -r1.76 -r1.77
--- Makefile.am 12 Jun 2007 12:33:21 -0000      1.76
+++ Makefile.am 13 Jun 2007 09:59:42 -0000      1.77
@@ -15,7 +15,7 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 # 
 
-# $Id: Makefile.am,v 1.76 2007/06/12 12:33:21 strk Exp $
+# $Id: Makefile.am,v 1.77 2007/06/13 09:59:42 strk Exp $
 
 ## Process this file with automake to produce Makefile.in
 AUTOMAKE_OPTIONS = 1.6.0
@@ -195,6 +195,8 @@
        @echo " LIBXML_LIBS is $(LIBXML_LIBS)"
        @echo " FREETYPE_CFLAGS is $(FREETYPE_CFLAGS)"
        @echo " FREETYPE_LIBS is $(FREETYPE_LIBS)"
+       @echo " FONTCONFIG_CFLAGS is $(FONTCONFIG_CFLAGS)"
+       @echo " FONTCONFIG_LIBS is $(FONTCONFIG_LIBS)"
 if HAVE_DMALLOC
        @echo " DMALLOC_CFLAGS is $(DMALLOC_CFLAGS)"
        @echo " DMALLOC_LIBS is $(DMALLOC_LIBS)"

Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.339
retrieving revision 1.340
diff -u -b -r1.339 -r1.340
--- configure.ac        13 Jun 2007 09:29:04 -0000      1.339
+++ configure.ac        13 Jun 2007 09:59:42 -0000      1.340
@@ -15,7 +15,7 @@
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 dnl  
 
-dnl $Id: configure.ac,v 1.339 2007/06/13 09:29:04 strk Exp $
+dnl $Id: configure.ac,v 1.340 2007/06/13 09:59:42 strk Exp $
 
 AC_PREREQ(2.50)
 AC_INIT(gnash, cvs)
@@ -705,8 +705,9 @@
 GNASH_PKG_FIND(jpeg, [jpeglib.h], [jpeg images], jpeg_mem_init)
 GNASH_PKG_INCLUDES([dejagnu], [dejagnu.h])
 
-dnl Find freetype
+dnl Find freetype and fontconfig
 GNASH_PKG_FIND(freetype, [freetype/freetype.h], [freetype2 font library], 
FT_Load_Char)
+GNASH_PKG_FIND(fontconfig, [fontconfig/fontconfig.h], [fontconfig library], 
FcFontMatch)
 
 AC_PATH_MING
 AM_CONDITIONAL(ENABLE_MING, [ test x"$MAKESWF" != x ])
@@ -1783,6 +1784,22 @@
   echo "                 It may still be possible to configure without 
freetype."
 fi
 
+if test x"$FONTCONFIG_LIBS" != x; then
+  if test x"$FONTCONFIG_CFLAGS" != x; then
+    echo "        Fontconfig flags are: $FONTCONFIG_CFLAGS"
+  else
+    echo "        Fontconfig flags are: default include path"
+  fi
+  echo "        Fontconfig libs are: $FONTCONFIG_LIBS"
+else
+  echo "        WARNING: You need to have the freetype development packages 
installed"
+  echo "                 to use device fonts."
+  echo "                 Install it from http://www.fontconfig.org";
+  echo "                 or .deb users: apt-get install libfontconfig1-dev"
+  echo "                 or .rpm users: yum install ??"
+  echo "                 It may still be possible to configure without 
fontconfig."
+fi
+
 if test x$ext_mysql = xyes; then
   if test x$mysql != xno; then
     if test x"$MYSQL_LIBS" != x; then

Index: server/FreetypeRasterizer.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/FreetypeRasterizer.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/FreetypeRasterizer.cpp       13 Jun 2007 07:26:46 -0000      1.9
+++ server/FreetypeRasterizer.cpp       13 Jun 2007 09:59:42 -0000      1.10
@@ -1,10 +1,20 @@
-// gameswf_freetype.cpp        -- Vitaly Alexeev <address@hidden>      2007
-
-// This source code has been donated to the Public Domain.  Do
-// whatever you want with it.
-
-// TrueType font rasterizer based on freetype library,
-// used code from demos/font_output/font_output.cpp
+// FreetypeRasterizer.cpp:  Freetype glyphs manager
+// 
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -24,6 +34,15 @@
 # include FT_BBOX_H
 #endif
 
+#ifdef HAVE_FONTCONFIG_FONTCONFIG_H
+# define HAVE_FONTCONFIG 1
+#endif
+
+#ifdef HAVE_FONTCONFIG
+# include <fontconfig/fontconfig.h>
+# include <fontconfig/fcfreetype.h>
+#endif
+
 #include <cstdio> // for snprintf
 #include <string>
 #include <memory> // for auto_ptr
@@ -157,17 +176,71 @@
 
 // private
 bool
-FreetypeRasterizer::getFontFilename(const std::string& /*name*/,
+FreetypeRasterizer::getFontFilename(const std::string& name,
                bool /*bold*/, bool /*italic*/, std::string& filename)
 {
+
 #define DEFAULT_FONTFILE "/usr/share/fonts/truetype/freefont/FreeSans.ttf"
 
+#ifdef HAVE_FONTCONFIG
+
+       if (!FcInit ())
+       {
+
+               log_error("Can't init fontconfig library, using hard-coded font 
filename");
        filename = DEFAULT_FONTFILE;
        return true;
+               //return false;
+       }
+
+       FcResult    result;
+
+       FcPattern* pat = FcNameParse((const FcChar8*)name.c_str());
+
+       FcConfigSubstitute (0, pat, FcMatchPattern);
+       FcDefaultSubstitute (pat);
+
+       FcPattern   *match;
+       match = FcFontMatch (0, pat, &result);
+       FcPatternDestroy (pat);
+
+       FcFontSet* fs = NULL;
+       if (match)
+       {
+               fs = FcFontSetCreate ();
+               FcFontSetAdd (fs, match);
+       }
 
-       // TODO: implement
-       log_error("FIXME: font name to filename mapping unimplemented");
-       return false;
+       if ( fs )
+       {
+               log_debug("Found %d fonts matching the family %s (using 
first)", fs->nfont, name.c_str());
+
+               for (int j = 0; j < fs->nfont; j++)
+               {
+                       FcChar8 *file;
+                       if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, 
&file) != FcResultMatch)
+                       {
+               log_debug("Matching font %d has unknown filename, skipping", j);
+               continue;
+                       }
+
+                       filename = (char *)file;
+                       return true;
+
+               }
+
+               FcFontSetDestroy(fs);
+       }
+
+       log_error("No device font matches the name '%s', using hard-coded font 
filename", name.c_str());
+       filename = DEFAULT_FONTFILE;
+       return true;
+#else
+       log_error("Font filename matching not implemented (no fontconfig 
support built-in), using hard-coded font filename",
+                       name.c_str());
+       filename = DEFAULT_FONTFILE;
+       return true;
+#endif
 }
 
 #endif // HAVE_FREETYPE2 

Index: server/FreetypeRasterizer.h
===================================================================
RCS file: /sources/gnash/gnash/server/FreetypeRasterizer.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/FreetypeRasterizer.h 13 Jun 2007 02:24:42 -0000      1.5
+++ server/FreetypeRasterizer.h 13 Jun 2007 09:59:42 -0000      1.6
@@ -1,7 +1,20 @@
-// freetype.h  -- Vitaly Alexeev <address@hidden>      2007
-
-// This source code has been donated to the Public Domain.  Do
-// whatever you want with it.
+// FreetypeRasterizer.h:  Freetype glyphs manager
+// 
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #ifndef GNASH_FREETYPE_H
 #define GNASH_FREETYPE_H

Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -b -r1.116 -r1.117
--- server/Makefile.am  12 Jun 2007 12:33:21 -0000      1.116
+++ server/Makefile.am  13 Jun 2007 09:59:42 -0000      1.117
@@ -18,7 +18,7 @@
 # 
 #
 
-# $Id: Makefile.am,v 1.116 2007/06/12 12:33:21 strk Exp $
+# $Id: Makefile.am,v 1.117 2007/06/13 09:59:42 strk Exp $
 
 AUTOMAKE_OPTIONS = 
 
@@ -49,6 +49,7 @@
        $(BOOST_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(FREETYPE_CFLAGS) \
+       $(FONTCONFIG_CFLAGS) \
        $(NULL)
 
 libgnashserver_la_SOURCES = \
@@ -172,6 +173,7 @@
        $(BOOST_LIBS) \
        $(PTHREAD_LIBS) \
        $(FREETYPE_LIBS) \
+       $(FONTCONFIG_LIBS) \
        $(NULL)
 
 if USE_SOUND_GST

Index: testsuite/misc-ming.all/DefineEditTextTest.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/DefineEditTextTest.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- testsuite/misc-ming.all/DefineEditTextTest.c        13 Jun 2007 02:59:27 
-0000      1.6
+++ testsuite/misc-ming.all/DefineEditTextTest.c        13 Jun 2007 09:59:43 
-0000      1.7
@@ -127,12 +127,17 @@
                SWFBrowserFont bfont = newSWFBrowserFont("_sans");
                SWFFont efont = loadSWFFontFromFile(font_file);
 
-               it = add_text_field(mo, (SWFBlock)bfont, "Hello device font 
world");
+               it = add_text_field(mo, (SWFBlock)bfont, "Hello device _sans 
font world");
                SWFDisplayItem_setName(it, "dtext");
                SWFDisplayItem_moveTo(it, 60, 60);
                it = add_text_field(mo, (SWFBlock)efont, "Hello embedded font 
world");
                SWFDisplayItem_setName(it, "etext");
                SWFDisplayItem_moveTo(it, 60, 120);
+
+               SWFBrowserFont bfont2 = newSWFBrowserFont("times");
+               it = add_text_field(mo, (SWFBlock)bfont2, "Hello device times 
font world");
+               SWFDisplayItem_setName(it, "dtext2");
+               SWFDisplayItem_moveTo(it, 60, 180);
        }
 
        SWFMovie_add(mo, newSWFAction("offset = 1; count=0;"
@@ -144,6 +149,9 @@
                                " dtext._y += offset;"
                                " dtext._x += offset;"
                                //" dtext._rotation += offset;"
+                               " dtext2._y += offset;"
+                               " dtext2._x += offset;"
+                               //" dtext2._rotation += offset;"
                                "};"
                                ));
 




reply via email to

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