//-----------------------------------------------------------------------------
static char *wx_font_family [] = {
- "wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT",
- "wxSWISS", "wxTELETYPE",
+ "wxDEFAULT", "wxDECORATIVE", "wxROMAN", "wxSCRIPT",
+ "wxSWISS", "wxMODERN", "wxTELETYPE",
};
+/*
static char *wx_font_style [] = {
"wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC",
};
static char *wx_font_weight [] = {
"wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT",
};
+*/
extern wxFontNameDirectory *wxTheFontNameDirectory;
m_weight = -1;
m_underlined = FALSE;
m_fontId = 0;
- m_faceName = NULL;
- m_font = NULL;
+ m_faceName = (char *) NULL;
+ m_font = (GdkFont *) NULL;
}
wxFontRefData::~wxFontRefData(void)
if (m_faceName)
{
delete m_faceName;
- m_faceName = NULL;
+ m_faceName = (char *) NULL;
}
if (m_font) gdk_font_unref( m_font );
}
wxFont::wxFont( const wxFont& font )
{
Ref( font );
+
+ if (wxTheFontList) wxTheFontList->Append( this );
}
wxFont::wxFont( const wxFont* font )
{
UnRef();
if (font) Ref( *font );
+
+ if (wxTheFontList) wxTheFontList->Append( this );
}
wxFont::~wxFont(void)
wxString wxFont::GetFamilyString(void) const
{
- wxString s = wx_font_family[M_FONTDATA->m_family];
+ wxString s = wx_font_family[M_FONTDATA->m_family - wxDEFAULT];
return s;
}
wxString wxFont::GetStyleString(void) const
{
- wxString s = wx_font_style[M_FONTDATA->m_style];
- return s;
+ switch (M_FONTDATA->m_style)
+ {
+ case wxNORMAL:
+ {
+ return wxString("wxNORMAL");
+ }
+ case wxSLANT:
+ {
+ return wxString("wxSLANT");
+ }
+ case wxITALIC:
+ {
+ return wxString("wxITALIC");
+ }
+ case wxDEFAULT:
+ default:
+ {
+ return wxString("wxDEFAULT");
+ }
+ }
+ return wxString("wxDEFAULT");
}
int wxFont::GetWeight(void) const
wxString wxFont::GetWeightString(void) const
{
- wxString s = wx_font_weight[M_FONTDATA->m_weight];
- return s;
+ switch (M_FONTDATA->m_weight)
+ {
+ case wxNORMAL:
+ {
+ return wxString("wxNORMAL");
+ }
+ case wxBOLD:
+ {
+ return wxString("wxBOLD");
+ }
+ case wxLIGHT:
+ {
+ return wxString("wxLIGHT");
+ }
+ case wxDEFAULT:
+ default:
+ {
+ return wxString("wxDEFAULT");
+ }
+ }
+ return wxString("wxDEFAULT");
}
bool wxFont::GetUnderlined(void) const
long int_scale = long(scale * 100.0 + 0.5); // key for fontlist
int point_scale = (M_FONTDATA->m_pointSize * 10 * int_scale) / 100;
- GdkFont *font = NULL;
+ GdkFont *font = (GdkFont *) NULL;
wxNode *node = M_FONTDATA->m_scaled_xfonts.Find(int_scale);
if (node)
"-${ScreenSwissBase}${ScreenStdSuffix}",
"ScreenScript__",
"-${ScreenScriptBase}${ScreenStdSuffix}",
- NULL
+ (char *) NULL
};
enum {wxWEIGHT_NORMAL, wxWEIGHT_BOLD, wxWEIGHT_LIGHT, wxNUM_WEIGHTS};
k = 1 << count;
- *v = NULL;
- internal = NULL;
+ *v = (char *) NULL;
+ internal = (char *) NULL;
for (i = 0; i < k; i++) {
strcpy(resource, prefix);
for (j = 0; j < wxNUM_STYLES; ++j)
if (map[k][j]) {
delete[] map[k][j];
- map[k][j] = NULL;
+ map[k][j] = (char *) NULL;
}
}
++i;
} else if (v[i] == closer) {
int newstrlen;
- const char *r = NULL; bool delete_r = FALSE;
+ const char *r = (char *) NULL; bool delete_r = FALSE;
char *name;
name = v + startpos + 2;
{
if (name)
delete[] name;
- name = NULL;
+ name = (char *) NULL;
}
#if WXDEBUG
char *fam, resource[256];
sprintf(resource, "Family%s", resname);
- SearchResource((const char *)resource, NULL, 0, (char **)&fam);
+ SearchResource((const char *)resource, (const char **) NULL, 0, (char **)&fam);
if (fam) {
if (!strcmp(fam, "Default")) family = wxDEFAULT;
else if (!strcmp(fam, "Roman")) family = wxROMAN;
if (item)
return item->GetScreenName(weight, style);
// font does not exist
- return NULL;
+ return (char *) NULL;
}
char *wxFontNameDirectory::GetPostScriptName(int fontid, int weight, int style)
if (item)
return item->GetPostScriptName(weight, style);
// font does not exist
- return NULL;
+ return (char *) NULL;
}
char *wxFontNameDirectory::GetAFMName(int fontid, int weight, int style)
if (item)
return item->GetAFMName(weight, style);
// font does not exist
- return NULL;
+ return (char *) NULL;
}
char *wxFontNameDirectory::GetFontName(int fontid)
if (item)
return item->GetName();
// font does not exist
- return NULL;
+ return (char *) NULL;
}
int wxFontNameDirectory::GetFontId(const char *name)