1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: font.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
1998-05-20 14:01:55 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
1998-12-09 17:30:17 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKFONTH__
|
|
|
|
#define __GTKFONTH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/string.h"
|
|
|
|
#include "wx/hash.h"
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxDC;
|
|
|
|
class wxPaintDC;
|
|
|
|
class wxWindow;
|
|
|
|
|
|
|
|
class wxFont;
|
1999-01-24 15:07:54 +00:00
|
|
|
/*
|
1998-05-20 14:01:55 +00:00
|
|
|
class wxFontNameDirectory;
|
1999-01-24 15:07:54 +00:00
|
|
|
*/
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global variables
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-01-24 15:07:54 +00:00
|
|
|
/*
|
1998-12-18 13:35:58 +00:00
|
|
|
extern wxFontNameDirectory *wxTheFontNameDirectory;
|
1999-01-24 15:07:54 +00:00
|
|
|
*/
|
1999-04-12 22:20:19 +00:00
|
|
|
extern const wxChar* wxEmptyString;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxFont
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-12-09 17:30:17 +00:00
|
|
|
class wxFont: public wxGDIObject
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1998-12-18 13:35:58 +00:00
|
|
|
public:
|
|
|
|
wxFont();
|
|
|
|
wxFont( int pointSize, int family, int style, int weight, bool underlined = FALSE,
|
|
|
|
const wxString& face = wxEmptyString );
|
|
|
|
wxFont( const wxFont& font );
|
|
|
|
~wxFont();
|
|
|
|
wxFont& operator = ( const wxFont& font );
|
1999-05-09 22:17:03 +00:00
|
|
|
bool operator == ( const wxFont& font ) const;
|
|
|
|
bool operator != ( const wxFont& font ) const;
|
1998-12-18 13:35:58 +00:00
|
|
|
bool Ok() const;
|
|
|
|
|
|
|
|
int GetPointSize() const;
|
|
|
|
int GetFamily() const;
|
|
|
|
int GetStyle() const;
|
|
|
|
int GetWeight() const;
|
|
|
|
bool GetUnderlined() const;
|
|
|
|
|
|
|
|
void SetPointSize( int pointSize );
|
|
|
|
void SetFamily( int family );
|
|
|
|
void SetStyle( int style );
|
|
|
|
void SetWeight( int weight );
|
|
|
|
void SetFaceName( const wxString& faceName );
|
|
|
|
void SetUnderlined( bool underlined );
|
|
|
|
|
|
|
|
wxString GetFaceName() const;
|
|
|
|
wxString GetFamilyString() const;
|
|
|
|
wxString GetStyleString() const;
|
|
|
|
wxString GetWeightString() const;
|
|
|
|
|
1998-12-09 17:30:17 +00:00
|
|
|
// implementation
|
1998-12-18 13:35:58 +00:00
|
|
|
|
1999-08-24 20:26:06 +00:00
|
|
|
wxFont( GdkFont* font, char *xFontName );
|
1998-12-18 13:35:58 +00:00
|
|
|
void Unshare();
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1998-12-18 13:35:58 +00:00
|
|
|
GdkFont* GetInternalFont(float scale = 1.0) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-12-18 13:35:58 +00:00
|
|
|
// no data :-)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1999-01-24 15:07:54 +00:00
|
|
|
/*
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxFontDirectory
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-12-09 17:30:17 +00:00
|
|
|
class wxFontNameDirectory: public wxObject
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFontNameDirectory)
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
public:
|
1998-12-09 17:30:17 +00:00
|
|
|
wxFontNameDirectory();
|
1998-05-20 14:01:55 +00:00
|
|
|
~wxFontNameDirectory();
|
|
|
|
|
1998-12-09 17:30:17 +00:00
|
|
|
void Initialize();
|
1998-05-20 14:01:55 +00:00
|
|
|
void Initialize(int fontid, int family, const char *name);
|
|
|
|
|
|
|
|
int FindOrCreateFontId(const char *name, int family);
|
|
|
|
char* GetAFMName(int fontid, int weight, int style);
|
|
|
|
int GetFamily(int fontid);
|
|
|
|
int GetFontId(const char *name);
|
|
|
|
char* GetFontName(int fontid);
|
1998-12-09 17:30:17 +00:00
|
|
|
int GetNewFontId();
|
1998-05-20 14:01:55 +00:00
|
|
|
char* GetPostScriptName(int fontid, int weight, int style);
|
|
|
|
char* GetScreenName(int fontid, int weight, int style);
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
class wxHashTable *table;
|
|
|
|
int nextFontId;
|
|
|
|
};
|
1999-01-24 15:07:54 +00:00
|
|
|
*/
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
#endif // __GTKFONTH__
|