bug-gnubg
[Top][All Lists]
Advanced

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

[Bug-gnubg] luxi.c covered under non-free license


From: Russ Allbery
Subject: [Bug-gnubg] luxi.c covered under non-free license
Date: Sat, 20 May 2006 20:50:25 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.18 (linux)

While packaging the current CVS, I noticed that luxi.c embeds a font whose
license includes the following clause:

    The Font Software may not be modified, altered, or added to, and in
    particular the designs of glyphs or characters in the Fonts may not be
    modified nor may additional glyphs or characters be added to the
    Fonts.  This License becomes null and void when the Fonts or Font
    Software have been modified.

This was also in 0.14.3, but I hadn't noticed it.  This clause makes the
license not DFSG-compatible, so that file cannot be included in Debian.  I
believe it also makes it not GPL-compatible; it may be worth changing this
in gnubg as well.

What I did for Debian is make the Debian gnubg package depend on the
ttf-bitstream-vera package and load Bitstream Vera at runtime.  This is a
completely free font and the letter quality seems good to me for gnubg's
purposes.  gnubg could just include the three font files that it uses and
install them in its own data directory.

Here's the patch that I'm using for Debian.  It's not exactly what you
want, but it should give you a general idea of how gnubg could be modified
to load a free font file at run time.

Index: gnubg/Makefile.am
===================================================================
--- gnubg.orig/Makefile.am      2006-05-20 17:48:25.000000000 -0700
+++ gnubg/Makefile.am   2006-05-20 17:48:26.000000000 -0700
@@ -40,11 +40,7 @@ else
 BR1_SOURCES =
 endif
 
-if USE_FREETYPE
-FONT_SOURCES = luxi.c
-else
 FONT_SOURCES =
-endif
 
 if EXTERNAL_BR1
 BR1DATA = gnubg_os0.bd
Index: gnubg/render.c
===================================================================
--- gnubg.orig/render.c 2006-05-20 17:27:58.000000000 -0700
+++ gnubg/render.c      2006-05-20 17:48:26.000000000 -0700
@@ -133,8 +133,10 @@ FT_Library ftl;
 #define FT_PIXEL_MODE_GRAY ft_pixel_mode_grays
 #endif
 
-extern unsigned char auchLuxiRB[], auchLuxiSB[], auchLuxiSR[];
-extern unsigned int cbLuxiRB, cbLuxiSB, cbLuxiSR;
+#define FONT_PATH "/usr/share/fonts/truetype/ttf-bitstream-vera"
+#define FONT_VERA FONT_PATH "/Vera.ttf"
+#define FONT_VERA_BOLD FONT_PATH "/VeraBd.ttf"
+#define FONT_VERA_SERIF_BOLD FONT_PATH "/VeraSeBd.ttf"
 
 #endif
 
