git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13611
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual wxString GetFaceName() const;
virtual bool GetUnderlined() const;
virtual wxFontEncoding GetEncoding() const;
virtual wxString GetFaceName() const;
virtual bool GetUnderlined() const;
virtual wxFontEncoding GetEncoding() const;
+ virtual bool IsFixedWidth() const;
virtual void SetPointSize(int pointSize);
virtual void SetFamily(int family);
virtual void SetPointSize(int pointSize);
virtual void SetFamily(int family);
class wxMGLFontLibrary
{
public:
class wxMGLFontLibrary
{
public:
- wxMGLFontLibrary(const wxString& filename, int type);
+ wxMGLFontLibrary(const wxString& filename, int type, wxMGLFontFamily *parentFamily);
~wxMGLFontLibrary();
wxMGLFontInstance *GetFontInstance(wxFont *font, float scale, bool aa);
~wxMGLFontLibrary();
wxMGLFontInstance *GetFontInstance(wxFont *font, float scale, bool aa);
+ wxMGLFontFamily *GetFamily() const { return m_family; }
void IncRef();
void DecRef();
void IncRef();
void DecRef();
wxString m_fileName;
size_t m_refs;
wxMGLFontInstanceList *m_instances;
wxString m_fileName;
size_t m_refs;
wxMGLFontInstanceList *m_instances;
+ wxMGLFontFamily *m_family;
};
// structure representing native MGL font family
};
// structure representing native MGL font family
#include "wx/gdicmn.h"
#include "wx/tokenzr.h"
#include "wx/settings.h"
#include "wx/gdicmn.h"
#include "wx/tokenzr.h"
#include "wx/settings.h"
+#include "wx/mgl/private.h"
// ----------------------------------------------------------------------------
// wxFontRefData
// ----------------------------------------------------------------------------
// wxFontRefData
return M_FONTDATA->m_encoding;
}
return M_FONTDATA->m_encoding;
}
+bool wxFont::IsFixedWidth() const
+{
+ wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+
+ return (bool)(M_FONTDATA->m_library->GetFamily()->GetInfo()->isFixed);
+}
+
// ----------------------------------------------------------------------------
// change font attributes
// ----------------------------------------------------------------------------
// change font attributes
MGL_unloadFontInstance(m_font);
}
MGL_unloadFontInstance(m_font);
}
-wxMGLFontLibrary::wxMGLFontLibrary(const wxString& filename, int type)
+wxMGLFontLibrary::wxMGLFontLibrary(const wxString& filename, int type,
+ wxMGLFontFamily *parentFamily)
+ m_family = parentFamily;
m_type = type;
m_fileName = filename;
m_refs = 0;
m_type = type;
m_fileName = filename;
m_refs = 0;
m_fontLibs[wxFONTFACE_REGULAR] = NULL;
else
m_fontLibs[wxFONTFACE_REGULAR] =
m_fontLibs[wxFONTFACE_REGULAR] = NULL;
else
m_fontLibs[wxFONTFACE_REGULAR] =
- new wxMGLFontLibrary(info->regularFace, wxFONTFACE_REGULAR);
+ new wxMGLFontLibrary(info->regularFace, wxFONTFACE_REGULAR, this);
if ( info->italicFace[0] == '\0' )
m_fontLibs[wxFONTFACE_ITALIC] = NULL;
else
m_fontLibs[wxFONTFACE_ITALIC] =
if ( info->italicFace[0] == '\0' )
m_fontLibs[wxFONTFACE_ITALIC] = NULL;
else
m_fontLibs[wxFONTFACE_ITALIC] =
- new wxMGLFontLibrary(info->italicFace, wxFONTFACE_ITALIC);
+ new wxMGLFontLibrary(info->italicFace, wxFONTFACE_ITALIC, this);
if ( info->boldFace[0] == '\0' )
m_fontLibs[wxFONTFACE_BOLD] = NULL;
else
m_fontLibs[wxFONTFACE_BOLD] =
if ( info->boldFace[0] == '\0' )
m_fontLibs[wxFONTFACE_BOLD] = NULL;
else
m_fontLibs[wxFONTFACE_BOLD] =
- new wxMGLFontLibrary(info->boldFace, wxFONTFACE_BOLD);
+ new wxMGLFontLibrary(info->boldFace, wxFONTFACE_BOLD, this);
if ( info->boldItalicFace[0] == '\0' )
m_fontLibs[wxFONTFACE_BOLD_ITALIC] = NULL;
else
m_fontLibs[wxFONTFACE_BOLD_ITALIC] =
if ( info->boldItalicFace[0] == '\0' )
m_fontLibs[wxFONTFACE_BOLD_ITALIC] = NULL;
else
m_fontLibs[wxFONTFACE_BOLD_ITALIC] =
- new wxMGLFontLibrary(info->boldItalicFace, wxFONTFACE_BOLD_ITALIC);
+ new wxMGLFontLibrary(info->boldItalicFace, wxFONTFACE_BOLD_ITALIC, this);
wxLogTrace("mgl_font", "new family '%s' (r=%s, i=%s, b=%s, bi=%s)\n",
info->familyName, info->regularFace, info->italicFace,
wxLogTrace("mgl_font", "new family '%s' (r=%s, i=%s, b=%s, bi=%s)\n",
info->familyName, info->regularFace, info->italicFace,