[pywin32-checkins] pywin32/Pythonwin win32util.cpp,1.6,1.7
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-11-03 20:36:39
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2944 Modified Files: win32util.cpp Log Message: Allow font quality to be specified in the LOGFONT - from Stefan Eischet Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32util.cpp 20 Jan 2004 22:26:41 -0000 1.6 --- win32util.cpp 3 Nov 2004 20:36:28 -0000 1.7 *************** *** 232,235 **** --- 232,236 ---- // // + static const char *szFontQuality = "quality"; static const char *szFontName = "name"; static const char *szFontWeight = "weight"; *************** *** 244,247 **** --- 245,249 ---- { PyObject *ret = PyDict_New(); + PyMapping_SetItemString( ret, (char *)szFontQuality, PyInt_FromLong(lf.lfQuality)); PyMapping_SetItemString( ret, (char *)szFontName, PyString_FromString((char *)lf.lfFaceName) ); PyMapping_SetItemString( ret, (char *)szFontHeight, PyInt_FromLong(-lf.lfHeight)); *************** *** 261,267 **** // font default values pLF->lfCharSet = DEFAULT_CHARSET; // dont use ANSI_CHARSET to support Japanese charset. ! pLF->lfQuality = PROOF_QUALITY; // don't scale raster fonts PyObject *v; v = PyDict_GetItemString (font_props, (char *)szFontName); --- 263,275 ---- // font default values pLF->lfCharSet = DEFAULT_CHARSET; // dont use ANSI_CHARSET to support Japanese charset. ! pLF->lfQuality = PROOF_QUALITY; // don't scale raster fonts and force anti aliasing PyObject *v; + v = PyDict_GetItemString (font_props, (char *)szFontQuality); + if (v != NULL) + if (PyInt_Check (v)) + pLF->lfQuality = (BYTE)PyInt_AsLong(v); + else + RETURN_ERR ("Expected integer value for font quality property"); v = PyDict_GetItemString (font_props, (char *)szFontName); |