123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- $OpenBSD: patch-render_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.
- --- render.c.orig Sun Oct 19 23:24:53 2014
- +++ render.c Tue Apr 7 11:21:30 2015
- @@ -52,14 +52,6 @@
- static randctx rc;
- #define RAND irand( &rc )
-
- -#if HAVE_FREETYPE
- -#define FONT_VERA "fonts/Vera.ttf"
- -#define FONT_VERA_SERIF_BOLD "fonts/VeraSeBd.ttf"
- -#if 0 /* unused for now */
- -#define FONT_VERA_BOLD "fonts/VeraBd.ttf"
- -#endif
- -#endif
- -
- /* aaanPositions[Clockwise][x][point number][x, y. deltay] */
- int positions[2][30][3] = { {
- {BAR_X, BAR_Y_1, -CHEQUER_HEIGHT}, /* bar - player 1 */
- @@ -1475,15 +1467,11 @@ RenderLabels(renderdata * prd, unsigned char *puch, in
- FT_Face ftf;
- int i;
- FT_Glyph aftg[10];
- - char *file;
-
- - file = BuildFilename(FONT_VERA);
- - if (FT_New_Face(ftl, file, 0, &ftf)) {
- + if (FT_New_Face(ftl, FONT_VERA, 0, &ftf)) {
- RenderBasicLabels(prd, puch, nStride, iStart, iEnd, iDelta);
- - g_free(file);
- return;
- }
- - g_free(file);
-
- if (FT_Set_Pixel_Sizes(ftf, 0, prd->nSize * 5 / 2)) {
- RenderBasicLabels(prd, puch, nStride, iStart, iEnd, iDelta);
- @@ -1761,10 +1749,8 @@ RenderChequerLabels(renderdata * prd, unsigned char *p
- FT_Face ftf;
- FT_Glyph aftg[10];
- int fFreetype = FALSE;
- - char *file;
-
- - file = BuildFilename(FONT_VERA);
- - if (!FT_New_Face(ftl, file, 0, &ftf) && !FT_Set_Pixel_Sizes(ftf, 0, 2 * prd->nSize)) {
- + 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++) {
- FT_Load_Char(ftf, '0' + i, FT_LOAD_RENDER);
- @@ -1773,7 +1759,6 @@ RenderChequerLabels(renderdata * prd, unsigned char *p
-
- FT_Done_Face(ftf);
- }
- - g_free(file);
- #endif
-
- for (i = 0; i < 12; i++) {
- @@ -1932,8 +1917,7 @@ RenderCubeFaces(renderdata * prd, unsigned char *puch,
- int fFreetype = FALSE;
- char *file;
-
- - file = BuildFilename(FONT_VERA_SERIF_BOLD);
- - if (!FT_New_Face(ftl, file, 0, &ftf) && !FT_Set_Pixel_Sizes(ftf, 0, 3 * prd->nSize)) {
- + if (!FT_New_Face(ftl, FONT_VERA_SERIF_BOLD, 0, &ftf) && !FT_Set_Pixel_Sizes(ftf, 0, 3 * prd->nSize)) {
- fFreetype = TRUE;
-
- for (i = 0; i < 10; i++) {
- @@ -1950,7 +1934,6 @@ RenderCubeFaces(renderdata * prd, unsigned char *puch,
-
- FT_Done_Face(ftf);
- }
- - g_free(file);
- #endif
-
- for (i = 0; i < 6; i++) {
- @@ -2010,8 +1993,7 @@ RenderResignFaces(renderdata * prd, unsigned char *puc
- int fFreetype = FALSE;
- char *file;
-
- - file = BuildFilename(FONT_VERA_SERIF_BOLD);
- - if (!FT_New_Face(ftl, file, 0, &ftf) && !FT_Set_Pixel_Sizes(ftf, 0, 4 * prd->nSize)) {
- + if (!FT_New_Face(ftl, FONT_VERA_SERIF_BOLD, 0, &ftf) && !FT_Set_Pixel_Sizes(ftf, 0, 4 * prd->nSize)) {
- fFreetype = TRUE;
-
- for (i = 0; i < 10; i++) {
- @@ -2028,7 +2010,6 @@ RenderResignFaces(renderdata * prd, unsigned char *puc
-
- FT_Done_Face(ftf);
- }
- - g_free(file);
- #endif
-
- for (i = 0; i < 3; i++) {
|