File: fontmgr.h

package info (click to toggle)
wxwidgets3.0 3.0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 120,464 kB
  • sloc: cpp: 896,633; makefile: 52,303; ansic: 21,971; sh: 5,713; python: 2,940; xml: 1,534; perl: 264; javascript: 33
file content (83 lines) | stat: -rw-r--r-- 2,161 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/dfb/private/fontmgr.h
// Purpose:     font management for wxDFB
// Author:      Vaclav Slavik
// Created:     2006-11-18
// Copyright:   (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
//              (c) 2006 REA Elektronik GmbH
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_DFB_PRIVATE_FONTMGR_H_
#define _WX_DFB_PRIVATE_FONTMGR_H_

#include "wx/dfb/wrapdfb.h"

class wxFileConfig;

class wxFontInstance : public wxFontInstanceBase
{
public:
    wxFontInstance(float ptSize, bool aa, const wxString& filename);

    wxIDirectFBFontPtr GetDirectFBFont() const { return m_font; }

private:
    wxIDirectFBFontPtr m_font;
};

class wxFontFace : public wxFontFaceBase
{
public:
    wxFontFace(const wxString& filename) : m_fileName(filename) {}

protected:
    wxFontInstance *CreateFontInstance(float ptSize, bool aa);

private:
    wxString m_fileName;
};

class wxFontBundle : public wxFontBundleBase
{
public:
    wxFontBundle(const wxString& name,
                 const wxString& fileRegular,
                 const wxString& fileBold,
                 const wxString& fileItalic,
                 const wxString& fileBoldItalic,
                 bool isFixed);

    /// Returns name of the family
    virtual wxString GetName() const { return m_name; }

    virtual bool IsFixed() const { return m_isFixed; }

private:
    wxString m_name;
    bool     m_isFixed;
};

class wxFontsManager : public wxFontsManagerBase
{
public:
    wxFontsManager() { AddAllFonts(); }

    virtual wxString GetDefaultFacename(wxFontFamily family) const
    {
        return m_defaultFacenames[family];
    }

private:
    // adds all fonts using AddBundle()
    void AddAllFonts();
    void AddFontsFromDir(const wxString& indexFile);
    void AddFont(const wxString& dir, const wxString& name, wxFileConfig& cfg);
    void SetDefaultFonts(wxFileConfig& cfg);

private:
    // default facenames
    wxString m_defaultFacenames[wxFONTFAMILY_MAX];
};

#endif // _WX_DFB_PRIVATE_FONTMGR_H_