X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..31e39e3c51f0a14a49ba86a5326e1461ad60dfee:/src/motif/font.cpp diff --git a/src/motif/font.cpp b/src/motif/font.cpp index 817ca89938..a032dd8775 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: font.cpp +// Name: src/motif/font.cpp // Purpose: wxFont class // Author: Julian Smart // Modified by: @@ -21,17 +21,23 @@ #pragma implementation "font.h" #endif +#ifdef __VMS +#pragma message disable nosimpint +#include "wx/vms_x_fix.h" +#endif +#include +#ifdef __VMS +#pragma message enable nosimpint +#endif + #include "wx/defs.h" #include "wx/string.h" #include "wx/font.h" #include "wx/gdicmn.h" -#include "wx/utils.h" - -#include +#include "wx/utils.h" // for wxGetDisplay() +#include "wx/fontutil.h" // for wxNativeFontInfo -#if !USE_SHARED_LIBRARIES - IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) -#endif +IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) // ---------------------------------------------------------------------------- // private classes @@ -39,7 +45,7 @@ // For every wxFont, there must be a font for each display and scale requested. // So these objects are stored in wxFontRefData::m_fonts -class wxXFont: public wxObject +class wxXFont : public wxObject { public: wxXFont(); @@ -180,10 +186,16 @@ wxFontRefData::~wxFontRefData() // wxFont // ---------------------------------------------------------------------------- +wxFont::wxFont(const wxNativeFontInfo& info) +{ + Init(); + + (void)Create(info.pointSize, info.family, info.style, info.weight, + info.underlined, info.faceName, info.encoding); +} + void wxFont::Init() { - if ( wxTheFontList ) - wxTheFontList->Append(this); } bool wxFont::Create(int pointSize, @@ -205,8 +217,6 @@ bool wxFont::Create(int pointSize, wxFont::~wxFont() { - if ( wxTheFontList ) - wxTheFontList->DeleteObject(this); } // ---------------------------------------------------------------------------- @@ -359,17 +369,18 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const } // not found, create a new one - XFontStruct *font = wxLoadQueryNearestFont(pointSize, + XFontStruct *font = (XFontStruct *) + wxLoadQueryNearestFont(pointSize, M_FONTDATA->m_family, M_FONTDATA->m_style, M_FONTDATA->m_weight, M_FONTDATA->m_underlined, - T(""), + wxT(""), M_FONTDATA->m_encoding); if ( !font ) { - wxFAIL_MSG( T("Could not allocate even a default font -- something is wrong.") ); + wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") ); return (wxXFont*) NULL; } @@ -397,3 +408,4 @@ WXFontList wxFont::GetFontList(double scale, WXDisplay* display) const return (f ? f->m_fontList : (WXFontList) 0); } +