2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: font.h
|
|
|
|
// Purpose: wxFont class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FONT_H_
|
|
|
|
#define _WX_FONT_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFont
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxFont : public wxFontBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and such
|
2006-02-08 19:51:23 -05:00
|
|
|
wxFont() { }
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
wxFont(int size,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = FALSE,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
(void)Create(size, family, style, weight, underlined, face, encoding);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxFont(const wxNativeFontInfo& info)
|
|
|
|
{
|
|
|
|
(void)Create(info);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxFont(const wxString& fontDesc);
|
|
|
|
|
|
|
|
bool Create(int size,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
|
|
|
bool underlined = FALSE,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
|
|
|
|
bool Create(const wxNativeFontInfo& info);
|
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
bool MacCreateThemeFont( wxUint16 themeFontID ) ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual ~wxFont();
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual int GetPointSize() const;
|
2006-10-25 20:22:56 -04:00
|
|
|
virtual wxSize GetPixelSize() const;
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual int GetFamily() const;
|
|
|
|
virtual int GetStyle() const;
|
|
|
|
virtual int GetWeight() const;
|
|
|
|
virtual bool GetUnderlined() const;
|
|
|
|
virtual wxString GetFaceName() const;
|
|
|
|
virtual wxFontEncoding GetEncoding() const;
|
|
|
|
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
|
|
|
|
|
|
|
virtual void SetPointSize(int pointSize);
|
|
|
|
virtual void SetFamily(int family);
|
|
|
|
virtual void SetStyle(int style);
|
|
|
|
virtual void SetWeight(int weight);
|
2006-05-28 20:03:36 -04:00
|
|
|
virtual bool SetFaceName(const wxString& faceName);
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual void SetUnderlined(bool underlined);
|
|
|
|
virtual void SetEncoding(wxFontEncoding encoding);
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
virtual bool RealizeResource();
|
|
|
|
|
|
|
|
// Unofficial API, don't use
|
|
|
|
virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
|
2004-07-14 12:33:17 -04:00
|
|
|
virtual bool GetNoAntiAliasing() const ;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
// Mac-specific, risks to change, don't use in portable code
|
2005-01-27 05:57:10 -05:00
|
|
|
|
|
|
|
// 'old' Quickdraw accessors
|
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
short MacGetFontNum() const;
|
|
|
|
short MacGetFontSize() const;
|
|
|
|
wxByte MacGetFontStyle() const;
|
2005-01-27 05:57:10 -05:00
|
|
|
|
|
|
|
// 'new' ATSUI accessors
|
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
wxUint32 MacGetATSUFontID() const;
|
|
|
|
wxUint32 MacGetATSUAdditionalQDStyles() const;
|
|
|
|
wxUint16 MacGetThemeFontID() const ;
|
2005-01-27 05:57:10 -05:00
|
|
|
// Returns an ATSUStyle not ATSUStyle*
|
|
|
|
void* MacGetATSUStyle() const ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
protected:
|
2007-03-05 01:41:04 -05:00
|
|
|
virtual wxObjectRefData* CreateRefData() const;
|
|
|
|
virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_FONT_H_
|