1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/x11/font.cpp
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // for compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 // ============================================================================
17 // ============================================================================
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
24 #pragma message disable nosimpint
25 #include "wx/vms_x_fix.h"
29 #pragma message enable nosimpint
35 #include "wx/string.h"
36 #include "wx/utils.h" // for wxGetDisplay()
37 #include "wx/settings.h"
38 #include "wx/gdicmn.h"
41 #include "wx/fontutil.h" // for wxNativeFontInfo
42 #include "wx/tokenzr.h"
44 #include "wx/x11/private.h"
46 IMPLEMENT_DYNAMIC_CLASS(wxFont
, wxGDIObject
)
48 // ----------------------------------------------------------------------------
50 // ----------------------------------------------------------------------------
52 // the default size (in points) for the fonts
53 static const int wxDEFAULT_FONT_SIZE
= 12;
58 // ----------------------------------------------------------------------------
60 // ----------------------------------------------------------------------------
62 // For every wxFont, there must be a font for each display and scale requested.
63 // So these objects are stored in wxFontRefData::m_fonts
64 class wxXFont
: public wxObject
70 WXFontStructPtr m_fontStruct
; // XFontStruct
71 WXDisplay
* m_display
; // XDisplay
72 int m_scale
; // Scale * 100
77 m_fontStruct
= (WXFontStructPtr
) 0;
78 m_display
= (WXDisplay
*) 0;
84 // Freeing the font used to produce a segv, but
85 // appears to be OK now (bug fix in X11?)
86 XFontStruct
* fontStruct
= (XFontStruct
*) m_fontStruct
;
87 XFreeFont((Display
*) m_display
, fontStruct
);
91 // ----------------------------------------------------------------------------
93 // ----------------------------------------------------------------------------
95 class wxFontRefData
: public wxObjectRefData
100 wxFontRefData(int size
= wxDEFAULT
,
101 int family
= wxDEFAULT
,
102 int style
= wxDEFAULT
,
103 int weight
= wxDEFAULT
,
104 bool underlined
= false,
105 const wxString
& faceName
= wxEmptyString
,
106 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
109 wxFontRefData(const wxFontRefData
& data
);
112 wxFontRefData(const wxString
& fontname
);
115 virtual ~wxFontRefData();
117 // setters: all of them also take care to modify m_nativeFontInfo if we
118 // have it so as to not lose the information not carried by our fields
119 void SetPointSize(int pointSize
);
120 void SetFamily(int family
);
121 void SetStyle(int style
);
122 void SetWeight(int weight
);
123 void SetUnderlined(bool underlined
);
124 bool SetFaceName(const wxString
& facename
);
125 void SetEncoding(wxFontEncoding encoding
);
127 void SetNoAntiAliasing( bool no
= true ) { m_noAA
= no
; }
128 bool GetNoAntiAliasing() const { return m_noAA
; }
130 // and this one also modifies all the other font data fields
131 void SetNativeFontInfo(const wxNativeFontInfo
& info
);
134 // common part of all ctors
140 const wxString
& faceName
,
141 wxFontEncoding encoding
);
143 // set all fields from (already initialized and valid) m_nativeFontInfo
144 void InitFromNative();
153 wxFontEncoding m_encoding
; // Unused in Unicode mode
154 bool m_noAA
; // No anti-aliasing
156 wxNativeFontInfo m_nativeFontInfo
;
158 void ClearX11Fonts();
162 // A list of wxXFonts
167 #define M_FONTDATA ((wxFontRefData*)m_refData)
169 // ----------------------------------------------------------------------------
171 // ----------------------------------------------------------------------------
173 void wxFontRefData::Init(int pointSize
,
178 const wxString
& faceName
,
179 wxFontEncoding encoding
)
181 m_family
= family
== wxFONTFAMILY_DEFAULT
? wxFONTFAMILY_SWISS
: family
;
183 m_faceName
= faceName
;
185 // we accept both wxDEFAULT and wxNORMAL here - should we?
186 m_style
= style
== wxDEFAULT
? wxFONTSTYLE_NORMAL
: style
;
187 m_weight
= weight
== wxDEFAULT
? wxFONTWEIGHT_NORMAL
: weight
;
189 // and here, do we really want to forbid creation of the font of the size
190 // 90 (the value of wxDEFAULT)??
191 m_pointSize
= pointSize
== wxDEFAULT
|| pointSize
== -1
192 ? wxDEFAULT_FONT_SIZE
195 m_underlined
= underlined
;
196 m_encoding
= encoding
;
199 // Create native font info
200 m_nativeFontInfo
.description
= pango_font_description_new();
202 // And set its values
205 case wxFONTFAMILY_MODERN
:
206 case wxFONTFAMILY_TELETYPE
:
207 pango_font_description_set_family( m_nativeFontInfo
.description
, "monospace" );
209 case wxFONTFAMILY_ROMAN
:
210 pango_font_description_set_family( m_nativeFontInfo
.description
, "serif" );
213 pango_font_description_set_family( m_nativeFontInfo
.description
, "sans" );
217 SetPointSize( m_pointSize
);
218 SetWeight( m_weight
);
222 void wxFontRefData::InitFromNative()
228 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
231 m_faceName
= wxGTK_CONV_BACK( pango_font_description_get_family( desc
) );
233 m_pointSize
= pango_font_description_get_size( desc
) / PANGO_SCALE
;
235 switch (pango_font_description_get_style( desc
))
237 case PANGO_STYLE_NORMAL
:
238 m_style
= wxFONTSTYLE_NORMAL
;
240 case PANGO_STYLE_ITALIC
:
241 m_style
= wxFONTSTYLE_ITALIC
;
243 case PANGO_STYLE_OBLIQUE
:
244 m_style
= wxFONTSTYLE_SLANT
;
248 // Not defined in some Pango versions
249 #define wxPANGO_WEIGHT_SEMIBOLD 600
251 switch (pango_font_description_get_weight( desc
))
253 case PANGO_WEIGHT_ULTRALIGHT
:
254 case PANGO_WEIGHT_LIGHT
:
255 m_weight
= wxFONTWEIGHT_LIGHT
;
259 wxFAIL_MSG(_T("unknown Pango font weight"));
262 case PANGO_WEIGHT_NORMAL
:
263 m_weight
= wxFONTWEIGHT_NORMAL
;
266 case wxPANGO_WEIGHT_SEMIBOLD
:
267 case PANGO_WEIGHT_BOLD
:
268 case PANGO_WEIGHT_ULTRABOLD
:
269 case PANGO_WEIGHT_HEAVY
:
270 m_weight
= wxFONTWEIGHT_BOLD
;
274 if (m_faceName
== wxT("monospace"))
276 m_family
= wxFONTFAMILY_TELETYPE
;
278 else if (m_faceName
== wxT("sans"))
280 m_family
= wxFONTFAMILY_SWISS
;
284 m_family
= wxFONTFAMILY_UNKNOWN
;
287 // Pango description are never underlined (?)
288 m_underlined
= false;
290 // Cannot we choose that
291 m_encoding
= wxFONTENCODING_SYSTEM
;
293 // get the font parameters from the XLFD
294 // -------------------------------------
296 m_faceName
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_FAMILY
);
298 m_weight
= wxFONTWEIGHT_NORMAL
;
300 wxString w
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_WEIGHT
).Upper();
301 if ( !w
.empty() && w
!= _T('*') )
303 // the test below catches all of BOLD, EXTRABOLD, DEMIBOLD, ULTRABOLD
305 if ( ((w
[0u] == _T('B') && (!wxStrcmp(w
.c_str() + 1, wxT("OLD")) ||
306 !wxStrcmp(w
.c_str() + 1, wxT("LACK"))))) ||
307 wxStrstr(w
.c_str() + 1, _T("BOLD")) )
309 m_weight
= wxFONTWEIGHT_BOLD
;
311 else if ( w
== _T("LIGHT") || w
== _T("THIN") )
313 m_weight
= wxFONTWEIGHT_LIGHT
;
317 switch ( wxToupper(*m_nativeFontInfo
.
318 GetXFontComponent(wxXLFD_SLANT
).c_str()) )
320 case _T('I'): // italique
321 m_style
= wxFONTSTYLE_ITALIC
;
324 case _T('O'): // oblique
325 m_style
= wxFONTSTYLE_SLANT
;
329 m_style
= wxFONTSTYLE_NORMAL
;
333 if ( m_nativeFontInfo
.GetXFontComponent(wxXLFD_POINTSIZE
).ToLong(&ptSize
) )
335 // size in XLFD is in 10 point units
336 m_pointSize
= (int)(ptSize
/ 10);
340 m_pointSize
= wxDEFAULT_FONT_SIZE
;
343 // examine the spacing: if the font is monospaced, assume wxTELETYPE
344 // family for compatibility with the old code which used it instead of
346 if ( m_nativeFontInfo
.GetXFontComponent(wxXLFD_SPACING
).Upper() == _T('M') )
348 m_family
= wxFONTFAMILY_TELETYPE
;
350 else // not monospaceed
352 // don't even try guessing it, it doesn't work for too many fonts
354 m_family
= wxFONTFAMILY_UNKNOWN
;
357 // X fonts are never underlined...
358 m_underlined
= false;
360 // deal with font encoding
362 registry
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_REGISTRY
).Upper(),
363 encoding
= m_nativeFontInfo
.GetXFontComponent(wxXLFD_ENCODING
).Upper();
365 if ( registry
== _T("ISO8859") )
368 if ( wxSscanf(encoding
, wxT("%d"), &cp
) == 1 )
370 m_encoding
= (wxFontEncoding
)(wxFONTENCODING_ISO8859_1
+ cp
- 1);
373 else if ( registry
== _T("MICROSOFT") )
376 if ( wxSscanf(encoding
, wxT("cp125%d"), &cp
) == 1 )
378 m_encoding
= (wxFontEncoding
)(wxFONTENCODING_CP1250
+ cp
);
381 else if ( registry
== _T("KOI8") )
383 m_encoding
= wxFONTENCODING_KOI8
;
385 else // unknown encoding
387 // may be give a warning here? or use wxFontMapper?
388 m_encoding
= wxFONTENCODING_SYSTEM
;
393 wxFontRefData::wxFontRefData( const wxFontRefData
& data
)
396 m_pointSize
= data
.m_pointSize
;
397 m_family
= data
.m_family
;
398 m_style
= data
.m_style
;
399 m_weight
= data
.m_weight
;
401 m_underlined
= data
.m_underlined
;
403 m_faceName
= data
.m_faceName
;
404 m_encoding
= data
.m_encoding
;
406 m_noAA
= data
.m_noAA
;
408 m_nativeFontInfo
= data
.m_nativeFontInfo
;
411 wxFontRefData::wxFontRefData(int size
, int family
, int style
,
412 int weight
, bool underlined
,
413 const wxString
& faceName
,
414 wxFontEncoding encoding
)
416 Init(size
, family
, style
, weight
, underlined
, faceName
, encoding
);
419 wxFontRefData::wxFontRefData(const wxString
& fontname
)
421 // VZ: FromString() should really work in both cases, doesn't it?
423 m_nativeFontInfo
.FromString( fontname
);
425 m_nativeFontInfo
.SetXFontName(fontname
);
431 void wxFontRefData::ClearX11Fonts()
435 wxList::compatibility_iterator node
= m_fonts
.GetFirst();
438 wxXFont
* f
= (wxXFont
*) node
->GetData();
440 node
= node
->GetNext();
446 wxFontRefData::~wxFontRefData()
451 // ----------------------------------------------------------------------------
452 // wxFontRefData SetXXX()
453 // ----------------------------------------------------------------------------
455 void wxFontRefData::SetPointSize(int pointSize
)
457 m_pointSize
= pointSize
;
461 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
463 pango_font_description_set_size( desc
, m_pointSize
* PANGO_SCALE
);
467 void wxFontRefData::SetFamily(int family
)
471 // TODO: what are we supposed to do with m_nativeFontInfo here?
474 void wxFontRefData::SetStyle(int style
)
480 PangoFontDescription
*desc
= m_nativeFontInfo
.description
;
484 case wxFONTSTYLE_ITALIC
:
485 pango_font_description_set_style( desc
, PANGO_STYLE_ITALIC
);
487 case wxFONTSTYLE_SLANT
:
488 pango_font_description_set_style( desc
, PANGO_STYLE_OBLIQUE
);
491 wxFAIL_MSG( _T("unknown font style") );
493 case wxFONTSTYLE_NORMAL
:
494 pango_font_description_set_style( desc
, PANGO_STYLE_NORMAL
);
500 void wxFontRefData::SetWeight(int weight
)
505 void wxFontRefData::SetUnderlined(bool underlined
)
507 m_underlined
= underlined
;
509 // the XLFD doesn't have "underlined" field anyhow
512 bool wxFontRefData::SetFaceName(const wxString
& facename
)
514 m_faceName
= facename
;
518 void wxFontRefData::SetEncoding(wxFontEncoding encoding
)
520 m_encoding
= encoding
;
523 void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo
& info
)
525 // previously cached fonts shouldn't be used
528 m_nativeFontInfo
= info
;
530 // set all the other font parameters from the native font info
534 // ----------------------------------------------------------------------------
536 // ----------------------------------------------------------------------------
538 wxFont::wxFont(const wxNativeFontInfo
& info
)
541 Create( info
.GetPointSize(),
545 info
.GetUnderlined(),
547 info
.GetEncoding() );
549 (void) Create(info
.GetXFontName());
553 bool wxFont::Create(int pointSize
,
558 const wxString
& faceName
,
559 wxFontEncoding encoding
)
563 m_refData
= new wxFontRefData(pointSize
, family
, style
, weight
,
564 underlined
, faceName
, encoding
);
571 bool wxFont::Create(const wxString
& fontname
, wxFontEncoding enc
)
575 *this = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT
);
579 m_refData
= new wxFontRefData();
581 M_FONTDATA
->m_nativeFontInfo
.SetXFontName(fontname
); // X font name
585 wxStringTokenizer
tn( fontname
, wxT("-") );
587 tn
.GetNextToken(); // skip initial empty token
588 tn
.GetNextToken(); // foundry
591 M_FONTDATA
->m_faceName
= tn
.GetNextToken(); // family
593 tmp
= tn
.GetNextToken().MakeUpper(); // weight
594 if (tmp
== wxT("BOLD")) M_FONTDATA
->m_weight
= wxBOLD
;
595 if (tmp
== wxT("BLACK")) M_FONTDATA
->m_weight
= wxBOLD
;
596 if (tmp
== wxT("EXTRABOLD")) M_FONTDATA
->m_weight
= wxBOLD
;
597 if (tmp
== wxT("DEMIBOLD")) M_FONTDATA
->m_weight
= wxBOLD
;
598 if (tmp
== wxT("ULTRABOLD")) M_FONTDATA
->m_weight
= wxBOLD
;
600 if (tmp
== wxT("LIGHT")) M_FONTDATA
->m_weight
= wxLIGHT
;
601 if (tmp
== wxT("THIN")) M_FONTDATA
->m_weight
= wxLIGHT
;
603 tmp
= tn
.GetNextToken().MakeUpper(); // slant
604 if (tmp
== wxT("I")) M_FONTDATA
->m_style
= wxITALIC
;
605 if (tmp
== wxT("O")) M_FONTDATA
->m_style
= wxITALIC
;
607 tn
.GetNextToken(); // set width
608 tn
.GetNextToken(); // add. style
609 tn
.GetNextToken(); // pixel size
611 tmp
= tn
.GetNextToken(); // pointsize
614 long num
= wxStrtol (tmp
.c_str(), (wxChar
**) NULL
, 10);
615 M_FONTDATA
->m_pointSize
= (int)(num
/ 10);
618 tn
.GetNextToken(); // x-res
619 tn
.GetNextToken(); // y-res
621 tmp
= tn
.GetNextToken().MakeUpper(); // spacing
624 M_FONTDATA
->m_family
= wxMODERN
;
625 else if (M_FONTDATA
->m_faceName
== wxT("TIMES"))
626 M_FONTDATA
->m_family
= wxROMAN
;
627 else if (M_FONTDATA
->m_faceName
== wxT("HELVETICA"))
628 M_FONTDATA
->m_family
= wxSWISS
;
629 else if (M_FONTDATA
->m_faceName
== wxT("LUCIDATYPEWRITER"))
630 M_FONTDATA
->m_family
= wxTELETYPE
;
631 else if (M_FONTDATA
->m_faceName
== wxT("LUCIDA"))
632 M_FONTDATA
->m_family
= wxDECORATIVE
;
633 else if (M_FONTDATA
->m_faceName
== wxT("UTOPIA"))
634 M_FONTDATA
->m_family
= wxSCRIPT
;
636 tn
.GetNextToken(); // avg width
638 // deal with font encoding
639 M_FONTDATA
->m_encoding
= enc
;
640 if ( M_FONTDATA
->m_encoding
== wxFONTENCODING_SYSTEM
)
642 wxString registry
= tn
.GetNextToken().MakeUpper(),
643 encoding
= tn
.GetNextToken().MakeUpper();
645 if ( registry
== _T("ISO8859") )
648 if ( wxSscanf(encoding
, wxT("%d"), &cp
) == 1 )
650 M_FONTDATA
->m_encoding
=
651 (wxFontEncoding
)(wxFONTENCODING_ISO8859_1
+ cp
- 1);
654 else if ( registry
== _T("MICROSOFT") )
657 if ( wxSscanf(encoding
, wxT("cp125%d"), &cp
) == 1 )
659 M_FONTDATA
->m_encoding
=
660 (wxFontEncoding
)(wxFONTENCODING_CP1250
+ cp
);
663 else if ( registry
== _T("KOI8") )
665 M_FONTDATA
->m_encoding
= wxFONTENCODING_KOI8
;
667 //else: unknown encoding - may be give a warning here?
673 #endif // !wxUSE_UNICODE
679 // ----------------------------------------------------------------------------
680 // change the font attributes
681 // ----------------------------------------------------------------------------
683 void wxFont::Unshare()
685 // Don't change shared data
688 m_refData
= new wxFontRefData();
692 wxFontRefData
* ref
= new wxFontRefData(*(wxFontRefData
*)m_refData
);
698 // ----------------------------------------------------------------------------
700 // ----------------------------------------------------------------------------
702 int wxFont::GetPointSize() const
704 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
706 return M_FONTDATA
->m_pointSize
;
709 wxString
wxFont::GetFaceName() const
711 wxCHECK_MSG( Ok(), wxEmptyString
, wxT("invalid font") );
713 return M_FONTDATA
->m_faceName
;
716 int wxFont::GetFamily() const
718 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
720 return M_FONTDATA
->m_family
;
723 int wxFont::GetStyle() const
725 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
727 return M_FONTDATA
->m_style
;
730 int wxFont::GetWeight() const
732 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
734 return M_FONTDATA
->m_weight
;
737 bool wxFont::GetUnderlined() const
739 wxCHECK_MSG( Ok(), false, wxT("invalid font") );
741 return M_FONTDATA
->m_underlined
;
744 wxFontEncoding
wxFont::GetEncoding() const
746 wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT
, wxT("invalid font") );
748 return M_FONTDATA
->m_encoding
;
751 bool wxFont::GetNoAntiAliasing() const
753 wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT
, wxT("invalid font") );
755 return M_FONTDATA
->m_noAA
;
758 const wxNativeFontInfo
*wxFont::GetNativeFontInfo() const
760 wxCHECK_MSG( Ok(), (wxNativeFontInfo
*)NULL
, wxT("invalid font") );
764 if ( M_FONTDATA
->m_nativeFontInfo
.GetXFontName().empty() )
768 return &(M_FONTDATA
->m_nativeFontInfo
);
771 bool wxFont::IsFixedWidth() const
773 wxCHECK_MSG( Ok(), false, wxT("invalid font") );
776 return wxFontBase::IsFixedWidth();
778 // Robert, is this right? HasNativeFont doesn't exist.
780 // if ( M_FONTDATA->HasNativeFont() )
782 // the monospace fonts are supposed to have "M" in the spacing field
783 wxString spacing
= M_FONTDATA
->
784 m_nativeFontInfo
.GetXFontComponent(wxXLFD_SPACING
);
786 return spacing
.Upper() == _T('M');
788 // Unreaceable code for now
789 // return wxFontBase::IsFixedWidth();
794 // ----------------------------------------------------------------------------
795 // change font attributes
796 // ----------------------------------------------------------------------------
798 void wxFont::SetPointSize(int pointSize
)
802 M_FONTDATA
->SetPointSize(pointSize
);
805 void wxFont::SetFamily(int family
)
809 M_FONTDATA
->SetFamily(family
);
812 void wxFont::SetStyle(int style
)
816 M_FONTDATA
->SetStyle(style
);
819 void wxFont::SetWeight(int weight
)
823 M_FONTDATA
->SetWeight(weight
);
826 bool wxFont::SetFaceName(const wxString
& faceName
)
830 return M_FONTDATA
->SetFaceName(faceName
) &&
831 wxFontBase::SetFaceName(faceName
);
834 void wxFont::SetUnderlined(bool underlined
)
838 M_FONTDATA
->SetUnderlined(underlined
);
841 void wxFont::SetEncoding(wxFontEncoding encoding
)
845 M_FONTDATA
->SetEncoding(encoding
);
848 void wxFont::DoSetNativeFontInfo( const wxNativeFontInfo
& info
)
852 M_FONTDATA
->SetNativeFontInfo( info
);
855 void wxFont::SetNoAntiAliasing( bool no
)
859 M_FONTDATA
->SetNoAntiAliasing( no
);
865 // ----------------------------------------------------------------------------
866 // X11 implementation
867 // ----------------------------------------------------------------------------
869 // Find an existing, or create a new, XFontStruct
870 // based on this wxFont and the given scale. Append the
871 // font to list in the private data for future reference.
872 wxXFont
* wxFont::GetInternalFont(double scale
, WXDisplay
* display
) const
875 return (wxXFont
*)NULL
;
877 long intScale
= long(scale
* 100.0 + 0.5); // key for wxXFont
878 int pointSize
= (M_FONTDATA
->m_pointSize
* 10 * intScale
) / 100;
880 // search existing fonts first
881 wxList::compatibility_iterator node
= M_FONTDATA
->m_fonts
.GetFirst();
884 wxXFont
* f
= (wxXFont
*) node
->GetData();
885 if ((!display
|| (f
->m_display
== display
)) && (f
->m_scale
== intScale
))
887 node
= node
->GetNext();
890 wxString xFontName
= M_FONTDATA
->m_nativeFontInfo
.GetXFontName();
891 if (xFontName
== "-*-*-*-*-*--*-*-*-*-*-*-*-*")
892 // wxFont constructor not called with native font info parameter => take M_FONTDATA values
895 // not found, create a new one
896 XFontStruct
*font
= (XFontStruct
*)
897 wxLoadQueryNearestFont(pointSize
,
898 M_FONTDATA
->m_family
,
900 M_FONTDATA
->m_weight
,
901 M_FONTDATA
->m_underlined
,
903 M_FONTDATA
->m_encoding
,
908 wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") );
910 return (wxXFont
*) NULL
;
913 wxXFont
* f
= new wxXFont
;
914 f
->m_fontStruct
= (WXFontStructPtr
)font
;
915 f
->m_display
= ( display
? display
: wxGetDisplay() );
916 f
->m_scale
= intScale
;
917 M_FONTDATA
->m_fonts
.Append(f
);
922 WXFontStructPtr
wxFont::GetFontStruct(double scale
, WXDisplay
* display
) const
924 wxXFont
* f
= GetInternalFont(scale
, display
);
926 return (f
? f
->m_fontStruct
: (WXFontStructPtr
) 0);