moved wxMGL's font management code to common so that it can be reused by wxDFB; implemented wxDFB part
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
77
include/wx/mgl/private/fontmgr.h
Normal file
77
include/wx/mgl/private/fontmgr.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 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_
|
Reference in New Issue
Block a user