@@ -1530,7 +1532,7 @@ RenderLabels( renderdata *prd, unsigned 
     int i;
     FT_Glyph aftg[ 10 ];
 
-    if( FT_New_Memory_Face( ftl, auchLuxiSB, cbLuxiSB, 0, &ftf ) )
+    if( FT_New_Face( ftl, FONT_VERA_BOLD, 0, &ftf ) )
        {
                RenderBasicLabels( prd, puch, nStride, iStart, iEnd, iDelta );
                return;
@@ -1861,7 +1863,7 @@ extern void RenderChequerLabels( renderd
     FT_Glyph aftg[ 10 ];
     int fFreetype = FALSE;
     
-    if( !FT_New_Memory_Face( ftl, auchLuxiSR, cbLuxiSR, 0, &ftf ) &&
+    if( !FT_New_Face( ftl, FONT_VERA, 0, &ftf ) &&
        !FT_Set_Pixel_Sizes( ftf, 0, 2 * prd->nSize ) ) {
        fFreetype = TRUE;
        for( i = 0; i < 10; i++ ) {
@@ -2038,7 +2040,7 @@ extern void RenderCubeFaces( renderdata 
     FT_Glyph aftg[ 10 ], aftgSmall[ 10 ];
     int fFreetype = FALSE;
     
-    if( !FT_New_Memory_Face( ftl, auchLuxiRB, cbLuxiRB, 0, &ftf ) &&
+    if( !FT_New_Face( ftl, FONT_VERA_SERIF_BOLD, 0, &ftf ) &&
        !FT_Set_Pixel_Sizes( ftf, 0, 5 * prd->nSize ) ) {
        fFreetype = TRUE;
        
@@ -2118,7 +2120,7 @@ extern void RenderResignFaces( renderdat
     FT_Glyph aftg[ 10 ], aftgSmall[ 10 ];
     int fFreetype = FALSE;
     
-    if( !FT_New_Memory_Face( ftl, auchLuxiRB, cbLuxiRB, 0, &ftf ) &&
+    if( !FT_New_Face( ftl, FONT_VERA_SERIF_BOLD, 0, &ftf ) &&
        !FT_Set_Pixel_Sizes( ftf, 0, 5 * prd->nSize ) ) {
        fFreetype = TRUE;
        
Index: gnubg/board3d/font3d.c
===================================================================
--- gnubg.orig/board3d/font3d.c 2006-05-20 17:49:12.000000000 -0700
+++ gnubg/board3d/font3d.c      2006-05-20 17:50:57.000000000 -0700
@@ -30,6 +30,10 @@
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#define FONT_PATH "/usr/share/fonts/truetype/ttf-bitstream-vera"
+#define FONT_VERA FONT_PATH "/Vera.ttf"
+#define FONT_VERA_SERIF_BOLD FONT_PATH "/VeraSeBd.ttf"
+
 #define FONT_SIZE (base_unit / 20.0f)
 #define CUBE_FONT_SIZE (base_unit / 24.0f)
 
@@ -71,7 +75,7 @@ void PopulateContour(Contour* pContour, 
 void PopulateMesh(Vectoriser* pVect, Mesh* pMesh);
 int MakeGlyph(FT_Outline* pOutline, int list);
 
-int CreateOGLFont(FT_Library ftLib, OGLFont *pFont, unsigned char 
*pBufferBytes, unsigned int bufferSizeInBytes, int pointSize, float scale)
+int CreateOGLFont(FT_Library ftLib, OGLFont *pFont, const char *pPath, int 
pointSize, float scale)
 {
        int i, j;
        FT_Face face;
@@ -79,7 +83,7 @@ int CreateOGLFont(FT_Library ftLib, OGLF
        memset(pFont, 0, sizeof(OGLFont));
        pFont->scale = scale;
 
-       if (FT_New_Memory_Face(ftLib, (FT_Byte *)pBufferBytes, 
bufferSizeInBytes, 0, &face))
+       if (FT_New_Face(ftLib, pPath, 0, &face))
                return 0;
 
        if (FT_Set_Char_Size(face, 0, pointSize * 64 /* 26.6 fractional points 
*/, 0, 0))
@@ -134,9 +138,9 @@ int BuildFont3d(BoardData* bd)
        if (FT_Init_FreeType(&ftLib))
                return 0;
 
-       if (!CreateOGLFont(ftLib, &bd->numberFont, auchLuxiSR, cbLuxiSR, 24, 
FONT_SIZE))
+       if (!CreateOGLFont(ftLib, &bd->numberFont, FONT_VERA, 24, FONT_SIZE))
                return 0;
-       if (!CreateOGLFont(ftLib, &bd->cubeFont, auchLuxiRB, cbLuxiRB, 44, 
CUBE_FONT_SIZE))
+       if (!CreateOGLFont(ftLib, &bd->cubeFont, FONT_VERA_SERIF_BOLD, 44, 
CUBE_FONT_SIZE))
                return 0;
 
        return !FT_Done_FreeType(ftLib);


-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

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