Commits

Anonymous committed 81809b2

new font

  • Participants
  • Parent commits 971eddb

Comments (0)

Files changed (8)

 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+Auguest 14, 2002
+	switched to FSF's FreeSansBold default font
+	new font.get_default_font()
+	cleanup harmless void** typing
+
 July 24, 2002
 	Ole Martin Bjoerndalen's CD.play fix
 

lib/freesansbold.ttf

Binary file added.

lib/helmetb.ttf

Binary file removed.

lib/helmetb.txt

-You may only copy and distribute this program consistent with the requirements
-and distribute this Program consistent with the requirements of either the GNU
-General Public License (GPL) and GNU Lesser General Public License (LGPL) or
-the Sun Industry Standards Source License (SISSL), respectively, depending on
-whether you elected to obtain access to this program via the GPL/LGPL Option or
-the SISSL Option. Copies of the GPL, LGPL and SISSL licenses can be found
-http://www.openoffice.org/project/www/license.html
-
-------------------------------------
-Copyright 2000 OpenOffice.org. All rights reserved.
 #define PyFont_Check(x) ((x)->ob_type == &PyFont_Type)
 
 static int font_initialized = 0;
-static char* font_defaultname = "helmetb.ttf";
+static char* font_defaultname = "freesansbold.ttf";
 static char* font_defaultpath = NULL;
 static PyObject* self_module = NULL;
 
 
 /*font module methods*/
 
+    /*DOC*/ static char doc_get_default_font[] =
+    /*DOC*/    "pygame.font.get_default_font() -> string\n"
+    /*DOC*/    "get the name of the default font\n"
+    /*DOC*/    "\n"
+    /*DOC*/    "returns the name for the default truetype font.\n"
+    /*DOC*/ ;
+
+static PyObject* get_default_font(PyObject* self, PyObject* args)
+{
+	if(!PyArg_ParseTuple(args, ""))
+		return NULL;
+	return PyString_FromString(font_defaultname);
+}
+
+
+
+/*font module methods*/
+
     /*DOC*/ static char doc_Font[] =
     /*DOC*/    "pygame.font.Font(file, size) -> Font\n"
     /*DOC*/    "create a new font object\n"
 			return RAISE(PyExc_RuntimeError, "default font not found");
 		filename = font_defaultpath;
 		/*keep sizing consistent with previous default fonts*/
-		fontsize = (int)(fontsize * .7);
-                /*helmetb seems to err for this one size*/
-                if(fontsize==16) fontsize = 17;
+		fontsize = (int)(fontsize * .6875);
 	}
 	else if(PyString_Check(fileobj) || PyUnicode_Check(fileobj))
 	{
 	{ "init", font_init, 1, doc_init },
 	{ "quit", font_quit, 1, doc_quit },
 	{ "get_init", get_init, 1, doc_get_init },
+	{ "get_default_font", get_default_font, 1, doc_get_default_font },
 
 	{ "Font", Font, 1, doc_Font },
-
 	{ NULL, NULL }
 };
 
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			memcpy(PyFONT_C_API, localptr, sizeof(void*)*PYGAMEAPI_FONT_NUMSLOTS); \
 } Py_DECREF(module); } }
 #endif
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			memcpy(PyMIXER_C_API, localptr, sizeof(void*)*PYGAMEAPI_MIXER_NUMSLOTS); \
 } Py_DECREF(module); } }
 #endif
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			int i; void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			int i; void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			for(i = 0; i < PYGAMEAPI_RECT_NUMSLOTS; ++i) \
 				PyGAME_C_API[i + PYGAMEAPI_RECT_FIRSTSLOT] = localptr[i]; \
 } Py_DECREF(module); } }
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			int i; void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			int i; void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			for(i = 0; i < PYGAMEAPI_CDROM_NUMSLOTS; ++i) \
 				PyGAME_C_API[i + PYGAMEAPI_CDROM_FIRSTSLOT] = localptr[i]; \
 } Py_DECREF(module); } }
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			int i; void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			int i; void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			for(i = 0; i < PYGAMEAPI_JOYSTICK_NUMSLOTS; ++i) \
 				PyGAME_C_API[i + PYGAMEAPI_JOYSTICK_FIRSTSLOT] = localptr[i]; \
 } Py_DECREF(module); } }
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			int i; void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			int i; void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			for(i = 0; i < PYGAMEAPI_DISPLAY_NUMSLOTS; ++i) \
 				PyGAME_C_API[i + PYGAMEAPI_DISPLAY_FIRSTSLOT] = localptr[i]; \
 } Py_DECREF(module); } }
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			int i; void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			int i; void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			for(i = 0; i < PYGAMEAPI_SURFLOCK_NUMSLOTS; ++i) \
 				PyGAME_C_API[i + PYGAMEAPI_SURFLOCK_FIRSTSLOT] = localptr[i]; \
 } Py_DECREF(module); } }
 		PyObject *dict = PyModule_GetDict(module); \
 		PyObject *c_api = PyDict_GetItemString(dict, PYGAMEAPI_LOCAL_ENTRY); \
 		if(PyCObject_Check(c_api)) {\
-			int i; void** localptr = (void*)PyCObject_AsVoidPtr(c_api); \
+			int i; void** localptr = (void**)PyCObject_AsVoidPtr(c_api); \
 			for(i = 0; i < PYGAMEAPI_EVENT_NUMSLOTS; ++i) \
 				PyGAME_C_API[i + PYGAMEAPI_EVENT_FIRSTSLOT] = localptr[i]; \
 } Py_DECREF(module); } }