X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e99762c031bf2c71af7f856c1d713bce0422acaa..2c18f21dc7d5aedd7100b02f7a721551b73c537b:/src/os2/font.cpp?ds=sidebyside diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 38289bdeba..d33d991d89 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -161,6 +161,21 @@ wxFontRefData::~wxFontRefData() // wxFont // ---------------------------------------------------------------------------- +wxFont::wxFont(const wxNativeFontInfo& rInfo) + { + Init(); + + (void)Create( rInfo.pointSize + ,rInfo.family + ,rInfo.style + ,rInfo.weight + ,rInfo.underlined + ,rInfo.faceName + ,rInfo.encoding + ); + } + + void wxFont::Init() { if ( wxTheFontList ) @@ -355,7 +370,7 @@ bool wxFont::RealizeResource() vError = ::WinGetLastError(vHabmain); } - strcpy(zFacename, M_FONTDATA->m_vFattrs.szFacename); + M_FONTDATA->m_sFaceName = zFacename; if(::GpiCreateLogFont( M_FONTDATA->m_hPS ,NULL @@ -399,12 +414,17 @@ bool wxFont::FreeResource( return FALSE; } // end of wxFont::FreeResource -WXHANDLE wxFont::GetResourceHandle() +WXHANDLE wxFont::GetHFONT() const { if (!M_FONTDATA) return 0; else return (WXHANDLE)M_FONTDATA->m_hFont; +} // end of wxFont::GetHFONT + +WXHANDLE wxFont::GetResourceHandle() +{ + return GetHFONT(); } // end of wxFont::GetResourceHandle bool wxFont::IsFree() const