d7ae4a6264
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
78 lines
1.8 KiB
C++
78 lines
1.8 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/mgl/private/fontmgr.h
|
|
// Purpose: font management for MGL
|
|
// Author: Vaclav Slavik
|
|
// Created: 2006-11-18
|
|
// RCS-ID: $Id$
|
|
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_MGL_PRIVATE_FONTMGR_H_
|
|
#define _WX_MGL_PRIVATE_FONTMGR_H_
|
|
|
|
struct font_info_t;
|
|
struct font_lib_t;
|
|
struct font_t;
|
|
|
|
class wxFontInstance : public wxFontInstanceBase
|
|
{
|
|
public:
|
|
wxFontInstance(float ptSize, bool aa, font_lib_t *fontLib);
|
|
virtual ~wxFontInstance();
|
|
|
|
struct font_t *GetMGLfont_t() const { return m_font; }
|
|
|
|
private:
|
|
font_t *m_font;
|
|
};
|
|
|
|
class wxFontFace : public wxFontFaceBase
|
|
{
|
|
public:
|
|
wxFontFace(const wxString& filename)
|
|
: m_fontLib(NULL), m_fileName(filename) {}
|
|
|
|
virtual void Acquire();
|
|
virtual void Release();
|
|
|
|
virtual wxFontInstance *GetFontInstance(float ptSize, bool aa);
|
|
|
|
protected:
|
|
wxFontInstance *CreateFontInstance(float ptSize, bool aa);
|
|
|
|
private:
|
|
font_lib_t *m_fontLib;
|
|
wxString m_fileName;
|
|
};
|
|
|
|
class wxFontBundle : public wxFontBundleBase
|
|
{
|
|
public:
|
|
wxFontBundle(const font_info_t *fontInfo);
|
|
|
|
virtual wxString GetName() const
|
|
{ return wxString::FromAscii(m_fontInfo->familyName); }
|
|
|
|
virtual bool IsFixed() const { return m_fontInfo->isFixed; }
|
|
|
|
const font_info_t *GetInfo() const { return m_fontInfo; }
|
|
|
|
private:
|
|
const font_info_t *m_fontInfo;
|
|
};
|
|
|
|
class wxFontsManager : public wxFontsManagerBase
|
|
{
|
|
public:
|
|
wxFontsManager() { AddAllFonts(); }
|
|
|
|
virtual wxString GetDefaultFacename(wxFontFamily family) const;
|
|
|
|
private:
|
|
// adds all fonts using AddBundle()
|
|
void AddAllFonts();
|
|
};
|
|
|
|
#endif // _WX_MGL_PRIVATE_FONTMGR_H_
|