]> git.saurik.com Git - wxWidgets.git/blob - src/msw/font.cpp
changed the default font facename for the decorative family - is it correct for Win9x?
[wxWidgets.git] / src / msw / font.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/font.cpp
3 // Purpose: wxFont class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #ifdef __GNUG__
21 #pragma implementation "font.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #ifndef WX_PRECOMP
32 #include "wx/setup.h"
33 #include "wx/list.h"
34 #include "wx/utils.h"
35 #include "wx/app.h"
36 #include "wx/font.h"
37 #include "wx/log.h"
38 #endif // WX_PRECOMP
39
40 #include "wx/msw/private.h"
41
42 #include "wx/fontutil.h"
43 #include "wx/fontmap.h"
44
45 #include "wx/tokenzr.h"
46
47 IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
48
49 // ----------------------------------------------------------------------------
50 // constants
51 // ----------------------------------------------------------------------------
52
53 // ----------------------------------------------------------------------------
54 // wxFontRefData - the internal description of the font
55 // ----------------------------------------------------------------------------
56
57 class WXDLLEXPORT wxFontRefData: public wxGDIRefData
58 {
59 public:
60 // constructors
61 wxFontRefData()
62 {
63 Init(-1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL,
64 FALSE, _T(""), wxFONTENCODING_DEFAULT);
65 }
66
67 wxFontRefData(int size,
68 int family,
69 int style,
70 int weight,
71 bool underlined,
72 const wxString& faceName,
73 wxFontEncoding encoding)
74 {
75 Init(size, family, style, weight, underlined, faceName, encoding);
76 }
77
78 wxFontRefData(const wxNativeFontInfo& info, WXHFONT hFont = 0)
79 {
80 Init(info, hFont);
81 }
82
83 wxFontRefData(const wxFontRefData& data)
84 {
85 if ( data.m_nativeFontInfoOk )
86 {
87 Init(data.m_nativeFontInfo);
88 }
89 else
90 {
91 Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight,
92 data.m_underlined, data.m_faceName, data.m_encoding);
93 }
94 }
95
96 virtual ~wxFontRefData();
97
98 // operations
99 bool Alloc(wxFont *font);
100
101 void Free();
102
103 // all wxFont accessors
104 int GetPointSize() const
105 {
106 return m_nativeFontInfoOk ? m_nativeFontInfo.GetPointSize()
107 : m_pointSize;
108 }
109
110 int GetFamily() const
111 {
112 return m_family;
113 }
114
115 int GetStyle() const
116 {
117 return m_nativeFontInfoOk ? m_nativeFontInfo.GetStyle()
118 : m_style;
119 }
120
121 int GetWeight() const
122 {
123 return m_nativeFontInfoOk ? m_nativeFontInfo.GetWeight()
124 : m_weight;
125 }
126
127 bool GetUnderlined() const
128 {
129 return m_nativeFontInfoOk ? m_nativeFontInfo.GetUnderlined()
130 : m_underlined;
131 }
132
133 wxString GetFaceName() const
134 {
135 wxString s;
136 if ( m_nativeFontInfoOk )
137 s = m_nativeFontInfo.GetFaceName();
138 else
139 s = m_faceName;
140
141 return s;
142 }
143
144 wxFontEncoding GetEncoding() const
145 {
146 return m_nativeFontInfoOk ? m_nativeFontInfo.GetEncoding()
147 : m_encoding;
148 }
149
150 WXHFONT GetHFONT() const { return m_hFont; }
151
152 // ... and setters
153 void SetPointSize(int pointSize)
154 {
155 if ( m_nativeFontInfoOk )
156 m_nativeFontInfo.SetPointSize(pointSize);
157 else
158 m_pointSize = pointSize;
159 }
160
161 void SetFamily(int family)
162 {
163 m_family = family;
164 }
165
166 void SetStyle(int style)
167 {
168 if ( m_nativeFontInfoOk )
169 m_nativeFontInfo.SetStyle((wxFontStyle)style);
170 else
171 m_style = style;
172 }
173
174 void SetWeight(int weight)
175 {
176 if ( m_nativeFontInfoOk )
177 m_nativeFontInfo.SetWeight((wxFontWeight)weight);
178 else
179 m_weight = weight;
180 }
181
182 void SetFaceName(const wxString& faceName)
183 {
184 if ( m_nativeFontInfoOk )
185 m_nativeFontInfo.SetFaceName(faceName);
186 else
187 m_faceName = faceName;
188 }
189
190 void SetUnderlined(bool underlined)
191 {
192 if ( m_nativeFontInfoOk )
193 m_nativeFontInfo.SetUnderlined(underlined);
194 else
195 m_underlined = underlined;
196 }
197
198 void SetEncoding(wxFontEncoding encoding)
199 {
200 if ( m_nativeFontInfoOk )
201 m_nativeFontInfo.SetEncoding(encoding);
202 else
203 m_encoding = encoding;
204 }
205
206 // native font info tests
207 bool HasNativeFontInfo() const { return m_nativeFontInfoOk; }
208
209 const wxNativeFontInfo& GetNativeFontInfo() const
210 { return m_nativeFontInfo; }
211
212 protected:
213 // common part of all ctors
214 void Init(int size,
215 int family,
216 int style,
217 int weight,
218 bool underlined,
219 const wxString& faceName,
220 wxFontEncoding encoding);
221
222 void Init(const wxNativeFontInfo& info, WXHFONT hFont = 0);
223
224 // font characterstics
225 int m_pointSize;
226 int m_family;
227 int m_style;
228 int m_weight;
229 bool m_underlined;
230 wxString m_faceName;
231 wxFontEncoding m_encoding;
232
233 // Windows font handle
234 WXHFONT m_hFont;
235
236 // Native font info
237 wxNativeFontInfo m_nativeFontInfo;
238 bool m_nativeFontInfoOk;
239 };
240
241 // ============================================================================
242 // implementation
243 // ============================================================================
244
245 // ----------------------------------------------------------------------------
246 // wxFontRefData
247 // ----------------------------------------------------------------------------
248
249 void wxFontRefData::Init(int pointSize,
250 int family,
251 int style,
252 int weight,
253 bool underlined,
254 const wxString& faceName,
255 wxFontEncoding encoding)
256 {
257 m_style = style;
258 m_pointSize = pointSize == -1 ? wxNORMAL_FONT->GetPointSize() : pointSize;
259 m_family = family;
260 m_style = style;
261 m_weight = weight;
262 m_underlined = underlined;
263 m_faceName = faceName;
264 m_encoding = encoding;
265
266 m_hFont = 0;
267
268 m_nativeFontInfoOk = FALSE;
269 }
270
271 void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont)
272 {
273 // we don't really need the family, what for?
274 #if 0
275 // extract family from pitch-and-family
276 int lfFamily = info.lf.lfPitchAndFamily;
277 if ( lfFamily & FIXED_PITCH )
278 lfFamily -= FIXED_PITCH;
279 if ( lfFamily & VARIABLE_PITCH )
280 lfFamily -= VARIABLE_PITCH;
281
282 switch ( lfFamily )
283 {
284 case FF_ROMAN:
285 m_family = wxROMAN;
286 break;
287
288 case FF_SWISS:
289 m_family = wxSWISS;
290 break;
291
292 case FF_SCRIPT:
293 m_family = wxSCRIPT;
294 break;
295
296 case FF_MODERN:
297 m_family = wxMODERN;
298 break;
299
300 case FF_DECORATIVE:
301 m_family = wxDECORATIVE;
302 break;
303
304 default:
305 m_family = wxSWISS;
306 }
307 #endif // 0
308
309 // hFont may be zero, or it be passed in case we really want to
310 // use the exact font created in the underlying system
311 // (for example where we can't guarantee conversion from HFONT
312 // to LOGFONT back to HFONT)
313 m_hFont = hFont;
314
315 m_nativeFontInfoOk = TRUE;
316 m_nativeFontInfo = info;
317 }
318
319 wxFontRefData::~wxFontRefData()
320 {
321 Free();
322 }
323
324 bool wxFontRefData::Alloc(wxFont *font)
325 {
326 if ( !m_nativeFontInfoOk )
327 {
328 wxFillLogFont(&m_nativeFontInfo.lf, font);
329 m_nativeFontInfoOk = TRUE;
330 }
331
332 HFONT hfont = ::CreateFontIndirect(&m_nativeFontInfo.lf);
333 if ( !hfont )
334 {
335 wxLogLastError(wxT("CreateFont"));
336
337 return FALSE;
338 }
339
340 m_hFont = (WXHFONT)hfont;
341
342 return TRUE;
343 }
344
345 void wxFontRefData::Free()
346 {
347 if ( m_hFont )
348 {
349 if ( !::DeleteObject((HFONT) m_hFont) )
350 {
351 wxLogLastError(wxT("DeleteObject(font)"));
352 }
353
354 m_hFont = 0;
355 }
356 }
357
358 // ----------------------------------------------------------------------------
359 // wxNativeFontInfo
360 // ----------------------------------------------------------------------------
361
362 void wxNativeFontInfo::Init()
363 {
364 wxZeroMemory(lf);
365 }
366
367 int wxNativeFontInfo::GetPointSize() const
368 {
369 // FIXME: using the screen here results in incorrect font size calculation
370 // for printing!
371 const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
372
373 return (int) (((72.0*(double)abs(lf.lfHeight)) / (double) ppInch) + 0.5);
374 }
375
376 wxFontStyle wxNativeFontInfo::GetStyle() const
377 {
378 return lf.lfItalic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL;
379 }
380
381 wxFontWeight wxNativeFontInfo::GetWeight() const
382 {
383 if ( lf.lfWeight <= 300 )
384 return wxFONTWEIGHT_LIGHT;
385
386 if ( lf.lfWeight >= 600 )
387 return wxFONTWEIGHT_BOLD;
388
389 return wxFONTWEIGHT_NORMAL;
390 }
391
392 bool wxNativeFontInfo::GetUnderlined() const
393 {
394 return lf.lfUnderline != 0;
395 }
396
397 wxString wxNativeFontInfo::GetFaceName() const
398 {
399 return lf.lfFaceName;
400 }
401
402 wxFontEncoding wxNativeFontInfo::GetEncoding() const
403 {
404 return wxGetFontEncFromCharSet(lf.lfCharSet);
405 }
406
407 void wxNativeFontInfo::SetPointSize(int pointsize)
408 {
409 #if wxFONT_SIZE_COMPATIBILITY
410 // Incorrect, but compatible with old wxWindows behaviour
411 lf.lfHeight = (pointSize*ppInch)/72;
412 #else // wxFONT_SIZE_COMPATIBILITY
413 // FIXME: using the screen here results in incorrect font size calculation
414 // for printing!
415 const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
416
417 lf.lfHeight = -(int)((pointsize*((double)ppInch)/72.0) + 0.5);
418 #endif // wxFONT_SIZE_COMPATIBILITY/!wxFONT_SIZE_COMPATIBILITY
419 }
420
421 void wxNativeFontInfo::SetStyle(wxFontStyle style)
422 {
423 switch ( style )
424 {
425 default:
426 wxFAIL_MSG( _T("unknown font style") );
427 // fall through
428
429 case wxFONTSTYLE_NORMAL:
430 break;
431
432 case wxFONTSTYLE_ITALIC:
433 case wxFONTSTYLE_SLANT:
434 lf.lfItalic = TRUE;
435 break;
436 }
437 }
438
439 void wxNativeFontInfo::SetWeight(wxFontWeight weight)
440 {
441 switch ( weight )
442 {
443 default:
444 wxFAIL_MSG( _T("unknown font weight") );
445 // fall through
446
447 case wxFONTWEIGHT_NORMAL:
448 lf.lfWeight = FW_NORMAL;
449 break;
450
451 case wxFONTWEIGHT_LIGHT:
452 lf.lfWeight = FW_LIGHT;
453 break;
454
455 case wxFONTWEIGHT_BOLD:
456 lf.lfWeight = FW_BOLD;
457 break;
458 }
459 }
460
461 void wxNativeFontInfo::SetUnderlined(bool underlined)
462 {
463 lf.lfUnderline = underlined;
464 }
465
466 void wxNativeFontInfo::SetFaceName(wxString facename)
467 {
468 wxStrncpy(lf.lfFaceName, facename, sizeof(lf.lfFaceName));
469 }
470
471 void wxNativeFontInfo::SetFamily(wxFontFamily family)
472 {
473 int ff_family;
474 wxString facename;
475
476 switch ( family )
477 {
478 case wxSCRIPT:
479 ff_family = FF_SCRIPT;
480 facename = _T("Script");
481 break;
482
483 case wxDECORATIVE:
484 ff_family = FF_DECORATIVE;
485 facename = _T("Old English Text MT");
486 break;
487
488 case wxROMAN:
489 ff_family = FF_ROMAN;
490 facename = _T("Times New Roman");
491 break;
492
493 case wxTELETYPE:
494 case wxMODERN:
495 ff_family = FF_MODERN;
496 facename = _T("Courier New");
497 break;
498
499 case wxSWISS:
500 ff_family = FF_SWISS;
501 facename = _T("Arial");
502 break;
503
504 case wxDEFAULT:
505 default:
506 ff_family = FF_SWISS;
507 facename = _T("MS Sans Serif");
508 }
509
510 lf.lfPitchAndFamily = DEFAULT_PITCH | ff_family;
511
512 if ( !wxStrlen(lf.lfFaceName) )
513 {
514 SetFaceName(facename);
515 }
516 }
517
518 void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding)
519 {
520 wxNativeEncodingInfo info;
521 if ( !wxGetNativeFontEncoding(encoding, &info) )
522 {
523 #if wxUSE_FONTMAP
524 if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
525 #endif // wxUSE_FONTMAP
526 {
527 // unsupported encoding, replace with the default
528 info.charset = ANSI_CHARSET;
529 }
530 else if ( !info.facename.empty() )
531 {
532 // if we have this encoding only in some particular facename, use
533 // the facename - it is better to show the correct characters in a
534 // wrong facename than unreadable text in a correct one
535 SetFaceName(info.facename);
536 }
537 }
538
539 lf.lfCharSet = info.charset;
540 }
541
542 bool wxNativeFontInfo::FromString(const wxString& s)
543 {
544 long l;
545
546 wxStringTokenizer tokenizer(s, _T(";"));
547
548 // first the version
549 wxString token = tokenizer.GetNextToken();
550 if ( token != _T('0') )
551 return FALSE;
552
553 token = tokenizer.GetNextToken();
554 if ( !token.ToLong(&l) )
555 return FALSE;
556 lf.lfHeight = l;
557
558 token = tokenizer.GetNextToken();
559 if ( !token.ToLong(&l) )
560 return FALSE;
561 lf.lfWidth = l;
562
563 token = tokenizer.GetNextToken();
564 if ( !token.ToLong(&l) )
565 return FALSE;
566 lf.lfEscapement = l;
567
568 token = tokenizer.GetNextToken();
569 if ( !token.ToLong(&l) )
570 return FALSE;
571 lf.lfOrientation = l;
572
573 token = tokenizer.GetNextToken();
574 if ( !token.ToLong(&l) )
575 return FALSE;
576 lf.lfWeight = l;
577
578 token = tokenizer.GetNextToken();
579 if ( !token.ToLong(&l) )
580 return FALSE;
581 lf.lfItalic = (BYTE)l;
582
583 token = tokenizer.GetNextToken();
584 if ( !token.ToLong(&l) )
585 return FALSE;
586 lf.lfUnderline = (BYTE)l;
587
588 token = tokenizer.GetNextToken();
589 if ( !token.ToLong(&l) )
590 return FALSE;
591 lf.lfStrikeOut = (BYTE)l;
592
593 token = tokenizer.GetNextToken();
594 if ( !token.ToLong(&l) )
595 return FALSE;
596 lf.lfCharSet = (BYTE)l;
597
598 token = tokenizer.GetNextToken();
599 if ( !token.ToLong(&l) )
600 return FALSE;
601 lf.lfOutPrecision = (BYTE)l;
602
603 token = tokenizer.GetNextToken();
604 if ( !token.ToLong(&l) )
605 return FALSE;
606 lf.lfClipPrecision = (BYTE)l;
607
608 token = tokenizer.GetNextToken();
609 if ( !token.ToLong(&l) )
610 return FALSE;
611 lf.lfQuality = (BYTE)l;
612
613 token = tokenizer.GetNextToken();
614 if ( !token.ToLong(&l) )
615 return FALSE;
616 lf.lfPitchAndFamily = (BYTE)l;
617
618 token = tokenizer.GetNextToken();
619 if(!token)
620 return FALSE;
621 wxStrcpy(lf.lfFaceName, token.c_str());
622
623 return TRUE;
624 }
625
626 wxString wxNativeFontInfo::ToString() const
627 {
628 wxString s;
629
630 s.Printf(_T("%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%s"),
631 0, // version, in case we want to change the format later
632 lf.lfHeight,
633 lf.lfWidth,
634 lf.lfEscapement,
635 lf.lfOrientation,
636 lf.lfWeight,
637 lf.lfItalic,
638 lf.lfUnderline,
639 lf.lfStrikeOut,
640 lf.lfCharSet,
641 lf.lfOutPrecision,
642 lf.lfClipPrecision,
643 lf.lfQuality,
644 lf.lfPitchAndFamily,
645 lf.lfFaceName);
646
647 return s;
648 }
649
650 // ----------------------------------------------------------------------------
651 // wxFont
652 // ----------------------------------------------------------------------------
653
654 void wxFont::Init()
655 {
656 }
657
658 bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
659 {
660 UnRef();
661
662 m_refData = new wxFontRefData(info, hFont);
663
664 RealizeResource();
665
666 return TRUE;
667 }
668
669 wxFont::wxFont(const wxString& fontdesc)
670 {
671 wxNativeFontInfo info;
672 if ( info.FromString(fontdesc) )
673 (void)Create(info);
674 }
675
676 /* Constructor for a font. Note that the real construction is done
677 * in wxDC::SetFont, when information is available about scaling etc.
678 */
679 bool wxFont::Create(int pointSize,
680 int family,
681 int style,
682 int weight,
683 bool underlined,
684 const wxString& faceName,
685 wxFontEncoding encoding)
686 {
687 UnRef();
688
689 // wxDEFAULT is a valid value for the font size too so we must treat it
690 // specially here (otherwise the size would be 70 == wxDEFAULT value)
691 if ( pointSize == wxDEFAULT )
692 {
693 pointSize = wxNORMAL_FONT->GetPointSize();
694 }
695
696 m_refData = new wxFontRefData(pointSize, family, style, weight,
697 underlined, faceName, encoding);
698
699 RealizeResource();
700
701 return TRUE;
702 }
703
704 wxFont::~wxFont()
705 {
706 }
707
708 // ----------------------------------------------------------------------------
709 // real implementation
710 // ----------------------------------------------------------------------------
711
712 bool wxFont::RealizeResource()
713 {
714 if ( GetResourceHandle() )
715 {
716 // VZ: the old code returned FALSE in this case, but it doesn't seem
717 // to make sense because the font _was_ created
718 return TRUE;
719 }
720
721 return M_FONTDATA->Alloc(this);
722 }
723
724 bool wxFont::FreeResource(bool WXUNUSED(force))
725 {
726 if ( GetResourceHandle() )
727 {
728 M_FONTDATA->Free();
729
730 return TRUE;
731 }
732
733 return FALSE;
734 }
735
736 WXHANDLE wxFont::GetResourceHandle()
737 {
738 return GetHFONT();
739 }
740
741 WXHFONT wxFont::GetHFONT() const
742 {
743 return M_FONTDATA ? M_FONTDATA->GetHFONT() : 0;
744 }
745
746 bool wxFont::IsFree() const
747 {
748 return M_FONTDATA && (M_FONTDATA->GetHFONT() == 0);
749 }
750
751 void wxFont::Unshare()
752 {
753 // Don't change shared data
754 if ( !m_refData )
755 {
756 m_refData = new wxFontRefData();
757 }
758 else
759 {
760 wxFontRefData* ref = new wxFontRefData(*M_FONTDATA);
761 UnRef();
762 m_refData = ref;
763 }
764 }
765
766 // ----------------------------------------------------------------------------
767 // change font attribute: we recreate font when doing it
768 // ----------------------------------------------------------------------------
769
770 void wxFont::SetPointSize(int pointSize)
771 {
772 Unshare();
773
774 M_FONTDATA->SetPointSize(pointSize);
775
776 RealizeResource();
777 }
778
779 void wxFont::SetFamily(int family)
780 {
781 Unshare();
782
783 M_FONTDATA->SetFamily(family);
784
785 RealizeResource();
786 }
787
788 void wxFont::SetStyle(int style)
789 {
790 Unshare();
791
792 M_FONTDATA->SetStyle(style);
793
794 RealizeResource();
795 }
796
797 void wxFont::SetWeight(int weight)
798 {
799 Unshare();
800
801 M_FONTDATA->SetWeight(weight);
802
803 RealizeResource();
804 }
805
806 void wxFont::SetFaceName(const wxString& faceName)
807 {
808 Unshare();
809
810 M_FONTDATA->SetFaceName(faceName);
811
812 RealizeResource();
813 }
814
815 void wxFont::SetUnderlined(bool underlined)
816 {
817 Unshare();
818
819 M_FONTDATA->SetUnderlined(underlined);
820
821 RealizeResource();
822 }
823
824 void wxFont::SetEncoding(wxFontEncoding encoding)
825 {
826 Unshare();
827
828 M_FONTDATA->SetEncoding(encoding);
829
830 RealizeResource();
831 }
832
833 void wxFont::SetNativeFontInfo(const wxNativeFontInfo& info)
834 {
835 Unshare();
836
837 FreeResource();
838
839 *M_FONTDATA = wxFontRefData(info);
840
841 RealizeResource();
842 }
843
844 // ----------------------------------------------------------------------------
845 // accessors
846 // ----------------------------------------------------------------------------
847
848 int wxFont::GetPointSize() const
849 {
850 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
851
852 return M_FONTDATA->GetPointSize();
853 }
854
855 int wxFont::GetFamily() const
856 {
857 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
858
859 return M_FONTDATA->GetFamily();
860 }
861
862 int wxFont::GetStyle() const
863 {
864 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
865
866 return M_FONTDATA->GetStyle();
867 }
868
869 int wxFont::GetWeight() const
870 {
871 wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
872
873 return M_FONTDATA->GetWeight();
874 }
875
876 bool wxFont::GetUnderlined() const
877 {
878 wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
879
880 return M_FONTDATA->GetUnderlined();
881 }
882
883 wxString wxFont::GetFaceName() const
884 {
885 wxCHECK_MSG( Ok(), wxT(""), wxT("invalid font") );
886
887 return M_FONTDATA->GetFaceName();
888 }
889
890 wxFontEncoding wxFont::GetEncoding() const
891 {
892 wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
893
894 return M_FONTDATA->GetEncoding();
895 }
896
897 wxNativeFontInfo *wxFont::GetNativeFontInfo() const
898 {
899 if ( M_FONTDATA->HasNativeFontInfo() )
900 return new wxNativeFontInfo(M_FONTDATA->GetNativeFontInfo());
901
902 return 0;
903 }
904