// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
- #pragma implementation "fontutil.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
vLogFont.fsFontUse = FATTR_FONTUSE_OUTLINE | // only outline fonts allowed
FATTR_FONTUSE_TRANSFORMABLE; // may be transformed
- wxStrncpy((wxChar*)vLogFont.szFacename, rInfo.facename.c_str(), WXSIZEOF(vLogFont.szFacename));
+ wxStrlcpy((wxChar*)vLogFont.szFacename, rInfo.facename.c_str(), WXSIZEOF(vLogFont.szFacename));
if (!::GpiCreateLogFont( hPS
,NULL
// NOTE: 1 point == 1/72 of an inch.
//
- vSizef.cx = (FIXED)(((fxPointSize) / 72 ) * lXFontResolution );
- vSizef.cy = (FIXED)(((fxPointSize) / 72 ) * lYFontResolution );
+ // multiply first to avoid getting vSizef.cx,cy = 0 since fxPointSize
+ // is normally < 72 and FontResolution is typically ca. 100
+ vSizef.cx = (FIXED)( (fxPointSize * lXFontResolution) / 72 );
+ vSizef.cy = (FIXED)( (fxPointSize * lYFontResolution) / 72 );
- pFattrs->lMaxBaselineExt = MAKELONG( HIUSHORT( vSizef.cy ), 0 );
- pFattrs->lAveCharWidth = MAKELONG( HIUSHORT( vSizef.cx ), 0 );
+ if (pFattrs)
+ {
+ pFattrs->lMaxBaselineExt = MAKELONG( HIUSHORT( vSizef.cy ), 0 );
+ pFattrs->lAveCharWidth = MAKELONG( HIUSHORT( vSizef.cx ), 0 );
+ }
WinReleasePS(hPS);
} // end of wxConvertVectorPointSize
break;
}
- wxStrncpy(zFontFaceName, sFaceName.c_str(), WXSIZEOF(zFontFaceName));
+ wxStrlcpy(zFontFaceName, sFaceName.c_str(), WXSIZEOF(zFontFaceName));
nPointSize = pFont->GetPointSize();
//