1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling and Julian Smart
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
19 #pragma implementation "font.h"
22 // For compilers that support precompilation, includes "wx.h".
23 #include "wx/wxprec.h"
26 #include "wx/fontutil.h"
27 #include "wx/cmndata.h"
30 #include "wx/gdicmn.h"
31 #include "wx/tokenzr.h"
32 #include "wx/settings.h"
36 #include "wx/gtk/private.h"
37 #include <gdk/gdkprivate.h>
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 // the default size (in points) for the fonts
44 static const int wxDEFAULT_FONT_SIZE
= 12;
46 // ----------------------------------------------------------------------------
47 // wxScaledFontList: maps the font sizes to the GDK fonts for the given font
48 // ----------------------------------------------------------------------------
50 WX_DECLARE_HASH_MAP(int, GdkFont
*, wxIntegerHash
, wxIntegerEqual
,
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 class wxFontRefData
: public wxObjectRefData
60 // from broken down font parameters, also default ctor
61 wxFontRefData(int size
= -1,
62 int family
= wxFONTFAMILY_DEFAULT
,
63 int style
= wxFONTSTYLE_NORMAL
,
64 int weight
= wxFONTWEIGHT_NORMAL
,
65 bool underlined
= FALSE
,
66 const wxString
& faceName
= wxEmptyString
,
67 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
70 wxFontRefData(const wxString
& fontname
);
73 wxFontRefData( const wxFontRefData
& data
);
75 virtual ~wxFontRefData();
77 // do we have the native font info?
78 bool HasNativeFont() const
81 // we always have a Pango font description
84 // only use m_nativeFontInfo if it had been initialized
85 return !m_nativeFontInfo
.IsDefault();
90 // reinitilize the font with the gived XFLD
91 void ReInit(const wxString
& fontname
);
94 // setters: all of them also take care to modify m_nativeFontInfo if we
95 // have it so as to not lose the information not carried by our fields
96 void SetPointSize(int pointSize
);
97 void SetFamily(int family
);
98 void SetStyle(int style
);
99 void SetWeight(int weight
);
100 void SetUnderlined(bool underlined
);
101 void SetFaceName(const wxString
& facename
);
102 void SetEncoding(wxFontEncoding encoding
);
104 void SetNoAntiAliasing( bool no
= TRUE
) { m_noAA
= no
; }
105 bool GetNoAntiAliasing() { return m_noAA
; }
107 // and this one also modifies all the other font data fields
108 void SetNativeFontInfo(const wxNativeFontInfo
& info
);
110 // debugger helper: shows what the font really is
112 // VZ: I need this as my gdb either shows wildly wrong values or crashes
113 // when I ask it to "p fontRefData" :-(
114 #if defined(__WXDEBUG__) && !defined(__WXGTK20__)
117 wxPrintf(_T("%s-%s-%s-%d-%d\n"),
119 m_weight
== wxFONTWEIGHT_NORMAL
121 : m_weight
== wxFONTWEIGHT_BOLD
124 m_style
== wxFONTSTYLE_NORMAL
? _T("regular") : _T("italic"),
131 // common part of all ctors
132 void Init(int pointSize
,
137 const wxString
& faceName
,
138 wxFontEncoding encoding
);
140 // set all fields from (already initialized and valid) m_nativeFontInfo
141 void InitFromNative();
144 // clear m_scaled_xfonts if any
145 void ClearGdkFonts();
148 // the map of font sizes to "GdkFont *"
149 wxScaledFontList m_scaled_xfonts
;
150 #endif // GTK 2.0/1.x
158 wxFontEncoding m_encoding
; // Unused under GTK 2.0
159 bool m_noAA
; // No anti-aliasing
161 // The native font info, basicly an XFLD under GTK 1.2 and
162 // the pango font description under GTK 2.0.
163 wxNativeFontInfo m_nativeFontInfo
;
168 // ----------------------------------------------------------------------------
170 // ----------------------------------------------------------------------------
172 void wxFontRefData::Init(int pointSize
,
177 const wxString
& faceName
,
178 wxFontEncoding encoding
)
180 m_family
= family
== wxFONTFAMILY_DEFAULT
? wxFONTFAMILY_SWISS
: family
;
182 m_faceName
= faceName
;
184 // we accept both wxDEFAULT and wxNORMAL here - should we?
185 m_style
= style
== wxDEFAULT
? wxFONTSTYLE_NORMAL
: style
;
186 m_weight
= weight
== wxDEFAULT
? wxFONTWEIGHT_NORMAL
: weight
;
188 // and here, do we really want to forbid creation of the font of the size
189 // 90 (the value of wxDEFAULT)??
190 m_pointSize
= pointSize
== wxDEFAULT
|| pointSize
== -1
191 ? wxDEFAULT_FONT_SIZE
194 m_underlined
= underlined
;
195 m_encoding
= encoding
;
200 // Create native font info
201 m_nativeFontInfo
.description
= pango_font_description_new();
203 // And set its values
204 if (!m_faceName
.empty())
206 pango_font_description_set_family( m_nativeFontInfo
.description
, wxGTK_CONV(m_faceName
) );
212 case wxFONTFAMILY_MODERN
:
213 case wxFONTFAMILY_TELETYPE
:
214 pango_font_description_set_family( m_nativeFontInfo
.description
, "monospace" );
216 case wxFONTFAMILY_ROMAN
:
217 pango_font_description_set_family( m_nativeFontInfo
.description
, "serif" );
219 case wxFONTFAMILY_SWISS
:
220 // SWISS = sans serif
222 pango_font_description_set_family( m_nativeFontInfo
.description
, "sans" );
228 SetPointSize( m_pointSize
);
229 SetWeight( m_weight
);
233 void wxFontRefData::InitFromNative()
239 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
242 m_faceName
= wxGTK_CONV_BACK( pango_font_description_get_family( desc
) );
244 // Pango sometimes needs to have a size
245 int pango_size
= pango_font_description_get_size( desc
);
247 pango_font_description_set_size( desc
, 12 * PANGO_SCALE
);
249 m_pointSize
= pango_font_description_get_size( desc
) / PANGO_SCALE
;
251 switch (pango_font_description_get_style( desc
))
253 case PANGO_STYLE_NORMAL
:
254 m_style
= wxFONTSTYLE_NORMAL
;
256 case PANGO_STYLE_ITALIC
:
257 m_style
= wxFONTSTYLE_ITALIC
;
259 case PANGO_STYLE_OBLIQUE
:
260 m_style
= wxFONTSTYLE_SLANT
;
264 switch (pango_font_description_get_weight( desc
))
266 case PANGO_WEIGHT_ULTRALIGHT
:
267 m_weight
= wxFONTWEIGHT_LIGHT
;
269 case PANGO_WEIGHT_LIGHT
:
270 m_weight
= wxFONTWEIGHT_LIGHT
;
272 case PANGO_WEIGHT_NORMAL
:
273 m_weight
= wxFONTWEIGHT_NORMAL
;
275 case PANGO_WEIGHT_BOLD
:
276 m_weight
= wxFONTWEIGHT_BOLD
;
278 case PANGO_WEIGHT_ULTRABOLD
:
279 m_weight
= wxFONTWEIGHT_BOLD
;
281 case PANGO_WEIGHT_HEAVY
:
282 m_weight
= wxFONTWEIGHT_BOLD
;
286 if (m_faceName
== wxT("monospace"))
288 m_family
= wxFONTFAMILY_TELETYPE
;
290 else if (m_faceName
== wxT("sans"))
292 m_family
= wxFONTFAMILY_SWISS
;
294 else if (m_faceName
== wxT("serif"))
296 m_family
= wxFONTFAMILY_ROMAN
;
300 m_family
= wxFONTFAMILY_UNKNOWN
;
303 // Pango description are never underlined (?)
304 m_underlined
= FALSE
;
306 // Cannot we choose that
307 m_encoding
= wxFONTENCODING_SYSTEM
;
309 // get the font parameters from the XLFD
310 // -------------------------------------
312 m_faceName
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_FAMILY
);
314 m_weight
= wxFONTWEIGHT_NORMAL
;
316 wxString w
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_WEIGHT
).Upper();
317 if ( !w
.empty() && w
!= _T('*') )
319 // the test below catches all of BOLD, EXTRABOLD, DEMIBOLD, ULTRABOLD
321 if ( ((w
[0u] == _T('B') && (!wxStrcmp(w
.c_str() + 1, wxT("OLD")) ||
322 !wxStrcmp(w
.c_str() + 1, wxT("LACK"))))) ||
323 wxStrstr(w
.c_str() + 1, _T("BOLD")) )
325 m_weight
= wxFONTWEIGHT_BOLD
;
327 else if ( w
== _T("LIGHT") || w
== _T("THIN") )
329 m_weight
= wxFONTWEIGHT_LIGHT
;
333 switch ( wxToupper(*m_nativeFontInfo
.
334 GetXFontComponent(wxXLFD_SLANT
).c_str()) )
336 case _T('I'): // italique
337 m_style
= wxFONTSTYLE_ITALIC
;
340 case _T('O'): // oblique
341 m_style
= wxFONTSTYLE_SLANT
;
345 m_style
= wxFONTSTYLE_NORMAL
;
349 if ( m_nativeFontInfo
.GetXFontComponent(wxXLFD_POINTSIZE
).ToLong(&ptSize
) )
351 // size in XLFD is in 10 point units
352 m_pointSize
= (int)(ptSize
/ 10);
356 m_pointSize
= wxDEFAULT_FONT_SIZE
;
359 // examine the spacing: if the font is monospaced, assume wxTELETYPE
360 // family for compatibility with the old code which used it instead of
362 if ( m_nativeFontInfo
.GetXFontComponent(wxXLFD_SPACING
).Upper() == _T('M') )
364 m_family
= wxFONTFAMILY_TELETYPE
;
366 else // not monospaceed
368 // don't even try guessing it, it doesn't work for too many fonts
370 m_family
= wxFONTFAMILY_UNKNOWN
;
373 // X fonts are never underlined...
374 m_underlined
= FALSE
;
376 // deal with font encoding
378 registry
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_REGISTRY
).Upper(),
379 encoding
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_ENCODING
).Upper();
381 if ( registry
== _T("ISO8859") )
384 if ( wxSscanf(encoding
, wxT("%d"), &cp
) == 1 )
386 m_encoding
= (wxFontEncoding
)(wxFONTENCODING_ISO8859_1
+ cp
- 1);
389 else if ( registry
== _T("MICROSOFT") )
392 if ( wxSscanf(encoding
, wxT("cp125%d"), &cp
) == 1 )
394 m_encoding
= (wxFontEncoding
)(wxFONTENCODING_CP1250
+ cp
);
397 else if ( registry
== _T("KOI8") )
399 m_encoding
= wxFONTENCODING_KOI8
;
401 else // unknown encoding
403 // may be give a warning here? or use wxFontMapper?
404 m_encoding
= wxFONTENCODING_SYSTEM
;
406 #endif // GTK 2.0/1.x
409 wxFontRefData::wxFontRefData( const wxFontRefData
& data
)
412 m_pointSize
= data
.m_pointSize
;
413 m_family
= data
.m_family
;
414 m_style
= data
.m_style
;
415 m_weight
= data
.m_weight
;
417 m_underlined
= data
.m_underlined
;
419 m_faceName
= data
.m_faceName
;
420 m_encoding
= data
.m_encoding
;
422 m_noAA
= data
.m_noAA
;
424 // Forces a copy of the internal data. wxNativeFontInfo should probably
425 // have a copy ctor and assignment operator to fix this properly but that
426 // would break binary compatibility...
427 m_nativeFontInfo
.FromString(data
.m_nativeFontInfo
.ToString());
430 wxFontRefData::wxFontRefData(int size
, int family
, int style
,
431 int weight
, bool underlined
,
432 const wxString
& faceName
,
433 wxFontEncoding encoding
)
435 Init(size
, family
, style
, weight
, underlined
, faceName
, encoding
);
438 wxFontRefData::wxFontRefData(const wxString
& fontname
)
440 // VZ: FromString() should really work in both cases, doesn't it?
442 m_nativeFontInfo
.FromString( fontname
);
444 m_nativeFontInfo
.SetXFontName(fontname
);
445 #endif // GTK 2.0/1.x
452 void wxFontRefData::ReInit(const wxString
& fontname
)
454 // calling InitFromNative() resets m_underlined flag as X11 fonts are never
455 // underlined, but we don't want to lose its old value here so save it ...
456 bool underlined
= m_underlined
;
458 m_nativeFontInfo
.SetXFontName(fontname
);
462 // ... and restore it now
463 m_underlined
= underlined
;
466 #endif // !__WXGTK20__
468 void wxFontRefData::ClearGdkFonts()
471 for ( wxScaledFontList::iterator i
= m_scaled_xfonts
.begin();
472 i
!= m_scaled_xfonts
.end();
475 GdkFont
*font
= i
->second
;
476 gdk_font_unref( font
);
479 m_scaled_xfonts
.clear();
483 wxFontRefData::~wxFontRefData()
488 // ----------------------------------------------------------------------------
489 // wxFontRefData SetXXX()
490 // ----------------------------------------------------------------------------
492 void wxFontRefData::SetPointSize(int pointSize
)
494 m_pointSize
= pointSize
;
498 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
500 pango_font_description_set_size( desc
, m_pointSize
* PANGO_SCALE
);
502 if ( HasNativeFont() )
505 if ( pointSize
== -1 )
508 size
.Printf(_T("%d"), 10*pointSize
);
510 m_nativeFontInfo
.SetXFontComponent(wxXLFD_POINTSIZE
, size
);
515 void wxFontRefData::SetFamily(int family
)
519 // TODO: what are we supposed to do with m_nativeFontInfo here?
522 void wxFontRefData::SetStyle(int style
)
528 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
532 case wxFONTSTYLE_ITALIC
:
533 pango_font_description_set_style( desc
, PANGO_STYLE_ITALIC
);
535 case wxFONTSTYLE_SLANT
:
536 pango_font_description_set_style( desc
, PANGO_STYLE_OBLIQUE
);
539 wxFAIL_MSG( _T("unknown font style") );
541 case wxFONTSTYLE_NORMAL
:
542 pango_font_description_set_style( desc
, PANGO_STYLE_NORMAL
);
546 if ( HasNativeFont() )
551 case wxFONTSTYLE_ITALIC
:
555 case wxFONTSTYLE_SLANT
:
560 wxFAIL_MSG( _T("unknown font style") );
563 case wxFONTSTYLE_NORMAL
:
567 m_nativeFontInfo
.SetXFontComponent(wxXLFD_SLANT
, slant
);
572 void wxFontRefData::SetWeight(int weight
)
577 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
580 case wxFONTWEIGHT_BOLD
:
581 pango_font_description_set_weight(desc
, PANGO_WEIGHT_BOLD
);
584 case wxFONTWEIGHT_LIGHT
:
585 pango_font_description_set_weight(desc
, PANGO_WEIGHT_LIGHT
);
589 wxFAIL_MSG( _T("unknown font weight") );
592 case wxFONTWEIGHT_NORMAL
:
594 pango_font_description_set_weight(desc
, PANGO_WEIGHT_NORMAL
);
597 if ( HasNativeFont() )
602 case wxFONTWEIGHT_BOLD
:
603 boldness
= _T("bold");
606 case wxFONTWEIGHT_LIGHT
:
607 boldness
= _T("light");
611 wxFAIL_MSG( _T("unknown font weight") );
614 case wxFONTWEIGHT_NORMAL
:
616 boldness
= _T("medium");
619 m_nativeFontInfo
.SetXFontComponent(wxXLFD_WEIGHT
, boldness
);
624 void wxFontRefData::SetUnderlined(bool underlined
)
626 m_underlined
= underlined
;
628 // the XLFD doesn't have "underlined" field anyhow
631 void wxFontRefData::SetFaceName(const wxString
& facename
)
633 m_faceName
= facename
;
636 if ( HasNativeFont() )
638 m_nativeFontInfo
.SetXFontComponent(wxXLFD_FAMILY
, facename
);
643 void wxFontRefData::SetEncoding(wxFontEncoding encoding
)
645 m_encoding
= encoding
;
648 if ( HasNativeFont() )
650 wxNativeEncodingInfo info
;
651 if ( wxGetNativeFontEncoding(encoding
, &info
) )
653 m_nativeFontInfo
.SetXFontComponent(wxXLFD_REGISTRY
, info
.xregistry
);
654 m_nativeFontInfo
.SetXFontComponent(wxXLFD_ENCODING
, info
.xencoding
);
660 void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo
& info
)
662 // previously cached fonts shouldn't be used
665 m_nativeFontInfo
= info
;
667 // set all the other font parameters from the native font info
671 // ----------------------------------------------------------------------------
673 // ----------------------------------------------------------------------------
675 IMPLEMENT_DYNAMIC_CLASS(wxFont
, wxGDIObject
)
681 wxFont::wxFont(const wxNativeFontInfo
& info
)
686 Create( info
.GetPointSize(),
690 info
.GetUnderlined(),
692 info
.GetEncoding() );
694 (void) Create(info
.GetXFontName());
698 bool wxFont::Create( int pointSize
,
703 const wxString
& face
,
704 wxFontEncoding encoding
)
708 m_refData
= new wxFontRefData(pointSize
, family
, style
, weight
,
709 underlined
, face
, encoding
);
714 bool wxFont::Create(const wxString
& fontname
)
716 // VZ: does this really happen?
717 if ( fontname
.empty() )
719 *this = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT
);
724 m_refData
= new wxFontRefData(fontname
);
729 void wxFont::Unshare()
733 m_refData
= new wxFontRefData();
737 wxFontRefData
* ref
= new wxFontRefData(*(wxFontRefData
*)m_refData
);
747 // ----------------------------------------------------------------------------
749 // ----------------------------------------------------------------------------
751 int wxFont::GetPointSize() const
753 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
755 return M_FONTDATA
->m_pointSize
;
758 wxString
wxFont::GetFaceName() const
760 wxCHECK_MSG( Ok(), wxT(""), wxT("invalid font") );
762 return M_FONTDATA
->m_faceName
;
765 int wxFont::GetFamily() const
767 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
769 return M_FONTDATA
->m_family
;
772 int wxFont::GetStyle() const
774 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
776 return M_FONTDATA
->m_style
;
779 int wxFont::GetWeight() const
781 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
783 return M_FONTDATA
->m_weight
;
786 bool wxFont::GetUnderlined() const
788 wxCHECK_MSG( Ok(), FALSE
, wxT("invalid font") );
790 return M_FONTDATA
->m_underlined
;
793 wxFontEncoding
wxFont::GetEncoding() const
795 wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT
, wxT("invalid font") );
797 return M_FONTDATA
->m_encoding
;
800 bool wxFont::GetNoAntiAliasing()
802 wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT
, wxT("invalid font") );
804 return M_FONTDATA
->m_noAA
;
807 const wxNativeFontInfo
*wxFont::GetNativeFontInfo() const
809 wxCHECK_MSG( Ok(), (wxNativeFontInfo
*)NULL
, wxT("invalid font") );
812 if ( M_FONTDATA
->m_nativeFontInfo
.GetXFontName().empty() )
816 return &(M_FONTDATA
->m_nativeFontInfo
);
819 bool wxFont::IsFixedWidth() const
821 wxCHECK_MSG( Ok(), FALSE
, wxT("invalid font") );
824 if ( M_FONTDATA
->HasNativeFont() )
826 // the monospace fonts are supposed to have "M" in the spacing field
827 wxString spacing
= M_FONTDATA
->
828 m_nativeFontInfo
.GetXFontComponent(wxXLFD_SPACING
);
830 return spacing
.Upper() == _T('M');
834 return wxFontBase::IsFixedWidth();
837 // ----------------------------------------------------------------------------
838 // change font attributes
839 // ----------------------------------------------------------------------------
841 void wxFont::SetPointSize(int pointSize
)
845 M_FONTDATA
->SetPointSize(pointSize
);
848 void wxFont::SetFamily(int family
)
852 M_FONTDATA
->SetFamily(family
);
855 void wxFont::SetStyle(int style
)
859 M_FONTDATA
->SetStyle(style
);
862 void wxFont::SetWeight(int weight
)
866 M_FONTDATA
->SetWeight(weight
);
869 void wxFont::SetFaceName(const wxString
& faceName
)
873 M_FONTDATA
->SetFaceName(faceName
);
876 void wxFont::SetUnderlined(bool underlined
)
880 M_FONTDATA
->SetUnderlined(underlined
);
883 void wxFont::SetEncoding(wxFontEncoding encoding
)
887 M_FONTDATA
->SetEncoding(encoding
);
890 void wxFont::DoSetNativeFontInfo( const wxNativeFontInfo
& info
)
894 M_FONTDATA
->SetNativeFontInfo( info
);
897 void wxFont::SetNoAntiAliasing( bool no
)
901 M_FONTDATA
->SetNoAntiAliasing( no
);
904 // ----------------------------------------------------------------------------
905 // get internal representation of font
906 // ----------------------------------------------------------------------------
909 static GdkFont
*g_systemDefaultGuiFont
= (GdkFont
*) NULL
;
911 // this is also used from tbargtk.cpp and tooltip.cpp, hence extern
912 extern GdkFont
*GtkGetDefaultGuiFont()
914 if (!g_systemDefaultGuiFont
)
916 GtkWidget
*widget
= gtk_button_new();
917 GtkStyle
*def
= gtk_rc_get_style( widget
);
920 g_systemDefaultGuiFont
= gdk_font_ref( def
->font
);
924 def
= gtk_widget_get_default_style();
926 g_systemDefaultGuiFont
= gdk_font_ref( def
->font
);
928 gtk_widget_destroy( widget
);
932 // already have it, but ref it once more before returning
933 gdk_font_ref(g_systemDefaultGuiFont
);
936 return g_systemDefaultGuiFont
;
939 GdkFont
*wxFont::GetInternalFont( float scale
) const
941 GdkFont
*font
= (GdkFont
*) NULL
;
943 wxCHECK_MSG( Ok(), font
, wxT("invalid font") )
945 long int_scale
= long(scale
* 100.0 + 0.5); // key for fontlist
946 int point_scale
= (int)((M_FONTDATA
->m_pointSize
* 10 * int_scale
) / 100);
948 wxScaledFontList
& list
= M_FONTDATA
->m_scaled_xfonts
;
949 wxScaledFontList::iterator i
= list
.find(int_scale
);
950 if ( i
!= list
.end() )
954 else // we don't have this font in this size yet
956 if (*this == wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT
))
958 font
= GtkGetDefaultGuiFont();
963 // do we have the XLFD?
964 if ( M_FONTDATA
->HasNativeFont() )
966 font
= wxLoadFont(M_FONTDATA
->m_nativeFontInfo
.GetXFontName());
969 // no XLFD of no exact match - try the approximate one now
973 font
= wxLoadQueryNearestFont( point_scale
,
974 M_FONTDATA
->m_family
,
976 M_FONTDATA
->m_weight
,
977 M_FONTDATA
->m_underlined
,
978 M_FONTDATA
->m_faceName
,
979 M_FONTDATA
->m_encoding
,
983 M_FONTDATA
->ReInit(xfontname
);
990 list
[int_scale
] = font
;
994 // it's quite useless to make it a wxCHECK because we're going to crash
996 wxASSERT_MSG( font
, wxT("could not load any font?") );
1000 #endif // not GTK 2.0