// Name: font.cpp
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
{
m_refData = new wxFontRefData();
+ if (FontIdOrFamily == wxDEFAULT) FontIdOrFamily = wxSWISS;
+ M_FONTDATA->m_family = FontIdOrFamily;
+
if ((M_FONTDATA->m_faceName = (Face) ? copystring(Face) : (char*)NULL) )
{
M_FONTDATA->m_fontId = wxTheFontNameDirectory->FindOrCreateFontId( Face, FontIdOrFamily );
M_FONTDATA->m_fontId = FontIdOrFamily;
M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily );
}
- if (Style == wxDEFAULT) Style = wxSWISS;
+
+ if (Style == wxDEFAULT) Style = wxNORMAL;
M_FONTDATA->m_style = Style;
if (Weight == wxDEFAULT) Weight = wxNORMAL;
M_FONTDATA->m_weight = Weight;
- if (PointSize == wxDEFAULT) PointSize = 10;
+ if (PointSize == wxDEFAULT) PointSize = 12;
M_FONTDATA->m_pointSize = PointSize;
M_FONTDATA->m_underlined = Underlined;
}
else
{
- font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
- M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
+/*
+ if (int_scale == 100) printf( "int_scale.\n" );
+ if (M_FONTDATA->m_style == wxSWISS) printf( "swiss.\n" );
+ if (M_FONTDATA->m_pointSize == 12) printf( "12.\n" );
+ if (M_FONTDATA->m_weight == wxNORMAL) printf( "normal.\n" );
+ if (M_FONTDATA->m_underlined == FALSE) printf( "false.\n" );
+*/
+ if ((int_scale == 100) &&
+ (M_FONTDATA->m_family == wxSWISS) &&
+ (M_FONTDATA->m_style == wxNORMAL) &&
+ (M_FONTDATA->m_pointSize == 12) &&
+ (M_FONTDATA->m_weight == wxNORMAL) &&
+ (M_FONTDATA->m_underlined == FALSE))
+ {
+ font = gdk_font_load( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
+ }
+ else
+ {
+ font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
+ M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
+ }
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
}
if (!font)
inline int GetFamily(void) {return family;}
inline int GetId(void) {return id;}
inline bool IsRoman(void) {return isroman;}
-#if WXDEBUG
+#if defined(__WXDEBUG__)
void Dump(ostream& str);
#endif
name = (char *) NULL;
}
-#if WXDEBUG
+#if defined(__WXDEBUG__)
void wxFontNameItem::Dump(ostream& str)
{
str << "wxFontNameItem(" << name << ")";