[SCM] Packaging for Gargoyle - graphical player for Interactive Fiction games branch, master, updated. upstream/2009-08-25-10-geaad4f8

Sylvain Beucler beuc at beuc.net
Sun Sep 13 10:24:46 UTC 2009


The following commit has been merged in the master branch:
commit eaad4f8746c30f54869b6606154c5c62875952ed
Author: Sylvain Beucler <beuc at beuc.net>
Date:   Sun Sep 13 12:24:35 2009 +0200

    Replace non-free monospace font

diff --git a/debian/BUILD b/debian/BUILD
index 91a942c..af2ea94 100644
--- a/debian/BUILD
+++ b/debian/BUILD
@@ -9,6 +9,16 @@ or fmod (a non-free sound library). In our build, SDL is used.  So no
 need to worry about the fmod dependency or licensing.
 
 
+Fonts
+-----
+
+Gargoyle provides 2 sets of default fonts, a monospace (Luxi Mono) and
+a proportional (BitStream Charter).  Luxi is non-free, so we're
+replacing it.
+
+More information in patches/dfsg_replace_luximono_font.patch .
+
+
 Testing
 -------
 
diff --git a/debian/TODO b/debian/TODO
index 3eedb9e..573a59b 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -1,11 +1,3 @@
-- Replace LuxiMono with a _monospace_ font (_not_ BitStream Charter)
-
-  Games such as "The Moon Watch" refer to the original builtin fonts
-  in their .ini configuration: "LuxiMonoRegular", "LuxiMonoBold",
-  "LuxiMonoOblique", "LuxiMonoBoldOblique". In such case, we probably
-  should keep the interal font names as-is (not rename them) and
-  silently remap them to a free font such as FreeMono.
-
 - Watch for Alan as this interpreter may be released under a free
   license in the near future (as of 2009)
 
diff --git a/debian/control b/debian/control
index 4e17014..f673f58 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Homepage: http://ccxvii.net/gargoyle/
 
 Package: gargoyle-free
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, ttf-dejavu-core, ttf-dejavu-extra
 Description: graphical player for Interactive Fiction games
  Gargoyle is an Interactive Fiction (text adventure) player that
  supports all the major interactive fiction formats.
diff --git a/debian/patches/dfsg_replace_luximono_font.patch b/debian/patches/dfsg_replace_luximono_font.patch
index c82c369..d7c761e 100644
--- a/debian/patches/dfsg_replace_luximono_font.patch
+++ b/debian/patches/dfsg_replace_luximono_font.patch
@@ -1,12 +1,31 @@
-Description: remove the non-free LuxiMono font
-Forwarded: not-needed
+Description: replace the non-free LuxiMono font
+ Currently I'm trying DejaVu Sans Mono, though a Serif
+ font may be more appropriate.  Since DejaVu Sans Mono's license is not
+ compatible with the GNU GPL, it cannot be bundled in the executable,
+ so here's a patch to locate and load it using FontConfig.
+ .
+ Games such as "The Moon Watch" refer to the original builtin fonts
+ in their .ini configuration: "LuxiMonoRegular", "LuxiMonoBold",
+ "LuxiMonoOblique", "LuxiMonoBoldOblique". In such case, we probably
+ should keep the internal font names as-is (not rename them) and
+ silently remap them to the free font.
+Forwarded: http://groups.google.com/group/garglk-dev/browse_thread/thread/62a038ac4986d2a
 Author: Sylvain Beucler <beuc at beuc.net>
+Last-Update: 2009-09-13
 
-Index: gargoyle-2009.08.25/garglk/fontdata.c
+Index: gargoyle-free/garglk/fontdata.c
 ===================================================================
---- gargoyle-2009.08.25.orig/garglk/fontdata.c	2009-09-12 00:45:14.000000000 +0200
-+++ gargoyle-2009.08.25/garglk/fontdata.c	2009-09-12 00:45:21.000000000 +0200
-@@ -22,10 +22,12 @@
+--- gargoyle-free.orig/garglk/fontdata.c	2009-09-13 11:38:01.000000000 +0200
++++ gargoyle-free/garglk/fontdata.c	2009-09-13 12:15:25.000000000 +0200
+@@ -1,6 +1,7 @@
+ /******************************************************************************
+  *                                                                            *
+  * Copyright (C) 2006-2009 by Tor Andersson.                                  *
++ * Copyright (C) 2008, 2009  Sylvain Beucler                                        *
+  *                                                                            *
+  * This file is part of Gargoyle.                                             *
+  *                                                                            *
+@@ -22,10 +23,12 @@
  
  /* include hex-dumped font files */
  
