// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#include "wx/defs.h"
-
#ifdef __VMS
#pragma message disable nosimpint
#include "wx/vms_x_fix.h"
#pragma message enable nosimpint
#endif
-#include "wx/string.h"
#include "wx/font.h"
-#include "wx/gdicmn.h"
-#include "wx/utils.h" // for wxGetDisplay()
+
+#ifndef WX_PRECOMP
+ #include "wx/string.h"
+ #include "wx/utils.h" // for wxGetDisplay()
+ #include "wx/settings.h"
+ #include "wx/gdicmn.h"
+#endif
+
#include "wx/fontutil.h" // for wxNativeFontInfo
#include "wx/tokenzr.h"
-#include "wx/settings.h"
#include "wx/motif/private.h"
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
{
public:
wxXFont();
- ~wxXFont();
+ virtual ~wxXFont();
#if !wxMOTIF_NEW_FONT_HANDLING
WXFontStructPtr m_fontStruct; // XFontStruct
data.m_underlined, data.m_faceName, data.m_encoding);
}
- ~wxFontRefData();
+ virtual ~wxFontRefData();
protected:
// common part of all ctors
M_FONTDATA->m_nativeFontInfo.GetXFontName().Clear(); // invalid now
}
-void wxFont::SetFaceName(const wxString& faceName)
+bool wxFont::SetFaceName(const wxString& faceName)
{
Unshare();
M_FONTDATA->m_faceName = faceName;
M_FONTDATA->m_nativeFontInfo.GetXFontName().Clear(); // invalid now
+
+ return wxFontBase::SetFaceName(faceName);
}
void wxFont::SetUnderlined(bool underlined)
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), wxT(""), wxT("invalid font") );
+ wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
return M_FONTDATA->m_faceName ;
}
{
wxCHECK_MSG( Ok(), (wxNativeFontInfo *)NULL, wxT("invalid font") );
- if(M_FONTDATA->m_nativeFontInfo.GetXFontName().IsEmpty())
+ if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty())
GetInternalFont();
return &(M_FONTDATA->m_nativeFontInfo);
#endif
f->m_display = ( display ? display : wxGetDisplay() );
f->m_scale = intScale;
-
+
#if wxMOTIF_USE_RENDER_TABLE
XmRendition rendition;
XmRenderTable renderTable;
{
XRectangle ink, logical;
WXFontSet fset = font.GetFontSet(scale, display);
-
+
XmbTextExtents( (XFontSet)fset, str.c_str(), str.length(), &ink, &logical);
if( width ) *width = logical.width;
if( height ) *height = logical.height;
- if( ascent ) *ascent = -logical.y;
- if( descent ) *descent = logical.height + logical.y;
+ if( ascent ) *ascent = -logical.y;
+ if( descent ) *descent = logical.height + logical.y;
}
#else // if !wxMOTIF_NEW_FONT_HANDLING
int direction, ascent2, descent2;
XCharStruct overall;
- int slen = str.Len();
+ int slen = str.length();
XTextExtents((XFontStruct*) pFontStruct, (char*) str.c_str(), slen,
&direction, &ascent2, &descent2, &overall);