2004-10-19 09:40:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-01-18 16:14:27 -05:00
|
|
|
// Name: wx/palmos/font.h
|
2004-10-19 09:40:30 -04:00
|
|
|
// Purpose: wxFont class
|
2005-01-18 16:14:27 -05:00
|
|
|
// Author: William Osborne - minimal working wxPalmOS port
|
2008-03-01 19:53:32 -05:00
|
|
|
// Modified by: Yunhui Fu
|
2004-10-19 09:40:30 -04:00
|
|
|
// Created: 10/14/04
|
2005-01-18 16:14:27 -05:00
|
|
|
// RCS-ID: $Id$
|
2004-10-19 09:40:30 -04:00
|
|
|
// Copyright: (c) William Osborne
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FONT_H_
|
|
|
|
#define _WX_FONT_H_
|
|
|
|
|
2005-11-15 02:40:12 -05:00
|
|
|
#include "wx/gdicmn.h"
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFont
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
|
2004-10-19 09:40:30 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and such
|
2006-02-08 19:51:23 -05:00
|
|
|
wxFont() { }
|
2004-10-19 09:40:30 -04:00
|
|
|
|
2008-11-03 12:02:25 -05:00
|
|
|
#if FUTURE_WXWIN_COMPATIBILITY_3_0
|
2004-10-19 09:40:30 -04:00
|
|
|
wxFont(int size,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
2008-11-03 12:02:25 -05:00
|
|
|
(void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
|
2004-10-19 09:40:30 -04:00
|
|
|
}
|
2008-11-03 12:02:25 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
wxFont(int size,
|
|
|
|
wxFontFamily family,
|
|
|
|
wxFontStyle style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
Create(size, family, style, weight, underlined, face, encoding);
|
|
|
|
}
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-11-03 12:02:25 -05:00
|
|
|
bool Create(int size,
|
|
|
|
wxFontFamily family,
|
|
|
|
wxFontStyle style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
wxFont(const wxSize& pixelSize,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
(void)Create(pixelSize, family, style, weight,
|
|
|
|
underlined, face, encoding);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
|
|
|
|
{
|
|
|
|
Create(info, hFont);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxFont(const wxString& fontDesc);
|
|
|
|
|
|
|
|
bool Create(const wxSize& pixelSize,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
return DoCreate(-1, pixelSize, true, family, style,
|
|
|
|
weight, underlined, face, encoding);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
|
|
|
|
|
|
|
|
virtual ~wxFont();
|
|
|
|
|
2008-03-01 19:53:32 -05:00
|
|
|
// wxFontBase overridden functions
|
|
|
|
virtual wxString GetNativeFontInfoDesc() const;
|
|
|
|
virtual wxString GetNativeFontInfoUserDesc() const;
|
|
|
|
|
2004-10-19 09:40:30 -04:00
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual int GetPointSize() const;
|
|
|
|
virtual wxSize GetPixelSize() const;
|
|
|
|
virtual bool IsUsingSizeInPixels() const;
|
2008-11-03 12:02:25 -05:00
|
|
|
virtual wxFontFamily GetFamily() const;
|
|
|
|
virtual wxFontStyle GetStyle() const;
|
|
|
|
virtual wxFontWeight GetWeight() const;
|
2004-10-19 09:40:30 -04:00
|
|
|
virtual bool GetUnderlined() const;
|
|
|
|
virtual wxString GetFaceName() const;
|
|
|
|
virtual wxFontEncoding GetEncoding() const;
|
|
|
|
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
|
|
|
|
|
|
|
virtual void SetPointSize(int pointSize);
|
|
|
|
virtual void SetPixelSize(const wxSize& pixelSize);
|
2008-11-03 12:02:25 -05:00
|
|
|
virtual void SetFamily(wxFontFamily family);
|
|
|
|
virtual void SetStyle(wxFontStyle style);
|
|
|
|
virtual void SetWeight(wxFontWeight weight);
|
2006-05-28 20:03:36 -04:00
|
|
|
virtual bool SetFaceName(const wxString& faceName);
|
2004-10-19 09:40:30 -04:00
|
|
|
virtual void SetUnderlined(bool underlined);
|
|
|
|
virtual void SetEncoding(wxFontEncoding encoding);
|
|
|
|
|
2009-06-12 16:11:21 -04:00
|
|
|
wxDECLARE_COMMON_FONT_METHODS();
|
2008-11-03 12:02:25 -05:00
|
|
|
|
2004-10-19 09:40:30 -04:00
|
|
|
virtual bool IsFixedWidth() const;
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
virtual bool IsFree() const;
|
|
|
|
virtual bool RealizeResource();
|
|
|
|
virtual WXHANDLE GetResourceHandle() const;
|
|
|
|
virtual bool FreeResource(bool force = false);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// real font creation function, used in all cases
|
|
|
|
bool DoCreate(int size,
|
|
|
|
const wxSize& pixelSize,
|
|
|
|
bool sizeUsingPixels,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
|
|
|
|
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
|
|
|
|
|
2008-03-01 19:53:32 -05:00
|
|
|
// implement wxObject virtuals which are used by AllocExclusive()
|
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
|
|
|
};
|
|
|
|
|
2005-11-15 02:40:12 -05:00
|
|
|
#endif // _WX_FONT_H_
|