@@ -19,32 +38,97 @@ Index: gargoyle-2009.08.25/garglk/fontdata.c
  
  #include "cbr.hex"
  #include "cbb.hex"
-@@ -37,20 +39,20 @@
+@@ -37,21 +40,17 @@
  	switch (idx)
  	{
  	case 0:
 -		*ptr = LuxiMonoRegular_pfb;
 -		*len = LuxiMonoRegular_pfb_len;
-+		*ptr = CharterBT_Roman_ttf;
-+		*len = CharterBT_Roman_ttf_len;
- 		break;
+-		break;
++	  gli_get_system_font("DejaVu Sans Mono:style=Book", ptr, len);
++	  break;
  	case 1:
 -		*ptr = LuxiMonoBold_pfb;
 -		*len = LuxiMonoBold_pfb_len;
-+		*ptr = CharterBT_Bold_ttf;
-+		*len = CharterBT_Bold_ttf_len;
- 		break;
+-		break;
++	  gli_get_system_font("DejaVu Sans Mono:style=Bold", ptr, len);
++	  break;
  	case 2:
 -		*ptr = LuxiMonoOblique_pfb;
 -		*len = LuxiMonoOblique_pfb_len;
-+		*ptr = CharterBT_Italic_ttf;
-+		*len = CharterBT_Italic_ttf_len;
- 		break;
+-		break;
++	  gli_get_system_font("DejaVu Sans Mono:style=Oblique", ptr, len);
++	  break;
  	case 3:
 -		*ptr = LuxiMonoBoldOblique_pfb;
 -		*len = LuxiMonoBoldOblique_pfb_len;
-+		*ptr = CharterBT_BoldItalic_ttf;
-+		*len = CharterBT_BoldItalic_ttf_len;
- 		break;
+-		break;
++	  gli_get_system_font("DejaVu Sans Mono:style=Bold Oblique", ptr, len);
++	  break;
  
  	case 4:
+ 		*ptr = CharterBT_Roman_ttf;
+@@ -76,3 +75,63 @@
+ 	}
+ }
+ 
++#include <fontconfig/fontconfig.h>
++#include <stdio.h>
++#include <stdlib.h>
++/* Get filename for canonical font name 'fontname'. Return NULL if the
++   font cannot be found (for correctness, no alternate font will be
++   provided). */
++int gli_get_system_font(char* fontname, unsigned char **ptr, unsigned int *len)
++{
++  *ptr = 0;
++  *len = 0;
++
++  char* filename = NULL;
++  FcPattern* p = NULL;
++  FcChar8* strval = NULL;
++  FcObjectSet *attr = NULL;
++
++  if (!FcInit())
++    {
++      winabort("Internal error: cannot initialize fontconfig");
++      return 0;
++    }
++
++  p = FcNameParse((FcChar8*)fontname);
++  if (p == NULL)
++    {
++      winabort("Internal error: invalid font pattern: %s", fontname);
++      return 0;
++    }
++  /* Grab filename attribute */
++  attr = FcObjectSetBuild (FC_FILE, (char *) 0);
++
++  FcFontSet *fs = FcFontList (0, p, attr);
++  if (fs->nfont == 0)
++    {
++      winabort("gli_get_system_font: no matching font for %s", fontname);
++      return 0;
++    }
++  if (FcPatternGetString(fs->fonts[0], FC_FILE, 0, &strval) == FcResultTypeMismatch
++      || strval == NULL)
++    {
++      winabort("get_fontconfig_path: cannot find font filename for %s", fontname);
++      return 0;
++    }
++
++  FILE* fp = fopen(strval, "rb");
++  fseek(fp, 0L, SEEK_END);
++  *len = ftell(fp);
++  fseek(fp, 0L, SEEK_SET);
++
++  *ptr = malloc(*len);
++  fread(*ptr, 1, *len, fp);
++  fclose(fp);
++
++  FcFontSetDestroy(fs);
++  FcObjectSetDestroy(attr);
++  FcPatternDestroy(p);
++  FcFini();
++
++  return 1;
++}
diff --git a/debian/patches/series b/debian/patches/series
index 957dbec..b66ce69 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,6 @@
+ignore_bundled_libraries.patch
+sdl_sound_debian.patch
 dfsg_disable_alan.patch
 dfsg_disable_hugo.patch
 dfsg_replace_luximono_font.patch
-ignore_bundled_libraries.patch
-sdl_sound_debian.patch
 fhs_locate_private_library.patch

-- 
Packaging for Gargoyle - graphical player for Interactive Fiction games



More information about the Pkg-games-commits mailing list