]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mgl/fontutil.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/nix/fontutil.h
3 // Purpose: font-related helper functions for MGL
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MGL_FONTUTIL_H_
12 #define _WX_MGL_FONTUTIL_H_
22 class wxMGLFontInstance
;
23 class wxMGLFontInstanceList
;
24 class wxMGLFontLibrary
;
25 class wxMGLFontFamily
;
29 wxFONTFACE_REGULAR
= 0,
30 wxFONTFACE_ITALIC
= 1,
31 wxFONTFACE_BOLD
= 2, // = (regular | bold)
32 wxFONTFACE_BOLD_ITALIC
= 3, // = (italic | bold)
37 // structure representing particular loaded font instance:
38 class wxMGLFontInstance
41 wxMGLFontInstance(wxMGLFontLibrary
*fontLib
, float pt
, bool slant
, bool aa
);
44 struct font_t
*GetMGLfont_t() const { return m_font
; }
46 float GetPt() const { return m_pt
; }
47 bool GetSlant() const { return m_slant
; }
48 bool GetAA() const { return m_aa
; }
51 wxMGLFontLibrary
*m_fontLib
;
58 // structure representing loaded font library:
59 class wxMGLFontLibrary
62 wxMGLFontLibrary(const wxString
& filename
, int type
);
65 wxMGLFontInstance
*GetFontInstance(wxFont
*font
, float scale
, bool aa
);
70 struct font_lib_t
*GetMGLfont_lib_t() const { return m_fontLib
; }
73 font_lib_t
*m_fontLib
;
77 wxMGLFontInstanceList
*m_instances
;
80 // structure representing native MGL font family
81 class wxMGLFontFamily
: public wxObject
84 wxMGLFontFamily(const font_info_t
*info
);
85 virtual ~wxMGLFontFamily();
87 wxString
GetName() const { return m_name
; }
88 const font_info_t
*GetInfo() const { return m_fontInfo
; }
90 bool HasFace(int type
) const;
91 wxMGLFontLibrary
*GetLibrary(int type
) const
92 { return m_fontLibs
[type
]; }
96 const font_info_t
*m_fontInfo
;
97 wxMGLFontLibrary
*m_fontLibs
[wxFONTFACE_MAX
];
100 WX_DECLARE_LIST(wxMGLFontFamily
, wxMGLFontFamilyList
);
108 void AddFamily(const font_info_t
*info
);
110 // return info about font with given name:
111 wxMGLFontFamily
*GetFamily(const wxString
& name
) const;
112 // return list of all families
113 wxMGLFontFamilyList
*GetFamilyList() { return m_list
; }
115 wxMGLFontLibrary
*GetFontLibrary(wxFont
*font
);
119 wxMGLFontFamilyList
*m_list
;
122 extern wxFontsManager
*wxTheFontsManager
;
126 #endif // _WX_MGL_FONTUTIL_H_