1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
19 #pragma implementation "font.h"
25 #include "wx/gdicmn.h"
26 #include "wx/tokenzr.h"
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
36 #if wxUSE_FONTNAMEDIRECTORY
37 extern wxFontNameDirectory
*wxTheFontNameDirectory
;
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 class wxFontRefData
: public wxObjectRefData
47 wxFontRefData(int size
= wxDEFAULT
,
48 int family
= wxDEFAULT
,
49 int style
= wxDEFAULT
,
50 int weight
= wxDEFAULT
,
51 bool underlined
= FALSE
,
52 const wxString
& faceName
= wxEmptyString
,
53 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
54 : m_scaled_xfonts(wxKEY_INTEGER
)
56 Init(size
, family
, style
, weight
, underlined
, faceName
, encoding
);
59 wxFontRefData( const wxFontRefData
& data
);
61 virtual ~wxFontRefData();
64 // common part of all ctors
65 void Init(int pointSize
,
70 const wxString
& faceName
,
71 wxFontEncoding encoding
);
74 wxList m_scaled_xfonts
;
82 wxFontEncoding m_encoding
;
90 // ============================================================================
92 // ============================================================================
94 // ----------------------------------------------------------------------------
96 // ----------------------------------------------------------------------------
98 void wxFontRefData::Init(int pointSize
,
103 const wxString
& faceName
,
104 wxFontEncoding encoding
)
106 if (family
== wxDEFAULT
)
111 m_faceName
= faceName
;
113 if (style
== wxDEFAULT
)
118 if (weight
== wxDEFAULT
)
123 if (pointSize
== wxDEFAULT
)
126 m_pointSize
= pointSize
;
128 m_underlined
= underlined
;
129 m_encoding
= encoding
;
131 m_byXFontName
= FALSE
;
132 m_font
= (GdkFont
*) NULL
;
135 wxFontRefData::wxFontRefData( const wxFontRefData
& data
)
136 : m_scaled_xfonts(wxKEY_INTEGER
)
138 Init(data
.m_pointSize
, data
.m_family
, data
.m_style
, data
.m_weight
,
139 data
.m_underlined
, data
.m_faceName
, data
.m_encoding
);
142 m_font
= gdk_font_ref( data
.m_font
);
145 wxFontRefData::~wxFontRefData()
147 wxNode
*node
= m_scaled_xfonts
.First();
150 GdkFont
*font
= (GdkFont
*)node
->Data();
151 wxNode
*next
= node
->Next();
152 gdk_font_unref( font
);
157 gdk_font_unref( m_font
);
160 // ----------------------------------------------------------------------------
162 // ----------------------------------------------------------------------------
164 IMPLEMENT_DYNAMIC_CLASS(wxFont
, wxGDIObject
)
169 wxTheFontList
->Append( this );
172 wxFont::wxFont( GdkFont
*font
, char *xFontName
)
177 // VZ: this ctor ddidn't append the font to wxTheFontList before, but
178 // there is no reason to not do it, is there?
181 m_refData
= new wxFontRefData();
183 // M_FONTDATA->m_byXFontName = TRUE;
184 M_FONTDATA
->m_font
= font
;
188 wxString
fontname( xFontName
);
189 wxStringTokenizer
tn( fontname
, _T("-") );
191 tn
.GetNextToken(); // foundry
193 M_FONTDATA
->m_faceName
= tn
.GetNextToken(); // courier
195 tmp
= tn
.GetNextToken().MakeUpper();
196 if (tmp
== _T("BOLD")) M_FONTDATA
->m_weight
= wxBOLD
;
198 tmp
= tn
.GetNextToken().MakeUpper();
199 if (tmp
== _T("I")) M_FONTDATA
->m_style
= wxITALIC
;
200 if (tmp
== _T("O")) M_FONTDATA
->m_style
= wxITALIC
;
202 tn
.GetNextToken(); // set width
203 tn
.GetNextToken(); // ?
204 tn
.GetNextToken(); // pixel size
206 tmp
= tn
.GetNextToken(); // pointsize
207 int num
= wxStrtol (tmp
.c_str(), (wxChar
**) NULL
, 10);
208 M_FONTDATA
->m_pointSize
= num
/ 10;
210 tn
.GetNextToken(); // x-res
211 tn
.GetNextToken(); // y-res
213 tmp
= tn
.GetNextToken().MakeUpper();
214 if (tmp
== _T("M")) M_FONTDATA
->m_family
= wxMODERN
;
215 else if (M_FONTDATA
->m_faceName
== _T("TIMES")) M_FONTDATA
->m_family
= wxROMAN
;
216 else if (M_FONTDATA
->m_faceName
== _T("HELVETICA")) M_FONTDATA
->m_family
= wxSWISS
;
217 else if (M_FONTDATA
->m_faceName
== _T("LUCIDATYPEWRITER")) M_FONTDATA
->m_family
= wxTELETYPE
;
218 else if (M_FONTDATA
->m_faceName
== _T("LUCIDA")) M_FONTDATA
->m_family
= wxDECORATIVE
;
219 else if (M_FONTDATA
->m_faceName
== _T("UTOPIA")) M_FONTDATA
->m_family
= wxSCRIPT
;
222 bool wxFont::Create( int pointSize
,
227 const wxString
& face
,
228 wxFontEncoding encoding
)
230 m_refData
= new wxFontRefData(pointSize
, family
, style
, weight
,
231 underlined
, face
, encoding
);
238 void wxFont::Unshare()
242 m_refData
= new wxFontRefData();
246 wxFontRefData
* ref
= new wxFontRefData(*(wxFontRefData
*)m_refData
);
255 wxTheFontList
->DeleteObject( this );
258 // ----------------------------------------------------------------------------
260 // ----------------------------------------------------------------------------
262 int wxFont::GetPointSize() const
264 wxCHECK_MSG( Ok(), 0, _T("invalid font") );
266 return M_FONTDATA
->m_pointSize
;
269 wxString
wxFont::GetFaceName() const
271 wxCHECK_MSG( Ok(), _T(""), _T("invalid font") );
273 return M_FONTDATA
->m_faceName
;
276 int wxFont::GetFamily() const
278 wxCHECK_MSG( Ok(), 0, _T("invalid font") );
280 return M_FONTDATA
->m_family
;
283 int wxFont::GetStyle() const
285 wxCHECK_MSG( Ok(), 0, _T("invalid font") );
287 return M_FONTDATA
->m_style
;
290 int wxFont::GetWeight() const
292 wxCHECK_MSG( Ok(), 0, _T("invalid font") );
294 return M_FONTDATA
->m_weight
;
297 bool wxFont::GetUnderlined() const
299 wxCHECK_MSG( Ok(), FALSE
, _T("invalid font") );
301 return M_FONTDATA
->m_underlined
;
305 wxFontEncoding
wxFont::GetEncoding() const
307 wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT
, _T("invalid font") );
309 return M_FONTDATA
->m_encoding
;
312 // ----------------------------------------------------------------------------
313 // change font attributes
314 // ----------------------------------------------------------------------------
316 void wxFont::SetPointSize(int pointSize
)
320 M_FONTDATA
->m_pointSize
= pointSize
;
323 void wxFont::SetFamily(int family
)
327 M_FONTDATA
->m_family
= family
;
330 void wxFont::SetStyle(int style
)
334 M_FONTDATA
->m_style
= style
;
337 void wxFont::SetWeight(int weight
)
341 M_FONTDATA
->m_weight
= weight
;
344 void wxFont::SetFaceName(const wxString
& faceName
)
348 M_FONTDATA
->m_faceName
= faceName
;
351 void wxFont::SetUnderlined(bool underlined
)
355 M_FONTDATA
->m_underlined
= underlined
;
358 void wxFont::SetEncoding(wxFontEncoding encoding
)
362 M_FONTDATA
->m_encoding
= encoding
;
365 // ----------------------------------------------------------------------------
366 // get internal representation of font
367 // ----------------------------------------------------------------------------
369 GdkFont
*wxFont::GetInternalFont( float scale
) const
373 wxFAIL_MSG( _T("invalid font") );
375 return (GdkFont
*) NULL
;
378 /* short cut if the special X font constructor has been used */
379 if (M_FONTDATA
->m_byXFontName
)
380 return M_FONTDATA
->m_font
;
382 long int_scale
= long(scale
* 100.0 + 0.5); /* key for fontlist */
383 int point_scale
= (M_FONTDATA
->m_pointSize
* 10 * int_scale
) / 100;
384 GdkFont
*font
= (GdkFont
*) NULL
;
386 wxNode
*node
= M_FONTDATA
->m_scaled_xfonts
.Find(int_scale
);
389 font
= (GdkFont
*)node
->Data();
394 if ((int_scale
== 100) &&
395 (M_FONTDATA
->m_family
== wxSWISS
) &&
396 (M_FONTDATA
->m_style
== wxNORMAL
) &&
397 (M_FONTDATA
->m_pointSize
== 12) &&
398 (M_FONTDATA
->m_weight
== wxNORMAL
) &&
399 (M_FONTDATA
->m_underlined
== FALSE
))
401 font
= gdk_font_load( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
406 font
= wxLoadQueryNearestFont( point_scale
,
407 M_FONTDATA
->m_family
,
409 M_FONTDATA
->m_weight
,
410 M_FONTDATA
->m_underlined
,
411 M_FONTDATA
->m_faceName
,
412 M_FONTDATA
->m_encoding
);
415 M_FONTDATA
->m_scaled_xfonts
.Append( int_scale
, (wxObject
*)font
);
420 wxLogError(_T("could not load any font"));
426 //-----------------------------------------------------------------------------
427 // local utilities to find a X font
428 //-----------------------------------------------------------------------------
430 // wow, what's this stuff? Is it used/useful? (VZ)
433 //-----------------------------------------------------------------------------
434 // face names and index functions
435 //-----------------------------------------------------------------------------
437 static char *font_defaults
[] = {
438 "FamilyDefault", "Default",
439 "FamilyRoman", "Roman",
440 "FamilyDecorative", "Decorative",
441 "FamilyModern", "Modern",
442 "FamilyTeletype", "Teletype",
443 "FamilySwiss", "Swiss",
444 "FamilyScript", "Script",
450 "AfmItalic", "${AfmSlant}",
454 "AfmHelvetica", "Helv",
455 "AfmCourier", "Cour",
457 "Afm___", "${AfmTimes,$[weight],$[style]}",
459 "AfmTimes__", "${AfmTimes}${Afm$[weight]}${Afm$[style]}",
460 "AfmTimesMediumStraight", "${AfmTimes}${AfmRoman}",
461 "AfmTimesLightStraight", "${AfmTimes}${AfmRoman}",
462 "AfmTimes_Italic", "${AfmTimes}$[weight]${AfmItalic}",
463 "AfmTimes_Slant", "${AfmTimes}$[weight]${AfmItalic}",
465 "AfmSwiss__", "${AfmHelvetica}${Afm$[weight]}${Afm$[style]}",
466 "AfmModern__", "${AfmCourier}${Afm$[weight]}${Afm$[style]}",
468 "AfmTeletype__", "${AfmModern,$[weight],$[style]}",
470 "PostScriptMediumStraight", "",
471 "PostScriptMediumItalic", "-Oblique",
472 "PostScriptMediumSlant", "-Oblique",
473 "PostScriptLightStraight", "",
474 "PostScriptLightItalic", "-Oblique",
475 "PostScriptLightSlant", "-Oblique",
476 "PostScriptBoldStraight", "-Bold",
477 "PostScriptBoldItalic", "-BoldOblique",
478 "PostScriptBoldSlant", "-BoldOblique",
480 #if WX_NORMALIZED_PS_FONTS
481 "PostScript___", "${PostScriptTimes,$[weight],$[style]}",
483 "PostScriptRoman__", "${PostScriptTimes,$[weight],$[style]}",
484 "PostScript___", "LucidaSans${PostScript$[weight]$[style]}",
487 "PostScriptTimesMedium", "",
488 "PostScriptTimesLight", "",
489 "PostScriptTimesBold", "Bold",
491 "PostScriptTimes__", "Times${PostScript$[weight]$[style]}",
492 "PostScriptTimesMediumStraight", "Times-Roman",
493 "PostScriptTimesLightStraight", "Times-Roman",
494 "PostScriptTimes_Slant", "Times-${PostScriptTimes$[weight]}Italic",
495 "PostScriptTimes_Italic", "Times-${PostScriptTimes$[weight]}Italic",
497 "PostScriptSwiss__", "Helvetica${PostScript$[weight]$[style]}",
498 "PostScriptModern__", "Courier${PostScript$[weight]$[style]}",
500 "PostScriptTeletype__", "${PostScriptModern,$[weight],$[style]}",
502 #if !WX_NORMALIZED_PS_FONTS
503 "PostScriptScript__", "Zapf-Chancery-MediumItalic",
506 "ScreenMedium", "medium",
507 "ScreenBold", "bold",
508 "ScreenLight", "light",
509 "ScreenStraight", "r",
513 "ScreenDefaultBase", "*-times",
515 "ScreenRomanBase", "*-times",
516 "ScreenDecorativeBase", "*-helvetica",
517 "ScreenModernBase", "*-courier",
518 "ScreenTeletypeBase", "*-lucidatypewriter",
519 "ScreenSwissBase", "*-lucida",
520 "ScreenScriptBase", "*-zapfchancery",
522 "ScreenStdSuffix", "-${Screen$[weight]}-${Screen$[style]}"
523 "-normal-*-*-%d-*-*-*-*-*-*",
526 "-${ScreenDefaultBase}${ScreenStdSuffix}",
528 "-${ScreenRomanBase}${ScreenStdSuffix}",
529 "ScreenDecorative__",
530 "-${ScreenDecorativeBase}${ScreenStdSuffix}",
532 "-${ScreenModernBase}${ScreenStdSuffix}",
534 "-${ScreenTeletypeBase}${ScreenStdSuffix}",
536 "-${ScreenSwissBase}${ScreenStdSuffix}",
538 "-${ScreenScriptBase}${ScreenStdSuffix}",
542 enum {wxWEIGHT_NORMAL
, wxWEIGHT_BOLD
, wxWEIGHT_LIGHT
, wxNUM_WEIGHTS
};
543 enum {wxSTYLE_NORMAL
, wxSTYLE_ITALIC
, wxSTYLE_SLANT
, wxNUM_STYLES
};
545 static int WCoordinate(int w
)
549 case wxBOLD
: return wxWEIGHT_BOLD
;
550 case wxLIGHT
: return wxWEIGHT_LIGHT
;
552 default: return wxWEIGHT_NORMAL
;
556 static int SCoordinate(int s
)
560 case wxITALIC
: return wxSTYLE_ITALIC
;
561 case wxSLANT
: return wxSTYLE_SLANT
;
563 default: return wxSTYLE_NORMAL
;
567 //-----------------------------------------------------------------------------
569 //-----------------------------------------------------------------------------
576 inline char *GetName(int weight
, int style
)
578 return ( map
[WCoordinate(weight
)] [SCoordinate(style
)] );
581 char *map
[wxNUM_WEIGHTS
][wxNUM_STYLES
];
582 void Initialize(const char *, const char *);
585 static void SearchResource(const char *prefix
, const char **names
, int count
, char **v
)
588 char resource
[1024], **defaults
, *internal
;
593 internal
= (char *) NULL
;
595 for (i
= 0; i
< k
; i
++)
597 strcpy(resource
, prefix
);
598 for (j
= 0; j
< count
; j
++)
600 // upon failure to find a matching fontname
601 // in the default fonts above, we substitute more
602 // and more values by _ so that at last ScreenMyFontBoldNormal
603 // would turn into Screen___ and this will then get
604 // converted to -${ScreenDefaultBase}${ScreenStdSuffix}
607 strcat(resource
, names
[j
]);
609 strcat(resource
, "_");
612 // we previously search the Xt-resources here
616 defaults
= font_defaults
;
619 if (!strcmp(*defaults
, resource
))
621 internal
= defaults
[1];
631 if ((strcmp(internal
,"-${ScreenDefaultBase}${ScreenStdSuffix}") == 0) &&
632 (strcmp(names
[0], "Default") != 0))
634 // we did not find any font name in the standard list.
635 // this can (hopefully does) mean that someone supplied
636 // the facename in the wxFont constructor so we insert
639 strcpy( resource
,"-*-" ); // any producer
640 strcat( resource
, names
[0] ); // facename
641 strcat( resource
, "${ScreenStdSuffix}" ); // add size params later on
642 *v
= copystring(resource
);
646 *v
= copystring(internal
);
651 wxSuffixMap::~wxSuffixMap()
655 for (k
= 0; k
< wxNUM_WEIGHTS
; ++k
)
656 for (j
= 0; j
< wxNUM_STYLES
; ++j
)
660 map
[k
][j
] = (char *) NULL
;
664 void wxSuffixMap::Initialize(const char *resname
, const char *devresname
)
666 const char *weight
, *style
;
669 const char *names
[3];
671 for (k
= 0; k
< wxNUM_WEIGHTS
; k
++)
675 case wxWEIGHT_NORMAL
: weight
= "Medium"; break;
676 case wxWEIGHT_LIGHT
: weight
= "Light"; break;
678 default: weight
= "Bold";
680 for (j
= 0; j
< wxNUM_STYLES
; j
++)
684 case wxSTYLE_NORMAL
: style
= "Straight"; break;
685 case wxSTYLE_ITALIC
: style
= "Italic"; break;
687 default: style
= "Slant";
693 SearchResource(devresname
, names
, 3, &v
);
695 // Expand macros in the found string:
697 int len
, closer
= 0, startpos
= 0;
699 len
= (v
? strlen(v
) : 0);
700 for (i
= 0; i
< len
; i
++)
702 if (v
[i
] == '$' && ((v
[i
+1] == '[') || (v
[i
+1] == '{')))
705 closer
= (v
[i
+1] == '[') ? ']' : '}';
708 else if (v
[i
] == closer
)
711 const char *r
= (char *) NULL
; bool delete_r
= FALSE
;
714 name
= v
+ startpos
+ 2;
722 for (i
= 0, count
= 1; name
[i
]; i
++)
728 names
= new char*[count
];
730 for (i
= 0, count
= 1; i
< len
; i
++)
733 names
[count
++] = name
+ i
+ 1;
737 SearchResource("", (const char **)names
, count
, (char **)&r
);
743 for (i
= 0; i
< len
; i
++)
747 wxLogError( "Bad resource name in font lookup." );
749 } else if (!strcmp(name
, "weight")) {
751 } else if (!strcmp(name
, "style")) {
753 } else if (!strcmp(name
, "family")) {
757 wxLogError( "Bad font macro name." );
761 newstrlen
= strlen(r
);
762 char *naya
= new char[startpos
+ newstrlen
+ len
- i
];
763 memcpy(naya
, v
, startpos
);
764 memcpy(naya
+ startpos
, r
, newstrlen
);
765 memcpy(naya
+ startpos
+ newstrlen
, v
+ i
+ 1, len
- i
);
774 // We have a final value:
780 //-----------------------------------------------------------------------------
782 //-----------------------------------------------------------------------------
784 class wxFontNameItem
: public wxObject
786 DECLARE_DYNAMIC_CLASS(wxFontNameItem
)
788 wxFontNameItem(const char *name
, int id
, int family
);
791 inline char* GetScreenName(int w
, int s
) {return screen
.GetName(w
, s
);}
792 inline char* GetPostScriptName(int w
, int s
) {return printing
.GetName(w
, s
);}
793 inline char* GetAFMName(int w
, int s
) {return afm
.GetName(w
, s
);}
794 inline char* GetName() {return name
;}
795 inline int GetFamily() {return family
;}
796 inline int GetId() {return id
;}
797 inline bool IsRoman() {return isroman
;}
798 #if defined(__WXDEBUG__)
799 void Dump(ostream
& str
);
805 wxSuffixMap screen
, printing
, afm
;
809 IMPLEMENT_ABSTRACT_CLASS(wxFontNameItem
, wxObject
)
811 wxFontNameItem::wxFontNameItem(const char *Name
, int Id
, int Family
)
813 name
= copystring(Name
);
817 screen
. Initialize(name
, "Screen");
818 printing
.Initialize(name
, "PostScript");
819 afm
. Initialize(name
, "Afm");
822 wxFontNameItem::~wxFontNameItem()
826 name
= (char *) NULL
;
829 #if defined(__WXDEBUG__)
830 void wxFontNameItem::Dump(ostream
& str
)
832 str
<< "wxFontNameItem(" << name
<< ")";
836 //-----------------------------------------------------------------------------
838 //-----------------------------------------------------------------------------
840 IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory
, wxObject
)
842 wxFontNameDirectory::wxFontNameDirectory()
844 table
= new wxHashTable(wxKEY_INTEGER
, 20);
848 wxFontNameDirectory::~wxFontNameDirectory()
850 // Cleanup wxFontNameItems allocated
852 wxNode
*node
= table
->Next();
855 wxFontNameItem
*item
= (wxFontNameItem
*)node
->Data();
857 node
= table
->Next();
862 int wxFontNameDirectory::GetNewFontId()
864 return (nextFontId
--);
867 void wxFontNameDirectory::Initialize()
869 Initialize(wxDEFAULT
, wxDEFAULT
, "Default");
870 Initialize(wxDECORATIVE
, wxDECORATIVE
, "Decorative");
871 Initialize(wxROMAN
, wxROMAN
, "Roman");
872 Initialize(wxMODERN
, wxMODERN
, "Modern");
873 Initialize(wxTELETYPE
, wxTELETYPE
, "Teletype");
874 Initialize(wxSWISS
, wxSWISS
, "Swiss");
875 Initialize(wxSCRIPT
, wxSCRIPT
, "Script");
878 void wxFontNameDirectory::Initialize(int fontid
, int family
, const char *resname
)
880 char *fam
, resource
[256];
882 sprintf(resource
, "Family%s", resname
);
883 SearchResource((const char *)resource
, (const char **) NULL
, 0, (char **)&fam
);
887 if (!strcmp(fam
, "Default")) family
= wxDEFAULT
;
888 else if (!strcmp(fam
, "Roman")) family
= wxROMAN
;
889 else if (!strcmp(fam
, "Decorative")) family
= wxDECORATIVE
;
890 else if (!strcmp(fam
, "Modern")) family
= wxMODERN
;
891 else if (!strcmp(fam
, "Teletype")) family
= wxTELETYPE
;
892 else if (!strcmp(fam
, "Swiss")) family
= wxSWISS
;
893 else if (!strcmp(fam
, "Script")) family
= wxSCRIPT
;
894 delete[] fam
; // free resource
896 table
->Put(fontid
, new wxFontNameItem(resname
, fontid
, family
));
899 int wxFontNameDirectory::FindOrCreateFontId(const char *name
, int family
)
903 // font exists -> return id
904 if ( (id
= GetFontId(name
)) ) return id
;
907 Initialize(id
=GetNewFontId(), family
, name
);
911 char *wxFontNameDirectory::GetScreenName(int fontid
, int weight
, int style
)
913 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
915 return item
->GetScreenName(weight
, style
);
917 // font does not exist
918 return (char *) NULL
;
921 char *wxFontNameDirectory::GetPostScriptName(int fontid
, int weight
, int style
)
923 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
925 return item
->GetPostScriptName(weight
, style
);
927 // font does not exist
928 return (char *) NULL
;
931 char *wxFontNameDirectory::GetAFMName(int fontid
, int weight
, int style
)
933 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
935 return item
->GetAFMName(weight
, style
);
936 // font does not exist
937 return (char *) NULL
;
940 char *wxFontNameDirectory::GetFontName(int fontid
)
942 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
); // find font
944 return item
->GetName();
946 // font does not exist
947 return (char *) NULL
;
950 int wxFontNameDirectory::GetFontId(const char *name
)
956 while ( (node
= table
->Next()) )
958 wxFontNameItem
*item
= (wxFontNameItem
*)node
->Data();
959 if (!strcmp(name
, item
->name
))
963 // font does not exist
967 int wxFontNameDirectory::GetFamily(int fontid
)
969 wxFontNameItem
*item
= (wxFontNameItem
*)table
->Get(fontid
);
974 // font does not exist