]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/font.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "font.h"
19 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
23 extern wxFontNameDirectory
*wxTheFontNameDirectory
;
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
29 class wxFontRefData
: public wxObjectRefData
36 wxList m_scaled_xfonts
;
38 int m_family
, m_style
, m_weight
;
49 wxFontRefData::wxFontRefData(void) : m_scaled_xfonts(wxKEY_INTEGER
)
51 m_byXFontName
= FALSE
;
58 m_faceName
= (char *) NULL
;
59 m_font
= (GdkFont
*) NULL
;
62 wxFontRefData::~wxFontRefData(void)
64 wxNode
*node
= m_scaled_xfonts
.First();
67 GdkFont
*font
= (GdkFont
*)node
->Data();
68 wxNode
*next
= node
->Next();
69 gdk_font_unref( font
);
75 m_faceName
= (char *) NULL
;
77 if (m_font
) gdk_font_unref( m_font
);
80 //-----------------------------------------------------------------------------
82 #define M_FONTDATA ((wxFontRefData *)m_refData)
84 IMPLEMENT_DYNAMIC_CLASS(wxFont
, wxGDIObject
)
88 if (wxTheFontList
) wxTheFontList
->Append( this );
91 wxFont::wxFont( char *xFontName
)
93 if (!xFontName
) return;
95 m_refData
= new wxFontRefData();
97 M_FONTDATA
->m_byXFontName
= TRUE
;
98 M_FONTDATA
->m_font
= gdk_font_load( xFontName
);
101 wxFont::wxFont(int PointSize
, int FontIdOrFamily
, int Style
, int Weight
,
102 bool Underlined
, const char* Face
)
104 m_refData
= new wxFontRefData();
106 if ((M_FONTDATA
->m_faceName
= (Face
) ? copystring(Face
) : (char*)NULL
) )
108 M_FONTDATA
->m_fontId
= wxTheFontNameDirectory
->FindOrCreateFontId( Face
, FontIdOrFamily
);
109 M_FONTDATA
->m_family
= wxTheFontNameDirectory
->GetFamily( FontIdOrFamily
);
113 M_FONTDATA
->m_fontId
= FontIdOrFamily
;
114 M_FONTDATA
->m_family
= wxTheFontNameDirectory
->GetFamily( FontIdOrFamily
);
116 if (Style
== wxDEFAULT
) Style
= wxSWISS
;
117 M_FONTDATA
->m_style
= Style
;
118 if (Weight
== wxDEFAULT
) Weight
= wxNORMAL
;
119 M_FONTDATA
->m_weight
= Weight
;
120 if (PointSize
== wxDEFAULT
) PointSize
= 10;
121 M_FONTDATA
->m_pointSize
= PointSize
;
122 M_FONTDATA
->m_underlined
= Underlined
;
124 if (wxTheFontList
) wxTheFontList
->Append( this );
127 wxFont::wxFont(int PointSize
, const char *Face
, int Family
, int Style
,
128 int Weight
, bool Underlined
)
130 m_refData
= new wxFontRefData();
132 M_FONTDATA
->m_fontId
= wxTheFontNameDirectory
->FindOrCreateFontId( Face
, Family
);
133 M_FONTDATA
->m_faceName
= (Face
) ? copystring(Face
) : (char*)NULL
;
134 M_FONTDATA
->m_family
= wxTheFontNameDirectory
->GetFamily( M_FONTDATA
->m_fontId
);
135 M_FONTDATA
->m_style
= Style
;
136 M_FONTDATA
->m_weight
= Weight
;
137 M_FONTDATA
->m_pointSize
= PointSize
;
138 M_FONTDATA
->m_underlined
= Underlined
;
140 if (wxTheFontList
) wxTheFontList
->Append( this );
143 wxFont::wxFont( const wxFont
& font
)
147 if (wxTheFontList
) wxTheFontList
->Append( this );
150 wxFont::wxFont( const wxFont
* font
)
153 if (font
) Ref( *font
);
155 if (wxTheFontList
) wxTheFontList
->Append( this );
158 wxFont::~wxFont(void)
160 if (wxTheFontList
) wxTheFontList
->DeleteObject( this );
163 wxFont
& wxFont::operator = ( const wxFont
& font
)
165 if (*this == font
) return (*this);
170 bool wxFont::operator == ( const wxFont
& font
)
172 return m_refData
== font
.m_refData
;
175 bool wxFont::operator != ( const wxFont
& font
)
177 return m_refData
!= font
.m_refData
;
180 bool wxFont::Ok() const
182 return (m_refData
!= NULL
);
185 int wxFont::GetPointSize(void) const
189 wxFAIL_MSG( "invalid font" );
193 return M_FONTDATA
->m_pointSize
;
196 wxString
wxFont::GetFaceString(void) const
200 wxFAIL_MSG( "invalid font" );
204 wxString s
= wxTheFontNameDirectory
->GetFontName( M_FONTDATA
->m_fontId
);
208 wxString
wxFont::GetFaceName(void) const
212 wxFAIL_MSG( "invalid font" );
216 wxString s
= wxTheFontNameDirectory
->GetFontName( M_FONTDATA
->m_fontId
);
220 int wxFont::GetFamily(void) const
224 wxFAIL_MSG( "invalid font" );
228 return M_FONTDATA
->m_family
;
231 wxString
wxFont::GetFamilyString(void) const
235 wxFAIL_MSG( "invalid font" );
239 switch (M_FONTDATA
->m_family
)
241 case wxDECORATIVE
: return wxString("wxDECORATIVE");
242 case wxROMAN
: return wxString("wxROMAN");
243 case wxSCRIPT
: return wxString("wxSCRIPT");
244 case wxSWISS
: return wxString("wxSWISS");
245 case wxMODERN
: return wxString("wxMODERN");
246 case wxTELETYPE
: return wxString("wxTELETYPE");
247 default: return "wxDEFAULT";
253 int wxFont::GetFontId(void) const
257 wxFAIL_MSG( "invalid font" );
261 return M_FONTDATA
->m_fontId
; // stub
264 int wxFont::GetStyle(void) const
268 wxFAIL_MSG( "invalid font" );
272 return M_FONTDATA
->m_style
;
275 wxString
wxFont::GetStyleString(void) const
279 wxFAIL_MSG( "invalid font" );
283 switch (M_FONTDATA
->m_style
)
285 case wxNORMAL
: return wxString("wxNORMAL");
286 case wxSLANT
: return wxString("wxSLANT");
287 case wxITALIC
: return wxString("wxITALIC");
288 default: return wxString("wxDEFAULT");
291 return wxString("wxDEFAULT");
294 int wxFont::GetWeight(void) const
298 wxFAIL_MSG( "invalid font" );
302 return M_FONTDATA
->m_weight
;
305 wxString
wxFont::GetWeightString(void) const
309 wxFAIL_MSG( "invalid font" );
313 switch (M_FONTDATA
->m_weight
)
315 case wxNORMAL
: return wxString("wxNORMAL");
316 case wxBOLD
: return wxString("wxBOLD");
317 case wxLIGHT
: return wxString("wxLIGHT");
318 default: return wxString("wxDEFAULT");
321 return wxString("wxDEFAULT");
324 bool wxFont::GetUnderlined(void) const
328 wxFAIL_MSG( "invalid font" );
332 return M_FONTDATA
->m_underlined
;
335 //-----------------------------------------------------------------------------
336 // get internal representation of font
337 //-----------------------------------------------------------------------------
339 // local help function
340 static GdkFont
*wxLoadQueryNearestFont(int point_size
, int fontid
,
341 int style
, int weight
,
344 GdkFont
*wxFont::GetInternalFont(float scale
) const
348 wxFAIL_MSG( "invalid font" );
349 return (GdkFont
*) NULL
;
352 if (M_FONTDATA
->m_byXFontName
) return M_FONTDATA
->m_font
;
354 long int_scale
= long(scale
* 100.0 + 0.5); // key for fontlist
355 int point_scale
= (M_FONTDATA
->m_pointSize
* 10 * int_scale
) / 100;
356 GdkFont
*font
= (GdkFont
*) NULL
;
358 wxNode
*node
= M_FONTDATA
->m_scaled_xfonts
.Find(int_scale
);
361 font
= (GdkFont
*)node
->Data();
365 font
= wxLoadQueryNearestFont( point_scale
, M_FONTDATA
->m_fontId
, M_FONTDATA
->m_style
,
366 M_FONTDATA
->m_weight
, M_FONTDATA
->m_underlined
);
367 M_FONTDATA
->m_scaled_xfonts
.Append( int_scale
, (wxObject
*)font
);
370 printf("could not load any font");
371 // wxError("could not load any font", "wxFont");
375 //-----------------------------------------------------------------------------
376 // local utilities to find a X font
377 //-----------------------------------------------------------------------------
379 static GdkFont
*wxLoadQueryFont(int point_size
, int fontid
, int style
,
380 int weight
, bool WXUNUSED(underlined
))
383 char *name
= wxTheFontNameDirectory
->GetScreenName( fontid
, weight
, style
);
386 name
= "-*-*-*-*-*-*-*-%d-*-*-*-*-*-*";
387 sprintf(buffer
, name
, point_size
);
389 return gdk_font_load( buffer
);
392 static GdkFont
*wxLoadQueryNearestFont(int point_size
, int fontid
,
393 int style
, int weight
,
398 font
= wxLoadQueryFont( point_size
, fontid
, style
, weight
, underlined
);
401 // search up and down by stepsize 10
402 int max_size
= point_size
+ 20 * (1 + (point_size
/180));
403 int min_size
= point_size
- 20 * (1 + (point_size
/180));
406 // Search for smaller size (approx.)
407 for (i
=point_size
-10; !font
&& i
>= 10 && i
>= min_size
; i
-= 10)
408 font
= wxLoadQueryFont(i
, fontid
, style
, weight
, underlined
);
409 // Search for larger size (approx.)
410 for (i
=point_size
+10; !font
&& i
<= max_size
; i
+= 10)
411 font
= wxLoadQueryFont(i
, fontid
, style
, weight
, underlined
);
412 // Try default family
413 if (!font
&& fontid
!= wxDEFAULT
)
414 font
= wxLoadQueryFont(point_size
, wxDEFAULT
, style
,
418 font
= wxLoadQueryFont(120, wxDEFAULT
, wxNORMAL
, wxNORMAL
,
424 //-----------------------------------------------------------------------------
425 // face names and index functions
426 //-----------------------------------------------------------------------------
428 static char *font_defaults
[] = {
429 "FamilyDefault", "Default",
430 "FamilyRoman", "Roman",
431 "FamilyDecorative", "Decorative",
432 "FamilyModern", "Modern",
433 "FamilyTeletype", "Teletype",
434 "FamilySwiss", "Swiss",
435 "FamilyScript", "Script",
441 "AfmItalic", "${AfmSlant}",
445 "AfmHelvetica", "Helv",
446 "AfmCourier", "Cour",
448 "Afm___", "${AfmTimes,$[weight],$[style]}",
450 "AfmTimes__", "${AfmTimes}${Afm$[weight]}${Afm$[style]}",
451 "AfmTimesMediumStraight", "${AfmTimes}${AfmRoman}",
452 "AfmTimesLightStraight", "${AfmTimes}${AfmRoman}",
453 "AfmTimes_Italic", "${AfmTimes}$[weight]${AfmItalic}",
454 "AfmTimes_Slant", "${AfmTimes}$[weight]${AfmItalic}",
456 "AfmSwiss__", "${AfmHelvetica}${Afm$[weight]}${Afm$[style]}",
457 "AfmModern__", "${AfmCourier}${Afm$[weight]}${Afm$[style]}",
459 "AfmTeletype__", "${AfmModern,$[weight],$[style]}",
461 "PostScriptMediumStraight", "",
462 "PostScriptMediumItalic", "-Oblique",
463 "PostScriptMediumSlant", "-Oblique",
464 "PostScriptLightStraight", "",
465 "PostScriptLightItalic", "-Oblique",
466 "PostScriptLightSlant", "-Oblique",
467 "PostScriptBoldStraight", "-Bold",
468 "PostScriptBoldItalic", "-BoldOblique",
469 "PostScriptBoldSlant", "-BoldOblique",
471 #if WX_NORMALIZED_PS_FONTS
472 "PostScript___", "${PostScriptTimes,$[weight],$[style]}",
474 "PostScriptRoman__", "${PostScriptTimes,$[weight],$[style]}",
475 "PostScript___", "LucidaSans${PostScript$[weight]$[style]}",
478 "PostScriptTimesMedium", "",
479 "PostScriptTimesLight", "",
480 "PostScriptTimesBold", "Bold",
482 "PostScriptTimes__", "Times${PostScript$[weight]$[style]}",
483 "PostScriptTimesMediumStraight", "Times-Roman",
484 "PostScriptTimesLightStraight", "Times-Roman",
485 "PostScriptTimes_Slant", "Times-${PostScriptTimes$[weight]}Italic",
486 "PostScriptTimes_Italic", "Times-${PostScriptTimes$[weight]}Italic",
488 "PostScriptSwiss__", "Helvetica${PostScript$[weight]$[style]}",
489 "PostScriptModern__", "Courier${PostScript$[weight]$[style]}",
491 "PostScriptTeletype__", "${PostScriptModern,$[weight],$[style]}",
493 #if !WX_NORMALIZED_PS_FONTS
494 "PostScriptScript__", "Zapf-Chancery-MediumItalic",
497 "ScreenMedium", "medium",
498 "ScreenBold", "bold",
499 "ScreenLight", "light",
500 "ScreenStraight", "r",
504 "ScreenDefaultBase", "misc-fixed",
505 "ScreenRomanBase", "*-times",
506 "ScreenDecorativeBase", "*-helvetica",
507 "ScreenModernBase", "*-courier",
508 "ScreenTeletypeBase", "*-lucidatypewriter",
509 "ScreenSwissBase", "*-lucida",
510 "ScreenScriptBase", "*-zapfchancery",
512 "ScreenStdSuffix", "-${Screen$[weight]}-${Screen$[style]}"
513 "-normal-*-*-%d-*-*-*-*-*-*",
516 "-${ScreenDefaultBase}${ScreenStdSuffix}",
518 "-${ScreenRomanBase}${ScreenStdSuffix}",
519 "ScreenDecorative__",
520 "-${ScreenDecorativeBase}${ScreenStdSuffix}",
522 "-${ScreenModernBase}${ScreenStdSuffix}",
524 "-${ScreenTeletypeBase}${ScreenStdSuffix}",
526 "-${ScreenSwissBase}${ScreenStdSuffix}",
528 "-${ScreenScriptBase}${ScreenStdSuffix}",
532 enum {wxWEIGHT_NORMAL
, wxWEIGHT_BOLD
, wxWEIGHT_LIGHT
, wxNUM_WEIGHTS
};
533 enum {wxSTYLE_NORMAL
, wxSTYLE_ITALIC
, wxSTYLE_SLANT
, wxNUM_STYLES
};
535 static int WCoordinate(int w
)
538 case wxBOLD
: return wxWEIGHT_BOLD
;
539 case wxLIGHT
: return wxWEIGHT_LIGHT
;
541 default: return wxWEIGHT_NORMAL
;
545 static int SCoordinate(int s
)
548 case wxITALIC
: return wxSTYLE_ITALIC
;
549 case wxSLANT
: return wxSTYLE_SLANT
;
551 default: return wxSTYLE_NORMAL
;
555 //-----------------------------------------------------------------------------
557 //-----------------------------------------------------------------------------
563 inline char *GetName(int weight
, int style
)
565 return ( map
[WCoordinate(weight
)] [SCoordinate(style
)] );
568 char *map
[wxNUM_WEIGHTS
][wxNUM_STYLES
];
569 void Initialize(const char *, const char *);
573 #define wxGetResource(a, b, c) 0
576 static void SearchResource(const char *prefix
, const char **names
, int count
, char **v
)
579 char resource
[1024], **defaults
, *internal
;
584 internal
= (char *) NULL
;
586 for (i
= 0; i
< k
; i
++) {
587 strcpy(resource
, prefix
);
588 for (j
= 0; j
< count
; j
++) {
590 strcat(resource
, names
[j
]);
592 strcat(resource
, "_");
594 if (wxGetResource(wxAPP_CLASS
, (char *)resource
, v
))
597 defaults
= font_defaults
;
599 if (!strcmp(*defaults
, resource
)) {
600 internal
= defaults
[1];
608 *v
= copystring(internal
);
611 wxSuffixMap::~wxSuffixMap(void)
615 for (k
= 0; k
< wxNUM_WEIGHTS
; ++k
)
616 for (j
= 0; j
< wxNUM_STYLES
; ++j
)
619 map
[k
][j
] = (char *) NULL
;
623 void wxSuffixMap::Initialize(const char *resname
, const char *devresname
)
625 const char *weight
, *style
;
628 const char *names
[3];
630 for (k
= 0; k
< wxNUM_WEIGHTS
; k
++) {
632 case wxWEIGHT_NORMAL
: weight
= "Medium"; break;
633 case wxWEIGHT_LIGHT
: weight
= "Light"; break;
635 default: weight
= "Bold";
637 for (j
= 0; j
< wxNUM_STYLES
; j
++) {
639 case wxSTYLE_NORMAL
: style
= "Straight"; break;
640 case wxSTYLE_ITALIC
: style
= "Italic"; break;
642 default: style
= "Slant";
648 SearchResource(devresname
, names
, 3, &v
);
650 /* Expand macros in the found string: */
652 int len
, closer
= 0, startpos
= 0;
654 len
= (v
? strlen(v
) : 0);
655 for (i
= 0; i
< len
; i
++) {
656 if (v
[i
] == '$' && ((v
[i
+1] == '[') || (v
[i
+1] == '{'))) {
658 closer
= (v
[i
+1] == '[') ? ']' : '}';
660 } else if (v
[i
] == closer
) {
662 const char *r
= (char *) NULL
; bool delete_r
= FALSE
;
665 name
= v
+ startpos
+ 2;
672 for (i
= 0, count
= 1; name
[i
]; i
++)
678 names
= new char*[count
];
680 for (i
= 0, count
= 1; i
< len
; i
++)
681 if (name
[i
] == ',') {
682 names
[count
++] = name
+ i
+ 1;
686 SearchResource("", (const char **)names
, count
, (char **)&r
);
691 for (i
= 0; i
< len
; i
++)
695 printf("Bad resource name \"%s\" in font lookup\n", name
);
697 } else if (!strcmp(name
, "weight")) {
699 } else if (!strcmp(name
, "style")) {
701 } else if (!strcmp(name
, "family")) {
705 printf("Bad font macro name \"%s\"\n", name
);
709 newstrlen
= strlen(r
);
710 char *naya
= new char[startpos
+ newstrlen
+ len
- i
];
711 memcpy(naya
, v
, startpos
);
712 memcpy(naya
+ startpos
, r
, newstrlen
);
713 memcpy(naya
+ startpos
+ newstrlen
, v
+ i
+ 1, len
- i
);
722 /* We have a final value: */
728 //-----------------------------------------------------------------------------
730 //-----------------------------------------------------------------------------
732 class wxFontNameItem
: public wxObject
{
733 DECLARE_DYNAMIC_CLASS(wxFontNameItem
)
735 wxFontNameItem(const char *name
, int id
, int family
);
738 inline char* GetScreenName(int w
, int s
) {return screen
.GetName(w
, s
);}
739 inline char* GetPostScriptName(int w
, int s
) {return printing
.GetName(w
, s
);}
740 inline char* GetAFMName(int w
, int s
) {return afm
.GetName(w
, s
);}
741 inline char* GetName(void) {return name
;}
742 inline int GetFamily(void) {return family
;}
743 inline int GetId(void) {return id
;}
744 inline bool IsRoman(void) {return isroman
;}
746 void Dump(ostream
& str
);
752 wxSuffixMap screen
, printing
, afm
;
756 IMPLEMENT_ABSTRACT_CLASS(wxFontNameItem
, wxObject
)
758 wxFontNameItem::wxFontNameItem(const char *Name
, int Id
, int Family
)
760 name
= copystring(Name
);
764 screen
. Initialize(name
, "Screen");
765 printing
.Initialize(name
, "PostScript");
766 afm
. Initialize(name
, "Afm");
769 wxFontNameItem::~wxFontNameItem(void)
773 name
= (char *) NULL
;
777 void wxFontNameItem::Dump(ostream
& str
)
779 str
<< "wxFontNameItem(" << name
<< ")";
783 //-----------------------------------------------------------------------------
785 //-----------------------------------------------------------------------------
787 IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory
, wxObject
)
789 wxFontNameDirectory::wxFontNameDirectory(void)
791 table
= new wxHashTable(wxKEY_INTEGER
, 20);
795 wxFontNameDirectory::~wxFontNameDirectory()
797 // Cleanup wxFontNameItems allocated
799 wxNode
*node
= table
->Next();
801 wxFontNameItem
*item
= (wxFontNameItem
*)node
->Data();
803 node
= table
->Next();
808 int wxFontNameDirectory::GetNewFontId(void)
810 return (nextFontId
--);
813 void wxFontNameDirectory::Initialize()
815 Initialize(wxDEFAULT
, wxDEFAULT
, "Default");
816 Initialize(wxDECORATIVE
, wxDECORATIVE
, "Decorative");
817 Initialize(wxROMAN
, wxROMAN
, "Roman");
818 Initialize(wxMODERN
, wxMODERN
, "Modern");
819 Initialize(wxTELETYPE
, wxTELETYPE
, "Teletype");
820 Initialize(wxSWISS
, wxSWISS
, "Swiss");
821 Initialize(wxSCRIPT
, wxSCRIPT
, "Script");
824 void wxFontNameDirectory::Initialize(int fontid
, int family
, const char *resname
)
826 char *fam
, resource
[256];
828 sprintf(resource
, "Family%s", resname
);
829 SearchResource((const char *)resource
, (const char **) NULL
, 0, (char **)&fam
);
831 if (!strcmp(fam
, "Default")) family
= wxDEFAULT
;
832 else if (!strcmp(fam
, "Roman")) family
= wxROMAN
;
833 else if (!strcmp(fam
, "Decorative")) family
= wxDECORATIVE
;
834 else if (!strcmp(fam
, "Modern")) family
= wxMODERN
;
835 else if (!strcmp(fam
, "Teletype")) family
= wxTELETYPE
;
836 else if (!strcmp(fam
, "Swiss")) family
= wxSWISS
;
837 else if (!strcmp(fam
, "Script")) family
= wxSCRIPT
;
838 delete[] fam
; // free resource
840 table
->Put(fontid
, new wxFontNameItem(resname
, fontid
, family
));
843 int wxFontNameDirectory::FindOrCreateFontId(const char *name
, int family
)
847 // font exists -> return id
848 if ( (id
= GetFontId(name
)) ) return id
;
850 Initialize(id
=GetNewFontId(), family
, name
);
854 char *wxFontNameDirectory::GetScreenName(int fontid
, int weight
, int style
)
856 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
858 return item
->GetScreenName(weight
, style
);
859 // font does not exist
860 return (char *) NULL
;
863 char *wxFontNameDirectory::GetPostScriptName(int fontid
, int weight
, int style
)
865 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
867 return item
->GetPostScriptName(weight
, style
);
868 // font does not exist
869 return (char *) NULL
;
872 char *wxFontNameDirectory::GetAFMName(int fontid
, int weight
, int style
)
874 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
876 return item
->GetAFMName(weight
, style
);
877 // font does not exist
878 return (char *) NULL
;
881 char *wxFontNameDirectory::GetFontName(int fontid
)
883 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
885 return item
->GetName();
886 // font does not exist
887 return (char *) NULL
;
890 int wxFontNameDirectory::GetFontId(const char *name
)
896 while ( (node
= table
->Next()) ) {
897 wxFontNameItem
*item
= (wxFontNameItem
*)node
->Data();
898 if (!strcmp(name
, item
->name
))
901 // font does not exist
905 int wxFontNameDirectory::GetFamily(int fontid
)
907 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
);
911 // font does not exist