)
{
wxString sFaceName;
- long flId;
+ long flId = m_hFont;
if (!m_bNativeFontInfoOk)
{
wxFillLogFont( &m_vNativeFontInfo.fa
,&m_vNativeFontInfo.fn
- ,m_hPS
+ ,&m_hPS
+ ,&m_bInternalPS
,&flId
,sFaceName
,pFont
,flId
,&m_vNativeFontInfo.fa
) != GPI_ERROR)
- m_hFont = (WXHFONT)1;
+ m_hFont = (WXHFONT)flId;
+ m_nFontId = flId;
- //
- // We don't actuall keep the font around if using a temporary PS
- //
- if (m_bInternalPS)
- {
- if(m_hFont)
- ::GpiDeleteSetId( m_hPS
- ,flId
- );
-
- ::WinReleasePS(m_hPS);
- }
- else
- //
- // Select the font into the Presentation space
- //
- ::GpiSetCharSet(m_hPS, flId); // sets font for presentation space
if (!m_hFont)
{
wxLogLastError("CreateFont");
//
// Set refData members with the results
//
- m_hFont = (WXHFONT)m_nFontId;
memcpy(&m_vFattrs, &m_vNativeFontInfo.fa, sizeof(m_vFattrs));
memcpy(&m_vFname, &m_vNativeFontInfo.fn, sizeof(m_vFname));
m_nPointSize = m_vNativeFontInfo.fm.lEmHeight;
m_nFamily = wxSCRIPT;
else if (strcmp(m_vNativeFontInfo.fa.szFacename, "Courier New") == 0)
m_nFamily = wxMODERN;
+ else if (strcmp(m_vNativeFontInfo.fa.szFacename, "Courier") == 0)
+ m_nFamily = wxMODERN;
else
m_nFamily = wxSWISS;
m_bUnderlined = ((m_vNativeFontInfo.fa.fsSelection & FATTR_SEL_UNDERSCORE) != 0);
m_sFaceName = m_vNativeFontInfo.fa.szFacename;
m_vEncoding = wxGetFontEncFromCharSet(m_vNativeFontInfo.fa.usCodePage);
+
+ //
+ // We don't actuall keep the font around if using a temporary PS
+ //
+ if (m_bInternalPS)
+ {
+ if(m_hFont)
+ ::GpiDeleteSetId( m_hPS
+ ,flId
+ );
+
+ ::WinReleasePS(m_hPS);
+ }
+ else
+ //
+ // Select the font into the Presentation space
+ //
+ ::GpiSetCharSet(m_hPS, flId); // sets font for presentation space
return TRUE;
} // end of wxFontRefData::Alloc
} // end of wxFont::SetFM
+void wxFont::SetPS(
+ HPS hPS
+)
+{
+ Unshare();
+
+ M_FONTDATA->SetPS(hPS);
+
+ RealizeResource();
+} // end of wxFont::SetUnderlined
+