able to play and analyze both money games and tournament matches, evaluate and roll out positions, and more. Driven by a command-line interface, it displays an ASCII rendering of a board on text-only terminals, but also allows the user to play games and manipulate positions with a graphical GTK+ interface. GNU Backgammon is extensible via Python. GNU Backgammon is a world class opponent and rates at around 2200 on FIBS, the First Internet Backgammon Server - at its best, it is in the top 5 of over 6000 rated players there). GNU Backgammon can be played on numerous other on-line backgammon servers. OK edd@
55 lines
2.0 KiB
Plaintext
55 lines
2.0 KiB
Plaintext
$OpenBSD: patch-board3d_font3d_c,v 1.1.1.1 2016/10/07 21:49:45 czarkoff Exp $
|
|
|
|
We make GNU Backgammon use system-supplied DejaVu fonts instead of bundling Vera
|
|
fonts. Thus stop building dynamically allocated paths for fonts.
|
|
|
|
--- board3d/font3d.c.orig Sun Apr 5 10:05:29 2015
|
|
+++ board3d/font3d.c Sun Apr 5 10:10:56 2015
|
|
@@ -73,7 +73,6 @@ static int RenderGlyph(const FT_Outline * pOutline);
|
|
int
|
|
CreateNumberFont(OGLFont ** ppFont, const char *fontFile, int pitch, float size, float heightRatio)
|
|
{
|
|
- char *filename;
|
|
FT_Library ftLib;
|
|
if (FT_Init_FreeType(&ftLib))
|
|
return 0;
|
|
@@ -81,20 +80,16 @@ CreateNumberFont(OGLFont ** ppFont, const char *fontFi
|
|
free(*ppFont);
|
|
*ppFont = (OGLFont *) malloc(sizeof(OGLFont));
|
|
|
|
- filename = BuildFilename(fontFile);
|
|
- if (!CreateOGLFont(ftLib, *ppFont, filename, pitch, size, heightRatio)) {
|
|
- outputerrf(_("Failed to create font from (%s)\n"), filename);
|
|
- g_free(filename);
|
|
+ if (!CreateOGLFont(ftLib, *ppFont, fontFile, pitch, size, heightRatio)) {
|
|
+ outputerrf(_("Failed to create font from (%s)\n"), fontFile);
|
|
return 0;
|
|
}
|
|
- g_free(filename);
|
|
return !FT_Done_FreeType(ftLib);
|
|
}
|
|
|
|
int
|
|
CreateFontText(OGLFont ** ppFont, const char *text, const char *fontFile, int pitch, float size, float heightRatio)
|
|
{
|
|
- char *filename;
|
|
|
|
FT_Library ftLib;
|
|
if (FT_Init_FreeType(&ftLib))
|
|
@@ -103,13 +98,10 @@ CreateFontText(OGLFont ** ppFont, const char *text, co
|
|
free(*ppFont);
|
|
*ppFont = (OGLFont *) malloc(sizeof(OGLFont));
|
|
|
|
- filename = BuildFilename(fontFile);
|
|
- if (!RenderText(text, ftLib, *ppFont, filename, pitch, size, heightRatio)) {
|
|
- outputerrf(_("Failed to create font from (%s)\n"), filename);
|
|
- g_free(filename);
|
|
+ if (!RenderText(text, ftLib, *ppFont, fontFile, pitch, size, heightRatio)) {
|
|
+ outputerrf(_("Failed to create font from (%s)\n"), fontFile);
|
|
return 0;
|
|
}
|
|
- g_free(filename);
|
|
return !FT_Done_FreeType(ftLib);
|
|
}
|
|
|