1///////////////////////////////////////////////////////////////////////////// 2// Name: wx/dfb/private/fontmgr.h 3// Purpose: font management for wxDFB 4// Author: Vaclav Slavik 5// Created: 2006-11-18 6// RCS-ID: $Id: fontmgr.h 43835 2006-12-06 18:48:04Z VS $ 7// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) 8// (c) 2006 REA Elektronik GmbH 9// Licence: wxWindows licence 10///////////////////////////////////////////////////////////////////////////// 11 12#ifndef _WX_DFB_PRIVATE_FONTMGR_H_ 13#define _WX_DFB_PRIVATE_FONTMGR_H_ 14 15#include "wx/dfb/wrapdfb.h" 16 17class wxFileConfig; 18 19class wxFontInstance : public wxFontInstanceBase 20{ 21public: 22 wxFontInstance(float ptSize, bool aa, const wxString& filename); 23 24 wxIDirectFBFontPtr GetDirectFBFont() const { return m_font; } 25 26private: 27 wxIDirectFBFontPtr m_font; 28}; 29 30class wxFontFace : public wxFontFaceBase 31{ 32public: 33 wxFontFace(const wxString& filename) : m_fileName(filename) {} 34 35protected: 36 wxFontInstance *CreateFontInstance(float ptSize, bool aa); 37 38private: 39 wxString m_fileName; 40}; 41 42class wxFontBundle : public wxFontBundleBase 43{ 44public: 45 wxFontBundle(const wxString& name, 46 const wxString& fileRegular, 47 const wxString& fileBold, 48 const wxString& fileItalic, 49 const wxString& fileBoldItalic, 50 bool isFixed); 51 52 /// Returns name of the family 53 virtual wxString GetName() const { return m_name; } 54 55 virtual bool IsFixed() const { return m_isFixed; } 56 57private: 58 wxString m_name; 59 bool m_isFixed; 60}; 61 62class wxFontsManager : public wxFontsManagerBase 63{ 64public: 65 wxFontsManager() { AddAllFonts(); } 66 67 virtual wxString GetDefaultFacename(wxFontFamily family) const 68 { 69 return m_defaultFacenames[family]; 70 } 71 72private: 73 // adds all fonts using AddBundle() 74 void AddAllFonts(); 75 void AddFontsFromDir(const wxString& indexFile); 76 void AddFont(const wxString& dir, const wxString& name, wxFileConfig& cfg); 77 void SetDefaultFonts(wxFileConfig& cfg); 78 79private: 80 // default facenames 81 wxString m_defaultFacenames[wxFONTFAMILY_MAX]; 82}; 83 84#endif // _WX_DFB_PRIVATE_FONTMGR_H_ 85