1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: font.h
|
|
|
|
// Purpose: wxFont class
|
1999-11-05 04:16:09 -05:00
|
|
|
// Author: Julian Smart
|
1999-01-01 11:05:26 -05:00
|
|
|
// Modified by:
|
1999-11-05 04:16:09 -05:00
|
|
|
// Created: 01/02/97
|
1999-01-01 11:05:26 -05:00
|
|
|
// RCS-ID: $Id$
|
1999-11-05 04:16:09 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FONT_H_
|
|
|
|
#define _WX_FONT_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1999-11-05 04:16:09 -05:00
|
|
|
#pragma interface "font.h"
|
1999-01-01 11:05:26 -05:00
|
|
|
#endif
|
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFont
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxFont : public wxFontBase
|
1999-01-01 11:05:26 -05:00
|
|
|
{
|
|
|
|
public:
|
1999-11-05 04:16:09 -05:00
|
|
|
// ctors and such
|
|
|
|
wxFont() { Init(); }
|
2002-05-08 10:00:23 -04:00
|
|
|
wxFont(const wxFont& font)
|
|
|
|
: wxFontBase()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Ref(font);
|
|
|
|
}
|
1999-11-05 04:16:09 -05:00
|
|
|
|
|
|
|
wxFont(int size,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = FALSE,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(size, family, style, weight, underlined, face, encoding);
|
|
|
|
}
|
|
|
|
|
2001-01-20 14:30:47 -05:00
|
|
|
wxFont(const wxNativeFontInfo& info)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(info);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxFont(const wxString& fontDesc);
|
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
bool Create(int size,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = FALSE,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
|
2001-01-20 14:30:47 -05:00
|
|
|
bool Create(const wxNativeFontInfo& info);
|
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
virtual ~wxFont();
|
|
|
|
|
|
|
|
// assignment
|
|
|
|
wxFont& operator=(const wxFont& font);
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual int GetPointSize() const;
|
|
|
|
virtual int GetFamily() const;
|
|
|
|
virtual int GetStyle() const;
|
|
|
|
virtual int GetWeight() const;
|
|
|
|
virtual bool GetUnderlined() const;
|
|
|
|
virtual wxString GetFaceName() const;
|
|
|
|
virtual wxFontEncoding GetEncoding() const;
|
2003-09-23 21:23:37 -04:00
|
|
|
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
1999-11-05 04:16:09 -05:00
|
|
|
|
|
|
|
virtual void SetPointSize(int pointSize);
|
|
|
|
virtual void SetFamily(int family);
|
|
|
|
virtual void SetStyle(int style);
|
|
|
|
virtual void SetWeight(int weight);
|
|
|
|
virtual void SetFaceName(const wxString& faceName);
|
|
|
|
virtual void SetUnderlined(bool underlined);
|
|
|
|
virtual void SetEncoding(wxFontEncoding encoding);
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
virtual bool RealizeResource();
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2003-01-17 05:24:59 -05:00
|
|
|
// Unofficial API, don't use
|
|
|
|
virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
|
|
|
|
virtual bool GetNoAntiAliasing() ;
|
2003-09-25 19:10:35 -04:00
|
|
|
|
|
|
|
// Mac-specific, risks to change, don't use in portable code
|
|
|
|
short GetMacFontNum() const;
|
|
|
|
short GetMacFontSize() const;
|
|
|
|
wxByte GetMacFontStyle() const;
|
|
|
|
wxUint32 GetMacATSUFontID() const;
|
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
1999-01-01 11:05:26 -05:00
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
void Unshare();
|
1999-01-01 11:05:26 -05:00
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
1999-01-01 11:05:26 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_FONT_H_
|